aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-05-03 10:50:17 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-03 17:33:21 -0300
commit683c105ae9d128c64a3ef1ac8ae264506c1e2101 (patch)
tree1a4f1834c3e97f2926ab695c827733a88d7bcd87 /doc
parent3ee5470bc386eaa40a88e59f52eca94376eebb3e (diff)
Build documentation of out source dir, automagicly replacing variables like version numbers.
Reviewer: Bruno Araújo <bruno.araujo@openbossa.org> Reviewer: Renato Araújo <renato.araujo@openbossa.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/CMakeLists.txt13
-rw-r--r--doc/Makefile89
-rw-r--r--doc/conf.py.in (renamed from doc/conf.py)16
3 files changed, 15 insertions, 103 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 0e8851b7c..dd78f31fb 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -3,13 +3,14 @@ find_program(graphviz_exec dot)
if (QT_SRC_DIR)
if (NOT ${graphviz_exec} STREQUAL graphviz_exec-NOTFOUND)
+
add_custom_target(apidoc
- #temporarily create a symlink for the generated .rst files inside ../doc
- #this allows Sphinx to see them, and output goes to the correct dir
- COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_BINARY_DIR}/PySide" "${CMAKE_CURRENT_SOURCE_DIR}/PySide"
- COMMAND make html BUILDDIR=${CMAKE_BINARY_DIR}/apidoc WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND ${CMAKE_COMMAND} -E remove -f "${CMAKE_CURRENT_SOURCE_DIR}/PySide")
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/rst
+ COMMAND sphinx-build -b html ${CMAKE_CURRENT_BINARY_DIR}/rst htmldocs
+ )
+# create conf.py based on conf.py.in
+configure_file("conf.py.in" "rst/conf.py" @ONLY)
# copy pyside.qdocconf to qt source dir.
configure_file("pyside.qdocconf" "${QT_SRC_DIR}/tools/qdoc3/test/pyside.qdocconf" @ONLY)
@@ -34,7 +35,7 @@ COMMAND ${GENERATOR} --generatorSet=qtdoc
--library-source-dir=${QT_SRC_DIR}
--documentation-only
--documentation-data-dir=${DOC_DATA_DIR}
- --documentation-out-dir=${CMAKE_BINARY_DIR}
+ --documentation-out-dir=${CMAKE_CURRENT_BINARY_DIR}/rst
--documentation-code-snippets-dir=${CMAKE_CURRENT_SOURCE_DIR}/codesnippets
WORKING_DIRECTORY ${${module}_SOURCE_DIR}
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644
index 32a7c0db4..000000000
--- a/doc/Makefile
+++ /dev/null
@@ -1,89 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(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:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PySide.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PySide.qhc"
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
- "run these through (pdf)latex."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(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."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/doc/conf.py b/doc/conf.py.in
index e8f79e5d0..52f3a016c 100644
--- a/doc/conf.py
+++ b/doc/conf.py.in
@@ -16,7 +16,7 @@ import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.append(os.path.abspath('.'))
+sys.path.append('@CMAKE_CURRENT_SOURCE_DIR@')
# -- General configuration -----------------------------------------------------
@@ -29,7 +29,7 @@ rst_epilog = """
"""
# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
+templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_templates']
# The suffix of source filenames.
source_suffix = '.rst'
@@ -38,20 +38,20 @@ source_suffix = '.rst'
source_encoding = 'utf-8'
# The master toctree document.
-#master_doc = 'contents'
+master_doc = 'contents'
# General information about the project.
project = u'PySide'
-copyright = u'2009, Nokia Corporation'
+copyright = u'2009-2010, Nokia Corporation'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '0.2.3'
+version = '@BINDING_API_VERSION@'
# The full version, including alpha/beta/rc tags.
-release = '0.2.3'
+release = '@BINDING_API_VERSION@'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -104,7 +104,7 @@ html_theme = 'pysidedocs'
#}
# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = ['_themes']
+html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_themes']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
@@ -125,7 +125,7 @@ html_theme_path = ['_themes']
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.