250 Commits

Author SHA1 Message Date
Greg Newman
55253636a6 🚧 fix user-guide header
Now using proprietary styles for the user guide - not shared with docs.  We are able to better isolate and fix issues with the user guide header without having to touch antora.
2023-10-12 09:41:25 -04:00
sdarwin
d67159e3f0 Set STATIC_CONTENT_REGION env variable 2023-10-09 09:00:30 -06:00
Greg Newman
8ce13d8f82 🐛 don’t prettify
prettify is adding spaces to code blocks
2023-10-09 08:51:29 -04:00
Greg Newman
9a0b233805 🐛 do not block classes on toc 2023-10-06 18:45:04 -04:00
Lacey Williams Henschel
214f37986b Streamline import commands and add docs
Add data JSONField to LibraryVersion model

Add fields to library list admin display

Add commands to update authors and maintainers individually

Exclude data JSONField from view querysets

Silence some output from the library-version import management command

Remove unused field from the library-version import management command

Save library-versions more cleanly in the library-version import management command

Remove loading maintainers from the import command, since they now have their own command

Add docs for new commands

Add boost_setup command to run one command to import all data

Add docs on first-time data import

Better exception handling, quieter flow, reduce GH API calls

Graceful handling if there is not a github repo

Pass most recent 12 months to commit counts command

