Skip to content

ENH: Reduce file size#433

Merged
alihamdan merged 1 commit intodevelopfrom
issue-430
Jan 6, 2026
Merged

ENH: Reduce file size#433
alihamdan merged 1 commit intodevelopfrom
issue-430

Conversation

@benoit9126
Copy link
Copy Markdown
Member

@benoit9126 benoit9126 commented Jan 6, 2026

Close #430

Several improvements:

  1. PDF files of the documentation have been compressed using ghostscript as described here using the \ebook setting (and for some of them, only the interesting pages remain)

  2. Patterns in the TikZ pictures have been replaced with a simple fill colour to reduce the size of the SVG output.

  3. PNG and JPG images of the documentation have been converted into webp files using the commands

    find . -name '*.jpg' -exec sh -c 'convert $1 ${1%.jpg}.webp' sh {} ';'
    find . -name '*.png' -exec sh -c 'convert $1 ${1%.png}.webp' sh {} ';'
  4. HTML files located in the doc/_static/ folder have been minified using the minhtml command line tool:

    minhtml --keep-closing-tags --minify-css --minify-js --minify-doctype doc/_static/**/*.html

    The biome formatter has been disabled for this folder.

  5. The script to generate the HTML plots of the networks has been updated to generate new static HTML files (considering Improve interactive map plots #418 and Interactive map plotting with results #426). The code to plot all the networks of the catalogue on the same map is purely a large copy-paste of the code used to plot the networks individually. Only a few lines of code are adapted, but I would rather not refactor the entire plotting module for a single plot.

Before compression:

$ find ./doc -type f -exec du -h -a --threshold=100K {} + | sort -h -r 
88M	./doc/_static/Transformer/References/2024_11_25_FRAED215018FR-Distribution-HTA-2023.pdf
13M	./doc/_static/Transformer/References/2024_11_25_chapitre_transformateurs_prives_0-cahors.pdf
11M	./doc/_static/Transformer/References/2025_03_14_SCOTECH_SC-S-100MVA-220-35KV.pdf
8,9M	./doc/_static/Transformer/References/2025_03_14_SCOTECH_SZ11-76MVA-110-35 kV.pdf
8,3M	./doc/_static/Transformer/References/2025_03_14_SCOTECH_SFZ11-25MVA-33-11KV.pdf
4,4M	./doc/_static/Transformer/References/2025_03_14_SCOTECH_S11-30MVA-132-11KV.pdf
3,9M	./doc/_static/Line/Underground_Geometry.svg
3,1M	./doc/_static/Transformer/References/2023_03_31_Fiche_Technique_Schneider_Electric.pdf
1,9M	./doc/_static/Transformer/References/2024_03_18_Minera-EcoDesign2021-20kV_ZZ6921.pdf
1,7M	./doc/_static/Transformer/References/2024_03_18_Trihal-EcoDesign2021-20kV_ZZ6925.pdf
1,7M	./doc/_static/Line/Twisted_Geometry.svg
1,6M	./doc/_static/Network/Catalogue.html
1,4M	./doc/_static/Transformer/References/2024_03_18_Vegeta-EcoDesign2021-20kV_ZZ6924.pdf
432K	./doc/_static/Network/Catalogue.png
248K	./doc/_static/Transformer/References/2024_11_25_Schneider Electric_BC-Imprego_84408.pdf
248K	./doc/_static/Plotting/MVFeeder210_Results.html
248K	./doc/_static/Load/FlexibleLoad/Euclidean_Projection.svg
248K	./doc/_static/Load/FlexibleLoad/Constant_Q_Projection.svg
248K	./doc/_static/Load/FlexibleLoad/Constant_P_Projection.svg
216K	./doc/_static/Plotting/MVFeeder210.html
196K	./doc/_static/Network/MVFeeder251.html
192K	./doc/_static/Network/MVFeeder210.html
156K	./doc/_static/Transformer/References/2023_03_30_Fiche_Technique_France_Transfo.pdf
156K	./doc/_static/Load/FlexibleLoad/Domain_PmaxU_QU.svg
152K	./doc/_static/Transformer/Common_Connections.svg
144K	./doc/_static/Getting_Started_Tutorial.svg
128K	./doc/_static/Network/MVFeeder041.html
120K	./doc/_static/Transformer/Additional_Connections.svg
120K	./doc/_static/Network/MVFeeder078.html
112K	./doc/_static/Network/MVFeeder217.html
112K	./doc/_static/2024_01_12_Pycharm_Console_Environment_Variable.png
108K	./doc/_static/Network/MVFeeder128.html
104K	./doc/_static/Transformer/Windings.svg
104K	./doc/_static/Transformer/References/2024_11_25_Schneider Electric_BC-Imprego_84410.pdf

After:

$ find ./doc -type f -exec du -h -a --threshold=100K {} + | sort -h -r 
2,1M	./doc/_static/Transformer/References/2024_11_25_chapitre_transformateurs_prives_0-cahors.pdf
1,6M	./doc/_static/Network/Catalogue.html
1,1M	./doc/_static/Transformer/References/2025_03_14_SCOTECH_SC-S-100MVA-220-35KV.pdf
952K	./doc/_static/Transformer/References/2025_03_14_SCOTECH_SZ11-76MVA-110-35 kV.pdf
928K	./doc/_static/Transformer/References/2025_03_14_SCOTECH_SFZ11-25MVA-33-11KV.pdf
604K	./doc/_static/Transformer/References/2025_03_14_SCOTECH_S11-30MVA-132-11KV.pdf
272K	./doc/_static/Transformer/References/2024_11_25_FRAED215018FR-Distribution-HTA-2023.pdf
264K	./doc/_static/Transformer/References/2024_03_18_Minera-EcoDesign2021-20kV_ZZ6921.pdf
248K	./doc/_static/Transformer/References/2024_03_18_Trihal-EcoDesign2021-20kV_ZZ6925.pdf
244K	./doc/_static/Transformer/References/2024_03_18_Vegeta-EcoDesign2021-20kV_ZZ6924.pdf
164K	./doc/_static/Plotting/MVFeeder210_Results.html
152K	./doc/_static/Transformer/References/2023_03_30_Fiche_Technique_France_Transfo.pdf
148K	./doc/_static/Transformer/References/2023_03_31_Fiche_Technique_Schneider_Electric.pdf
144K	./doc/_static/Network/MVFeeder251.html
144K	./doc/_static/Getting_Started_Tutorial.svg
140K	./doc/_static/Plotting/MVFeeder210.html
140K	./doc/_static/Network/MVFeeder210.html
116K	./doc/_static/Transformer/Common_Connections.svg

@benoit9126 benoit9126 requested a review from alihamdan January 6, 2026 12:55
@benoit9126 benoit9126 self-assigned this Jan 6, 2026
@benoit9126 benoit9126 added the enhancement New feature or request label Jan 6, 2026
Copy link
Copy Markdown
Member

@alihamdan alihamdan left a comment

Choose a reason for hiding this comment

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

Nice

@alihamdan alihamdan merged commit 146460a into develop Jan 6, 2026
7 checks passed
@alihamdan alihamdan deleted the issue-430 branch January 6, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce size of large files used in the documentation

2 participants