Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce doc size #12215

Merged
merged 5 commits into from
Sep 5, 2023
Merged

Reduce doc size #12215

merged 5 commits into from
Sep 5, 2023

Conversation

ru-fu
Copy link
Contributor

@ru-fu ru-fu commented Sep 5, 2023

No huge improvements, but a bit:

Before:

95036	doc/html/
43244	doc/html/reference/manpages/

Moving out doctrees:

75044	doc/html/
43244	doc/html/reference/manpages/

Moving header.css:

73300	doc/html/
42092	doc/html/reference/manpages/

Moving furo_color.css:

71484	doc/html/
40872	doc/html/reference/manpages/

I can't figure out how to move the SVG to a separate file without copying significant parts of the Furo theme, which would cause maintenance issues.

Removing the man pages from the navigation:

32100	doc/html/
15652	doc/html/reference/manpages/

Signed-off-by: Ruth Fuchss <ruth.fuchss@canonical.com>
Signed-off-by: Ruth Fuchss <ruth.fuchss@canonical.com>
Instead of specifying the colors in the conf.py file, we can
move them to a CSS file. This will include them from a central
location instead of copying them into every HTML file.

Signed-off-by: Ruth Fuchss <ruth.fuchss@canonical.com>
@tomponline
Copy link
Member

This is all going in the right direction, thanks!

@github-actions github-actions bot added the Documentation Documentation needs updating label Sep 5, 2023
@gabrielmougard
Copy link
Contributor

gabrielmougard commented Sep 5, 2023

@ru-fu In an effort of reducing the doc size, what do you think about minifying the textual content ? All the html, css, js and svg files could be impacted without loss quality.

@ru-fu
Copy link
Contributor Author

ru-fu commented Sep 5, 2023

@ru-fu In an effort of reducing the doc size, what do you think about minifying the textual content ? All the html, css, js and svg files could be impacted without loss quality.

What do you mean?
Write less content? ;)

@gabrielmougard
Copy link
Contributor

gabrielmougard commented Sep 5, 2023

@ru-fu In an effort of reducing the doc size, what do you think about minifying the textual content ? All the html, css, js and svg files could be impacted without loss quality.

What do you mean? Write less content? ;)

I mean using html/css/js/svg minifier like html-minifier, nanocss, uglifyjs and svgo... I don't know how much space we can reclaim using those but I know that this is a common practice to do when publishing web assets.

@ru-fu
Copy link
Contributor Author

ru-fu commented Sep 5, 2023

I mean using html/css/js/svg minifier like html-minifier, nanocss, uglifyjs and svgo... I don't know how much space we can reclaim using those but I know that this is a common practice to do when publishing web assets.

I'm not familiar with those tools. If they run on the HTML output, I guess we could give it a try (even though I'm reluctant since it will make it a lot harder to track down issues or add improvements). If they are supposed to run on the input files, I don't think it'll work, since most files come from Sphinx/Furo.

@tomponline
Copy link
Member

tomponline commented Sep 5, 2023

I think with the steps @ru-fu has already achieved in #12215 plus the confirmation that snap's compression is working well from @gabrielmougard we can proceed as-is for now.

canonical/lxd-pkg-snap#136 (comment)

But we should keep it under review and not let it grow out of control.

@tomponline
Copy link
Member

@ru-fu the doc tests seem to be failing

@ru-fu
Copy link
Contributor Author

ru-fu commented Sep 5, 2023

@ru-fu the doc tests seem to be failing

Doesn't seem to be related - seems ubuntu.com is a bit flaky at the moment.
(And the RTD "Cancel build" button isn't working ... 😠 )

Hiding the man pages from the navigation saves a lot of storage
space since all links are otherwise included in all pages.
It makes them harder to navigate, but links etc. work as before.

Signed-off-by: Ruth Fuchss <ruth.fuchss@canonical.com>
Sphinx 7.2.0 introduced a problem where pages appear twice in
the navigation (most likely caused by us keeping the topical
navigation in "only" tags, which isn't officially supported).
We'll need to figure out how to deal with that, but for now,
let's pin the Sphinx version for a quick fix.

Signed-off-by: Ruth Fuchss <ruth.fuchss@canonical.com>
@ru-fu
Copy link
Contributor Author

ru-fu commented Sep 5, 2023

I added two more commits: one to exclude the man pages from the navigation, one to fix/work around some navigation issues that have appeared lately (not sure when, I've notices them the last couple of days).

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tomponline tomponline merged commit 41707cd into canonical:main Sep 5, 2023
24 checks passed
@ru-fu ru-fu deleted the reduce-doc-size branch September 6, 2023 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants