80
80
### Documentation ###
82
# set PRETTY to get docs that look like the Bazaar web site
84
rst2html := $(PYTHON) tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid
86
rst2html := $(PYTHON) tools/rst2html.py --link-stylesheet --footnote-references=superscript --halt=warning
89
# translate txt docs to html
90
derived_txt_files := \
91
doc/en/user-reference/bzr_man.txt \
92
doc/en/release-notes/NEWS.txt
94
doc/en/tutorials/tutorial.txt \
95
doc/en/tutorials/using_bazaar_with_launchpad.txt \
96
doc/en/tutorials/centralized_workflow.txt \
97
$(wildcard doc/ru/tutorials/*.txt) \
98
$(wildcard doc/*/mini-tutorial/index.txt) \
99
$(wildcard doc/*/user-guide/index.txt) \
100
$(derived_txt_files) \
101
doc/en/developer-guide/HACKING.txt \
102
doc/en/upgrade-guide/index.txt \
103
$(wildcard doc/es/guia-usario/*.txt) \
104
doc/es/mini-tutorial/index.txt \
106
$(wildcard doc/index.*.txt)
109
$(wildcard doc/*/quick-reference/bzr-quick-reference.svg) \
110
$(wildcard doc/*/quick-reference/bzr-quick-reference.png) \
111
$(wildcard doc/*/quick-reference/bzr-quick-reference.pdf) \
112
$(wildcard doc/*/user-guide/images/*.png)
113
htm_files := $(patsubst %.txt, %.html, $(txt_files))
115
# doc/developers/*.txt files that should *not* be individually
118
doc/developers/add.txt \
119
doc/developers/annotate.txt \
120
doc/developers/bundle-creation.txt \
121
doc/developers/commit.txt \
122
doc/developers/diff.txt \
123
doc/developers/directory-fingerprints.txt \
124
doc/developers/gc.txt \
125
doc/developers/incremental-push-pull.txt \
126
doc/developers/initial-push-pull.txt \
127
doc/developers/merge-scaling.txt \
128
doc/developers/missing.txt \
129
doc/developers/performance-roadmap-rationale.txt \
130
doc/developers/performance-use-case-analysis.txt \
131
doc/developers/planned-change-integration.txt \
132
doc/developers/planned-performance-changes.txt \
133
doc/developers/revert.txt \
134
doc/developers/status.txt \
135
doc/developers/uncommit.txt
137
dev_txt_all := $(wildcard $(addsuffix /*.txt, doc/developers))
138
dev_txt_files := $(filter-out $(dev_txt_nohtml), $(dev_txt_all))
139
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files))
141
doc/%/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/%/user-guide))
142
$(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
144
# Set the paper size for PDF files.
145
# Options: 'a4' (ISO A4 size), 'letter' (US Letter size)
147
# TODO: Add generation for Russian PDF
148
PDF_DOCS := doc/en/user-guide/user-guide.$(PAPERSIZE).pdf
150
# Copy and modify the RST sources, and convert SVG images to PDF
151
# files for use a images in the LaTeX-generated PDF.
152
# Then generate the PDF output from the modified RST sources.
153
doc/en/user-guide/user-guide.$(PAPERSIZE).pdf: $(wildcard $(addsuffix /*.txt, doc/en/user-guide))
154
mkdir -p doc/en/user-guide/latex_prepared
155
$(PYTHON) tools/prepare_for_latex.py \
156
--out-dir=doc/en/user-guide/latex_prepared \
157
--in-dir=doc/en/user-guide
158
cd doc/en/user-guide/latex_prepared && \
159
$(PYTHON) ../../../../tools/rst2pdf.py \
160
--documentoptions=10pt,$(PAPERSIZE)paper \
161
--input-encoding=UTF-8:strict --output-encoding=UTF-8:strict \
162
--strict --title="Bazaar User Guide" \
163
index.txt ../user-guide.$(PAPERSIZE).pdf
165
doc/developers/%.html: doc/developers/%.txt
166
$(rst2html) --stylesheet=../default.css $< $@
168
doc/index.html: doc/index.txt
169
$(rst2html) --stylesheet=default.css $< $@
171
doc/index.%.html: doc/index.%.txt
172
$(rst2html) --stylesheet=default.css $< $@
175
$(rst2html) --stylesheet=../../default.css $< $@
82
# Build the documentation in the default set of formats
83
docs: html-docs pdf-docs
85
# Clean out generated documentation
88
cd doc/es && make clean
89
cd doc/ru && make clean
90
cd doc/developers && make clean
92
DOC_DEPENDENCIES = doc/en/release-notes/NEWS.txt doc/en/user-reference/bzr_man.txt
94
# Build the html docs. Requires Sphinx.
95
html-docs: $(DOC_DEPENDENCIES)
97
cd doc/es && make html
98
cd doc/ru && make html
99
cd doc/developers && make html
101
# Build the PDF docs. Requires Sphinx and numerous LateX packages.
102
# See http://sphinx.pocoo.org/builders.html for details.
103
# Note: We don't currently build PDFs for the Russian docs because
104
# they require additional packages to be installed (to handle
105
# Russian hyphenation rules, etc.)
106
pdf-docs: $(DOC_DEPENDENCIES)
108
cd doc/es && make latex
109
cd doc/developers && make latex
110
cd doc/_build/latex && make all-pdf
111
cd doc/es/_build/latex && make all-pdf
112
cd doc/developers/_build/latex && make all-pdf
114
# Build the CHM (Windows Help) docs. Requires Sphinx and HtmlHelp workshop.
115
chm-docs: $(DOC_DEPENDENCIES)
116
cd doc && make htmlhelp
117
cd doc/es && make htmlhelp
118
cd doc/ru && make htmlhelp
119
cd doc/developers && make htmlhelp
177
121
MAN_DEPENDENCIES = bzrlib/builtins.py \
178
122
$(wildcard bzrlib/*.py) \
202
141
@echo Generating $@
203
142
@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
205
derived_web_docs = $(htm_files) $(dev_htm_files)
206
WEB_DOCS = $(derived_web_docs) $(non_txt_files)
207
ALL_DOCS = $(derived_web_docs) $(MAN_PAGES)
209
# the target to build all the old-style docs
210
old-docs: $(ALL_DOCS)
212
# produce a tree containing just the final docs, ready for uploading to the web
215
$(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) $(HTMLDIR)
217
# Produce PDF documents. Requires pdfLaTeX, rubber, and Inkscape.
218
pdf-docs: $(PDF_DOCS)
220
# clean produced docs
222
$(PYTHON) tools/win32/ostools.py remove $(ALL_DOCS) \
223
$(HTMLDIR) $(derived_txt_files)
224
rm -f doc/*/user-guide/*.pdf
225
rm -rf doc/*/user-guide/latex_prepared
228
# The main target to build all the new-style docs. Requires Sphinx.
229
docs: doc/en/release-notes/NEWS.txt doc/en/user-reference/bzr_man.txt
232
cd doc/_build/latex && make all-pdf
233
cd doc/developers && make html
234
cd doc/es && make html
235
cd doc/ru && make html
238
145
### Windows Support ###