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
- 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
- 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
- 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