Skip to content

Commit

Permalink
add build version in index.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxin committed Dec 26, 2011
1 parent 2d7d77a commit 1f9f35f
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_version.inc
48 changes: 30 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,38 +37,38 @@ help:
clean:
-rm -rf $(BUILDDIR)/*

html: images
html: pre-build
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml: images
dirhtml: pre-build
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml: images
singlehtml: pre-build
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle: images
pickle: pre-build
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json: images
json: pre-build
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp: images
htmlhelp: pre-build
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp: images
qthelp: pre-build
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
Expand All @@ -77,7 +77,7 @@ qthelp: images
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/GotGitHub.qhc"

devhelp: images
devhelp: pre-build
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
Expand All @@ -86,46 +86,44 @@ devhelp: images
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/GotGitHub"
@echo "# devhelp"

epub: images
epub: pre-build
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex: images
latex: pre-build
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf: images
latexpdf: pre-build
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text: images
text: pre-build
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man: images
man: pre-build
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

changes: images
changes: pre-build
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck: images
linkcheck: pre-build
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
images:
(cd graphics; rake convert[../images,600] )

gh-pages: clean html
@if ! git rev-parse refs/heads/gh-pages >/dev/null 2>&1 ; then \
Expand Down Expand Up @@ -153,4 +151,18 @@ doctest:
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

.PHONY : clean images gh-pages
pre-build: images update-version

images:
(cd graphics; rake convert[../images,600] )

update-version:
@sed -e "s#<version>#$$(git describe --dirty --always)#g" < _version.inc.in > _version.inc.tmp
@if diff -q _version.inc.tmp _version.inc >/dev/null 2>&1; then \
rm _version.inc.tmp; \
else \
echo "_version.inc.in => _version.inc" ; \
mv _version.inc.tmp _version.inc; \
fi

.PHONY : clean pre-build images gh-pages
5 changes: 5 additions & 0 deletions _version.inc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
::

Author : Jiang Xin
Version: <version>

File renamed without changes.
10 changes: 6 additions & 4 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
GotGitHub
==========

.. include:: _version.inc

前言
----

.. include:: preface.rst
.. include:: preface.inc

目录
----
Expand All @@ -27,9 +29,9 @@ GotGitHub
06-side-projects/index
20-appendix/index

贡献者
------
.. include:: contributors.rst
贡献者列表
----------
.. include:: contributors.inc


.. 索引和表格
Expand Down
File renamed without changes.

0 comments on commit 1f9f35f

Please sign in to comment.