Add some user-friendly output to setup command
2023-09-19 11:17:05 -07:00
Greg Newman
7c00554bf4 cleans up antora header
* Cleans up the remnants of the antora header during injection.
* Turns on the dark mode switcher for the user-guide
2023-09-13 09:29:54 -04:00
Lacey Williams Henschel
a91af4f49c Move templatetag to core 2023-09-12 10:36:12 -07:00
Greg Newman
248c9a470d WIP inject header into user guide
* Adds viewset to inject the header into the user-guide
* Removes old antora header views and urls
2023-09-08 09:42:25 -04:00
Lacey Williams Henschel
7e847cc17f - Move GitHub retrieval and parser classes to the core/ app from the libraries/ app; moved tests, too, and updated import statements
- Add `verbose` flag to `import_versions` to allow user to silence the output
- Removed some unused options from `import_versions`
- Moved the exclusion logic in `import_versions` to its own function
- Stop getting the `github_url` from the github API. Instead, generate it from the tag. (reason: in older tags, the best URL GitHub gives us is a less-useful one to a _commit_ and not a tag. We can generate the url, though.)
- Move the retrieval of the `release_date` to its own task, so it can be loaded async. (reason: it's a separate API call per version to get the date)
- Make `release_date` optional on the `Version` model (reason: make the field easier to load async)
- Simplify logic to retrieve `release_date` and just always retrieve it from the commit
- Stop loading the version `description` from GitHub. We don't use it on the frontend anyway, and in all but the most recent couple of versions, the `description` is the comment from the commit, which is usually not useful.
2023-08-31 15:32:16 -07:00
Natalia
800b9e72d1 Expose via query params multiple options for browsing legacy docs. 2023-08-17 22:31:32 -03:00
Natalia
1f39e83c8e Study to restore legacy docs styles except for the header styling.
Disable the theme-switcher in the header for legacy docs pages.
2023-08-17 14:53:48 -03:00
Lacey Williams Henschel
eeb615ceff Load docs urls for library-versions from S3
- Add documentation_url to LibraryVersion table
- Retrieve the documentation_url in the view
- If the documentation_url is not present, show the Version documentation_url
- Hide the "https://" in the template
- Add Celery task to retrieve the documentation_urls from the libraries page in S3 and match them to import_library_versions
- Add HTML helper function to extract the libraries and docs URLs from the HTML
- Add one-time command to import docs urls
- Load the documentation_urls in the command that loads all library-versions
- Add a min-release option to the command that loads library-versions
- Document the new command and changes to the existing command
2023-08-04 08:40:00 -07:00
Greg Newman
d37b1994d5 truncate text in the middle
Template tag to truncate the hashes in the middle

`{{ "reallylonghashtobetruncatedbythisnewtemplatetag"|truncate_middle:20 }}`

Will produce an output of “reallylong....emplatetag” where 20 will add elipses between 10 chars on each side.
2023-07-28 10:57:54 -04:00
Natalia
2c4f8675ce Modernize legacy doc libs pages fetched directly from S3.
This modernization occurs on the fly over potentially-cached S3 files. This
means, the legacy doc pages are fetched and cached just like any other S3
static content, and the modernization happens when the page is requested. This
way, we can safely render modern parts of the pages (like the header) and
account for dynamic state such as logged in users.

The resulting docs (also called FrankenDocs :-)) are processed using
BeautifulSoup and a fairly simple heuristic that can be found in the
`core/htmlhelper.py` module.
2023-07-28 10:13:06 -04:00
Spencer Strickland
539ad3bd48 misc updates includes tos/privacy 2023-07-26 08:54:35 -05:00
Frank Wiles
db2e1945f4 Remove forum templates and vestiges 2023-07-13 16:07:59 -05:00
Lacey Williams Henschel
b15a6f19de Redirect allauth callback urls in the static content view
- Override django-allauth template
- Add docs on local dev social accounts
2023-07-12 06:25:23 -07:00
Greg Newman
88b2a882fb ⚙️ simple views for header/footer
Providing simple views to return header and footer for testing against S3.
2023-07-11 08:27:42 -04:00
Greg Newman
cb7f549b00 ⚙️ working on antora header and footer
Antora is properly pulling the header and footer but the user is not exposed yet.
2023-07-11 08:27:42 -04: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
713fc2d578 Rename functions 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
2fa07cef36 Add clear by cache key to view 2023-06-27 15:25:56 -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
afb511dfd4 Add view to clear cache by content type 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
ba53f5053f Clear redis cache by content type 2023-06-27 15:25:56 -07:00
Lacey Williams Henschel
4dcdeb9c0f Add docstring 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
Natalia
2e0f083dad Run pre-commit checks before landing changes.
Add `pre-commit` to the requirements list, and updated the version it uses.
Also removed the `sample.adoc` since the relevant test always creates it (and
it was causing spurious lint check errors).
2023-06-14 16:37:06 -03: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
a447ffd7ed Strip footer from asciidoc content (Part of #394) 2023-06-07 14:17:06 -07:00
Lacey Williams Henschel
4e26f55dd1 Extract content of HTML body from rendered asciidoc content (Part of #394)
- Make web service depend on redis
- Add function to extract body from html content
- In view, extract body before returning converted ascciidoc in response
2023-06-07 13:11:20 -07:00
Natalia
9ec7a37bb5 Rework of news entries ACLs.
This includes a helper to efficiently query for all moderators.
2023-06-06 17:04:26 -03:00
Lacey Williams Henschel
41b40cd1f3 Command to convert based on file input 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
7e27b468f1 🚧 WIP asciidoc 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
12a7b499c9 Add docstrings 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
44aafb8a1e Linter 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
0ff65b95a7 Apply some style to the asciidoc content 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
b183c5bf44 Add option to delete temp file 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
a3cdcf097c Add comments, cleanup 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
624cbe6525 Serve asciidoc content from template, refactor tests 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
e84b1d1682 Add function to get content type 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
Lacey Williams Henschel
d1b3da670c Command to convert based on file input 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
2b31b07bbd 🚧 WIP asciidoc 2023-06-06 11:14:50 -07:00
Lacey Williams Henschel
f6f1b10a5d Command to convert based on file input 2023-06-01 11:35:34 -07:00
Lacey Williams Henschel
97505d6f85 🚧 WIP asciidoc 2023-06-01 11:35:34 -07:00
Natalia
a8cd8f507a Ran pre-commit run -a
Completed runs of black and rest of pre-commit checks.
2023-05-30 23:21:53 -03:00