Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03cb912

Browse files
committed
DOC run optipng before uploading website
Conflicts: doc/Makefile
1 parent 4c6227f commit 03cb912

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

doc/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PAPEROPT_a4 = -D latex_paper_size=a4
1212
PAPEROPT_letter = -D latex_paper_size=letter
1313
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1414

15-
.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex latexpdf changes linkcheck doctest
15+
.PHONY: help clean html dirhtml pickle json latex latexpdf changes linkcheck doctest optipng
1616

1717
all: html-noplot
1818

@@ -107,3 +107,9 @@ doctest:
107107

108108
download-data:
109109
python -c "from sklearn.datasets.lfw import check_fetch_lfw; check_fetch_lfw()"
110+
111+
# Optimize PNG files. Needs OptiPNG. Change the -P argument to the number of
112+
# cores you have available, so -P 64 if you have a real computer ;)
113+
optipng:
114+
find _build auto_examples */generated -name '*.png' -print0 \
115+
| xargs -0 -n 1 -P 4 optipng -o10

doc/README

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,21 @@ To build the PDF manual, run
2121
Upload the generated doc to sourceforge
2222
---------------------------------------
2323

24-
First of, generate the html documentation::
24+
First off, generate HTML documentation::
2525

2626
make html
2727

2828
This should create a directory _build/html/stable with the documentation in
2929
html format.
3030

31+
Next, make sure you have the PNG optimizer OptiPNG installed.
32+
The PNG files generated by Matplotlib tend to be ~20% too big, and they're
33+
costing us bandwidth. Then issue::
34+
35+
make optipng
36+
37+
This may take some time. If you have a big machine at your disposal,
38+
check the ``Makefile``; it has a hint on how to speed up this target.
3139

3240
Now can upload the generated HTML documentation using scp or some other SFTP
3341
clients.

0 commit comments

Comments
 (0)