Share Aliki class navigation across generated pages - #1840
Merged
Merged
Conversation
Generate one navigation data file and lazily render namespace branches. Keep a static class index for crawlability and offline fallback, and refresh navigation data with live-preview changes. Amp-Thread-ID: https://ampcode.com/threads/T-01a0ea31-9f66-7342-a269-34772e5428db Co-authored-by: Stanislav Katkov <[email protected]>
Documentation previewCommit: |
skatkov
marked this pull request as ready for review
September 29, 2026 11:09
skatkov
commented
Sep 29, 2026
st0012
reviewed
Sep 30, 2026
| assert_equal 'text/html', content_type | ||
| end | ||
|
|
||
| def test_search_data_refreshes_after_file_changes |
Member
There was a problem hiding this comment.
Why is this test needed for the changes made here?
Contributor
Author
There was a problem hiding this comment.
It was to ensure that the search index is getting properly refreshed locally if the server is running (e.g. so navigation will be updated as well). I have removed it.
| </span> | ||
| </summary> | ||
|
|
||
| <%= generate_class_index_content(@classes, rel_prefix) %> |
Member
There was a problem hiding this comment.
Will this method still be needed?
Contributor
Author
There was a problem hiding this comment.
This method is still used in the Darkfish generator.
The Darkfish generator has same problem as well as Aliki. But because Darkfish is already deprecated, I assume there is no need to do similar changes to Darkfish.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Aliki currently rebuilds and embeds the complete class/module navigation tree in every generated page.
My build servers can't handle
google-api-gemgeneration, they always time out. I tried running it locally, and it was running for ~5 hours and never finished. By the time I got annoyed and stopped, the generation folder had 234GB of data.Every HTML page was ~6 MB in size.
Solution
We can have a shared navigation section shared across all documentation pages. That would remove 97% of data from every page in case of
google-api-gem.We already have
search_data.indexfile, which could be used to reconstruct navigation section with JavaScript.Results
After implementing these changes, I've seen the following results for
google-api-gemgem.For other gems, that are not that extremely big in contents, performance savings are more modest.
The current branch generated the site about 0.22 s faster (~3.4%) for rdoc's source code.