14 Commits

Author SHA1 Message Date
daveoconnor
26c4da06f2 Batched deletion of rendered content (#1959) (#1969) 2025-10-20 09:46:06 -07:00
daveoconnor
32b29f221a Improve docs performance - postgres caching (#1828) (#1838) 2025-07-01 13:35:50 -07:00
Gavin Wahl
cb25772a13 AsciiDoc use the embedded option (#1344)
Instead of parsing out the HTML body from the full HTML document.

All adoc parsing now goes through `convert_adoc_to_html`. I removed the
`adoc_to_html` task because it was never `.delay`ed, probably because it
doesn't necessarily work: it expects content to be passed in a temp
file, which might not exist on the worker processing the task. The new
function passes the content as a string instead of a temp file.

This removes the `div#header` and `div#content` containers from the
output. It's wrong to have IDs in embeddable html because multiple
asciidoc outputs might be included on the same page, resulting in
duplicate IDs. I couldn't find a place where these containers are
necessary, though, because markdown output doesn't include them,
resulting in a discrepancy in the output for markdown vs asciidoc that
is now fixed. If we need to include the containers, I'd wrap the
asciidoc output in the template where it is used rather than expecting
it to be returned by `convert_adoc_to_html`.

Fixes #1302
2024-10-11 10:34:04 -06:00
Lacey Williams Henschel
6755f76753 Replace relative image URLs with absolute URLs in static content files
- Add function to replace relative image paths with absolute paths
- Add docs on static content and adding shortcuts to the config file
- Add url and view for rendering static image data
2024-02-02 12:24:19 -08:00
Lacey Williams Henschel
0a9e0a2a7f Clear the static content database cache nightly of old files
- Add `created` and `modified` fields to `RenderedContent` models
- Add caching and RenderedContent docs
- Change cache key for library description rendered content
- Add `CLEAR_STATIC_CONTENT_CACHE_DAYS` setting
- Add manager method and task to clear static content cache
- Move task scheduler to main app
- Add daily task to clear rendered content cache
- Use created date and not updated date
2024-01-10 12:23:17 -08:00
Lacey Williams Henschel
d6563e6965 Add task to save rendered content to db; call tasks on delay 2023-07-03 13:19:55 -07:00
Lacey Williams Henschel
ea33581565 Reorganize tasks into better DRY-er modules 2023-07-03 13:19:55 -07:00
Lacey Williams Henschel
99e1c46d8e Delete content by cache key from redis and db 2023-06-27 15:25:56 -07:00
Lacey Williams Henschel
a06d9856c0 Add task to clear all rendered content cache 2023-06-27 15:25:56 -07:00
Lacey Williams Henschel
aa0bab9b89 Delete RenderedContent objects by content type 2023-06-27 15:25:56 -07:00
Lacey Williams Henschel
825dbc019b Cache asciidoc content in db (Part of #394)
- Add RenderedContent model and related helper methods
- Change StaticContentView `get()` logic to try the cache, then the db, then S3
- Change StaticContentView to update db appropriately
- Refactoring for readability/maintainability
2023-06-09 14:43:05 -07:00
Lacey Williams Henschel
b183c5bf44 Add option to delete temp file 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
60713d0c37 Return converted html from task 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
e3f37294aa Add celery task to convert adoc to html 2023-06-06 11:14:50 -07:00