81
81
### Documentation ###
83
# Default to plain documentation for maximum backwards compatibility.
84
# (Post 2.0, the defaults will most likely be Sphinx-style instead.)
88
clean-docs: clean-plain
93
### Man-page Documentation ###
95
MAN_DEPENDENCIES = bzrlib/builtins.py \
96
$(wildcard bzrlib/*.py) \
97
$(wildcard bzrlib/*/*.py) \
98
tools/generate_docs.py \
99
$(wildcard $(addsuffix /*.txt, bzrlib/help_topics/en))
101
MAN_PAGES = man1/bzr.1
102
man1/bzr.1: $(MAN_DEPENDENCIES)
103
$(PYTHON) tools/generate_docs.py -o $@ man
106
### Sphinx-style Documentation ###
83
108
# Build the documentation. To keep the dependencies down to a minimum
84
109
# for distro packagers, we only build the html documentation by default.
85
# Sphinx 0.6 or later is required. See http://sphinx.pocoo.org/index.html
110
# Sphinx 0.6 or later is preferred for the best rendering, though
111
# Sphinx 0.4 or later should work. See http://sphinx.pocoo.org/index.html
86
112
# for installation instructions.
113
docs-sphinx: html-sphinx
89
115
# Clean out generated documentation
91
117
cd doc/en && make clean
92
118
cd doc/es && make clean
93
119
cd doc/ru && make clean
94
120
cd doc/developers && make clean
96
DOC_DEPENDENCIES = doc/en/release-notes/NEWS.txt doc/en/user-reference/bzr_man.txt \
122
SPHINX_DEPENDENCIES = \
123
doc/en/release-notes/index.txt \
124
doc/en/user-reference/index.txt \
101
129
doc/developers/Makefile \
102
130
doc/developers/make.bat
132
doc/en/user-reference/index.txt: $(MAN_DEPENDENCIES)
133
$(PYTHON) tools/generate_docs.py -o $@ rstx
135
doc/en/release-notes/index.txt: NEWS tools/generate_release_notes.py
136
$(PYTHON) tools/generate_release_notes.py NEWS $@
104
138
doc/%/Makefile: doc/en/Makefile
105
139
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
107
141
doc/%/make.bat: doc/en/make.bat
108
142
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
110
# Build the html docs. Requires Sphinx 0.6 or later.
111
html-docs: $(DOC_DEPENDENCIES)
144
# Build the html docs using Sphinx.
145
html-sphinx: $(SPHINX_DEPENDENCIES)
112
146
cd doc/en && make html
113
147
cd doc/es && make html
114
148
cd doc/ru && make html
115
149
cd doc/developers && make html
117
# Build the PDF docs. Requires Sphinx 0.6 or later and numerous LaTeX
151
# Build the PDF docs using Sphinx. This requires numerous LaTeX
118
152
# packages. See http://sphinx.pocoo.org/builders.html for details.
119
153
# Note: We don't currently build PDFs for the Russian docs because
120
154
# they require additional packages to be installed (to handle
121
155
# Russian hyphenation rules, etc.)
122
pdf-docs: $(DOC_DEPENDENCIES)
156
pdf-sphinx: $(SPHINX_DEPENDENCIES)
123
157
cd doc/en && make latex
124
158
cd doc/es && make latex
125
159
cd doc/developers && make latex
127
161
cd doc/es/_build/latex && make all-pdf
128
162
cd doc/developers/_build/latex && make all-pdf
130
# Build the CHM (Windows Help) docs. Requires Sphinx 0.6 or later.
164
# Build the CHM (Windows Help) docs using Sphinx.
131
165
# Note: HtmlHelp Workshop needs to be used on the generated hhp files
132
166
# to generate the final chm files.
133
chm-docs: $(DOC_DEPENDENCIES)
167
chm-sphinx: $(SPHINX_DEPENDENCIES)
134
168
cd doc/en && make htmlhelp
135
169
cd doc/es && make htmlhelp
136
170
cd doc/ru && make htmlhelp
137
171
cd doc/developers && make htmlhelp
139
MAN_DEPENDENCIES = bzrlib/builtins.py \
140
$(wildcard bzrlib/*.py) \
141
$(wildcard bzrlib/*/*.py) \
142
tools/generate_docs.py \
143
$(wildcard $(addsuffix /*.txt, bzrlib/help_topics/en))
145
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
146
$(PYTHON) tools/generate_docs.py -o $@ rstx
148
doc/en/release-notes/NEWS.txt: NEWS tools/generate_release_notes.py
149
$(PYTHON) tools/generate_release_notes.py NEWS $@
151
MAN_PAGES = man1/bzr.1
152
man1/bzr.1: $(MAN_DEPENDENCIES)
153
$(PYTHON) tools/generate_docs.py -o $@ man
155
# build a png of our performance task list
156
# this is no longer built by default; you can build it if you want to look at it
157
doc/developers/performance.png: doc/developers/performance.dot
159
@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
162
174
### Documentation Website ###
164
176
# Where to build the website
165
DOC_WEBSITE_BUILD := html_docs
177
DOC_WEBSITE_BUILD := build_doc_website
167
179
# Build and package docs into a website, complete with downloads.
168
180
doc-website: html-docs pdf-docs
172
184
$(PYTHON) tools/package_docs.py doc/developers $(DOC_WEBSITE_BUILD)
187
### Plain Documentation ###
189
# While Sphinx is the preferred tool for building documentation, we still
190
# support our "plain" html documentation so that Sphinx is not a hard
191
# dependency for packagers on older platforms.
193
rst2html := $(PYTHON) tools/rst2html.py --link-stylesheet --footnote-references=superscript --halt=warning
195
# translate txt docs to html
196
derived_txt_files := \
197
doc/en/user-reference/bzr_man.txt \
198
doc/en/release-notes/NEWS.txt
200
doc/en/tutorials/tutorial.txt \
201
doc/en/tutorials/using_bazaar_with_launchpad.txt \
202
doc/en/tutorials/centralized_workflow.txt \
203
$(wildcard doc/ru/tutorials/*.txt) \
204
$(wildcard doc/*/mini-tutorial/index.txt) \
205
$(wildcard doc/*/user-guide/index.txt) \
206
$(derived_txt_files) \
207
doc/en/developer-guide/HACKING.txt \
208
doc/en/upgrade-guide/index.txt \
209
$(wildcard doc/es/guia-usario/*.txt) \
210
doc/es/mini-tutorial/index.txt \
212
$(wildcard doc/index.*.txt)
215
$(wildcard doc/*/bzr-en-quick-reference.svg) \
216
$(wildcard doc/*/bzr-en-quick-reference.png) \
217
$(wildcard doc/*/bzr-en-quick-reference.pdf) \
218
$(wildcard doc/*/bzr-es-quick-reference.svg) \
219
$(wildcard doc/*/bzr-es-quick-reference.png) \
220
$(wildcard doc/*/bzr-es-quick-reference.pdf) \
221
$(wildcard doc/*/bzr-ru-quick-reference.svg) \
222
$(wildcard doc/*/bzr-ru-quick-reference.png) \
223
$(wildcard doc/*/bzr-ru-quick-reference.pdf) \
224
$(wildcard doc/*/user-guide/images/*.png)
225
htm_files := $(patsubst %.txt, %.html, $(txt_files))
227
# doc/developers/*.txt files that should *not* be individually
230
doc/developers/add.txt \
231
doc/developers/annotate.txt \
232
doc/developers/bundle-creation.txt \
233
doc/developers/commit.txt \
234
doc/developers/diff.txt \
235
doc/developers/directory-fingerprints.txt \
236
doc/developers/gc.txt \
237
doc/developers/incremental-push-pull.txt \
238
doc/developers/initial-push-pull.txt \
239
doc/developers/merge-scaling.txt \
240
doc/developers/missing.txt \
241
doc/developers/performance-roadmap-rationale.txt \
242
doc/developers/performance-use-case-analysis.txt \
243
doc/developers/planned-change-integration.txt \
244
doc/developers/planned-performance-changes.txt \
245
doc/developers/revert.txt \
246
doc/developers/status.txt \
247
doc/developers/uncommit.txt
249
dev_txt_all := $(wildcard $(addsuffix /*.txt, doc/developers))
250
dev_txt_files := $(filter-out $(dev_txt_nohtml), $(dev_txt_all))
251
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files))
253
doc/%/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/%/user-guide))
254
$(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
256
doc/developers/%.html: doc/developers/%.txt
257
$(rst2html) --stylesheet=../default.css $< $@
259
doc/index.html: doc/index.txt
260
$(rst2html) --stylesheet=default.css $< $@
262
doc/index.%.html: doc/index.%.txt
263
$(rst2html) --stylesheet=default.css $< $@
266
$(rst2html) --stylesheet=../../default.css $< $@
268
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
269
$(PYTHON) tools/generate_docs.py -o $@ rstx
271
doc/en/release-notes/NEWS.txt: NEWS
272
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
274
upgrade_guide_dependencies = $(wildcard $(addsuffix /*.txt, doc/en/upgrade-guide))
276
doc/en/upgrade-guide/index.html: $(upgrade_guide_dependencies)
277
$(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
279
derived_web_docs = $(htm_files) $(dev_htm_files)
280
WEB_DOCS = $(derived_web_docs) $(non_txt_files)
281
ALL_DOCS = $(derived_web_docs) $(MAN_PAGES)
283
# the main target to build all the docs
284
docs-plain: $(ALL_DOCS)
286
# produce a tree containing just the final docs, ready for uploading to the web
288
html-plain: docs-plain
289
$(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) $(HTMLDIR)
291
# clean produced docs
293
$(PYTHON) tools/win32/ostools.py remove $(ALL_DOCS) \
294
$(HTMLDIR) $(derived_txt_files)
297
### Miscellaneous Documentation Targets ###
299
# build a png of our performance task list
300
# this is no longer built by default; you can build it if you want to look at it
301
doc/developers/performance.png: doc/developers/performance.dot
303
@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
175
306
### Windows Support ###
177
308
# make all the installers completely from scratch, using zc.buildout