summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorVladimir Minenko <vladimir.minenko@nokia.com>2012-06-18 12:12:21 +0200
committerVenugopal Shivashankar <venugopal.shivashankar@digia.com>2013-02-08 12:30:13 +0100
commite9053ba3f559fcf8c4d2dd3b6f87cce0979d0244 (patch)
tree0e6503d0068bed7b57ba751d4c200a70e5c5e7d3 /scripts
parent4aa878fe08f8ed3f76cabf8a6b21603fa21fcb09 (diff)
Initial commit to add the learning-guide content
Change-Id: I5eb8ab089b46122bc6f7042e20541bf70f173447 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qtextensions/__init__.py0
-rw-r--r--scripts/qtextensions/dita/__init__.py9
-rw-r--r--scripts/qtextensions/dita/ditabuilder.py103
-rw-r--r--scripts/qtextensions/dita/ditamapwriter.py103
-rw-r--r--scripts/qtextensions/dita/ditawriter.py316
-rw-r--r--scripts/qtextensions/shared/__init__.py0
-rw-r--r--scripts/qtextensions/shared/conf.py329
7 files changed, 860 insertions, 0 deletions
diff --git a/scripts/qtextensions/__init__.py b/scripts/qtextensions/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/scripts/qtextensions/__init__.py
diff --git a/scripts/qtextensions/dita/__init__.py b/scripts/qtextensions/dita/__init__.py
new file mode 100644
index 0000000..efbefad
--- /dev/null
+++ b/scripts/qtextensions/dita/__init__.py
@@ -0,0 +1,9 @@
+def setup(app):
+ try: # check first if lxml is installed
+ import lxml
+ except ImportError:
+ print('\nWARNING: dita export needs python-lxml module installed.\n')
+ return
+ from ditabuilder import DitaBuilder
+ app.add_builder(DitaBuilder)
+
diff --git a/scripts/qtextensions/dita/ditabuilder.py b/scripts/qtextensions/dita/ditabuilder.py
new file mode 100644
index 0000000..515e617
--- /dev/null
+++ b/scripts/qtextensions/dita/ditabuilder.py
@@ -0,0 +1,103 @@
+from os import path
+import codecs
+
+from docutils.io import DocTreeInput, StringOutput
+from docutils.utils import new_document
+from docutils.core import Publisher
+from docutils.readers.doctree import Reader as DoctreeReader
+
+from sphinx.builders import Builder
+from sphinx.util.osutil import ensuredir, os_path, copyfile
+from sphinx.util.pycompat import b
+from sphinx.util.console import bold, darkgreen, brown
+
+from ditawriter import DitaWriter
+from ditamapwriter import render_map
+
+
+
+class DitaBuilder(Builder):
+ name = "dita"
+ format = 'dita'
+ out_suffix = '.dita'
+ _publisher = None
+ supported_image_types = ['image/png', 'image/jpeg']
+
+
+
+ def init(self):
+ print('DitaBuilder.init()')
+
+ def get_outdated_docs(self):
+ for docname in self.env.found_docs:
+ if docname not in self.env.all_docs:
+ yield docname
+ continue
+ targetname = self.env.doc2path(docname, self.outdir,
+ self.out_suffix)
+ try:
+ targetmtime = path.getmtime(targetname)
+ except Exception:
+ targetmtime = 0
+ try:
+ srcmtime = path.getmtime(self.env.doc2path(docname))
+ if srcmtime > targetmtime:
+ yield docname
+ except EnvironmentError:
+ # source doesn't exist anymore
+ pass
+
+
+ def prepare_writing(self, docnames):
+ self.writer = DitaWriter(self)
+
+ def get_target_uri(self, docname, typ=None):
+ return docname + self.out_suffix
+
+ def write_doc(self, docname, doctree):
+ self.docname = docname
+ destination = StringOutput(encoding='utf-8')
+ self.writer.write(doctree, destination)
+ outfilename = path.join(self.outdir, os_path(docname) + self.out_suffix)
+ ensuredir(path.dirname(outfilename))
+ try:
+ f = codecs.open(outfilename, 'w', 'utf-8')
+ try:
+ f.write(self.writer.output)
+ finally:
+ f.close()
+ except (IOError, OSError), err:
+ self.warn("error writing file %s: %s" % (outfilename, err))
+ self.post_process_images(doctree)
+
+ def copy_image_files(self):
+ # copy image files
+ if self.images:
+ for src in self.status_iterator(self.images, 'copying images... ',
+ brown, len(self.images)):
+ dest = path.join(self.outdir, src)
+ ensuredir(path.dirname(dest))
+ try:
+ copyfile(path.join(self.srcdir, src), dest)
+ except Exception, err:
+ self.warn('cannot copy image file %r: %s' %
+ (path.join(self.srcdir, src), err))
+
+
+
+
+ def finish(self):
+ node = self.env.get_toctree_for(self.config.master_doc, self, False)
+ output = render_map(self, node)
+ outfilename = path.join(self.outdir, 'index.ditamap')
+ ensuredir(path.dirname(outfilename))
+ try:
+ f = codecs.open(outfilename, 'w', 'utf-8', 'xmlcharrefreplace')
+ try:
+ f.write(output)
+ finally:
+ f.close()
+ except (IOError, OSError), err:
+ self.warn("error writing file %s: %s" % (outfilename, err))
+ self.copy_image_files()
+
diff --git a/scripts/qtextensions/dita/ditamapwriter.py b/scripts/qtextensions/dita/ditamapwriter.py
new file mode 100644
index 0000000..7b28104
--- /dev/null
+++ b/scripts/qtextensions/dita/ditamapwriter.py
@@ -0,0 +1,103 @@
+from lxml import etree
+
+from docutils.io import DocTreeInput, StringOutput
+from docutils.utils import new_document
+from docutils.core import Publisher
+from docutils.readers.doctree import Reader as DoctreeReader
+from docutils import nodes, writers
+
+from sphinx.util.pycompat import b
+
+XML_HEAD = u"""<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "../dtd/map.dtd">
+"""
+
+def render_map(builder, node):
+ if node:
+ doc = new_document(b('<partial node>'))
+ doc.append(node)
+
+ publisher = Publisher( source_class = DocTreeInput, destination_class=StringOutput)
+ publisher.set_components('standalone', 'restructuredtext', 'pseudoxml')
+ publisher.reader = DoctreeReader()
+ publisher.writer = DitaMapWriter(builder)
+ publisher.process_programmatic_settings(None, {'output_encoding': 'utf-8'}, None)
+ publisher.set_source(doc, None)
+ publisher.set_destination(None, None)
+ publisher.publish()
+ return publisher.writer.output
+ output = XML_HEAD
+ output += u"<map></map>"
+ return output
+
+class DitaMapWriter(writers.Writer):
+ def __init__(self, builder):
+ writers.Writer.__init__(self)
+ self.builder = builder
+
+ def translate(self):
+ visitor = DitaMapTranslator(self.document, self.builder)
+ self.document.walkabout(visitor)
+ self.output = XML_HEAD
+ self.output += visitor.body
+
+class DitaMapTranslator(nodes.NodeVisitor):
+ def __init__(self, document, builder):
+ nodes.NodeVisitor.__init__(self, document)
+ self.builder = builder
+ self.root = None
+ self.node = None
+ self.parent = None
+
+ def visit_document(self, node):
+ self.root = self.node = self.parent = etree.Element('map')
+
+ def depart_document(self, node):
+ self.body = etree.tostring(self.root, pretty_print=True)
+
+ def visit_Text(self, node):
+ pass
+
+ def depart_Text(self, node):
+ pass
+
+ def visit_paragraph(self, node):
+ pass
+
+ def depart_paragraph(self, node):
+ pass
+
+ def visit_compound(self, node):
+ pass
+
+ def depart_compound(self, node):
+ pass
+
+ def visit_compact_paragraph(self, node):
+ pass
+
+ def depart_compact_paragraph(self, node):
+ pass
+
+ def visit_bullet_list(self, node):
+ if self.node != None:
+ self.parent = self.node
+
+ def depart_bullet_list(self, node):
+ if self.parent != None:
+ self.parent = self.parent.getparent()
+
+
+ def visit_list_item(self, node):
+ pass
+
+ def depart_list_item(self, node):
+ pass
+
+ def visit_reference(self, node):
+ if node.get('anchorname') == '':
+ self.node = etree.SubElement(self.parent, 'topicref', {'href':node.get('refuri')})
+
+ def depart_reference(self, node):
+ pass
+
diff --git a/scripts/qtextensions/dita/ditawriter.py b/scripts/qtextensions/dita/ditawriter.py
new file mode 100644
index 0000000..94637f5
--- /dev/null
+++ b/scripts/qtextensions/dita/ditawriter.py
@@ -0,0 +1,316 @@
+from lxml import etree
+from docutils import nodes, writers
+from os import path
+
+XML_HEAD = u"""<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
+"""
+
+class DitaWriter(writers.Writer):
+ def __init__(self, builder):
+ writers.Writer.__init__(self)
+ self.builder = builder
+ self.topics = etree.TreeBuilder()
+
+ def translate(self):
+ visitor = DitaTranslator(self.document, self.builder)
+ self.document.walkabout(visitor)
+ self.output = XML_HEAD
+ self.output += visitor.body
+
+class DitaTranslator(nodes.NodeVisitor):
+ def __init__(self, document, builder):
+ nodes.NodeVisitor.__init__(self, document)
+ self.builder = builder
+ self.tree = etree.TreeBuilder()
+ # trace if we are inside a body element
+ self.inBody = False
+ # trace if we have an empty document
+ self.hasContent = False
+
+ def visit_document(self, node):
+ pass
+
+ def depart_document(self, node):
+ if not self.hasContent:
+ self.body = u'<topic id="none"></topic>'
+ else:
+ root = self.tree.close()
+ self.body = etree.tostring(root, pretty_print=True)
+
+ def visit_comment(self, node):
+ raise nodes.SkipNode
+
+ def depart_comment(self, node):
+ pass
+
+ def visit_Text(self, node):
+ self.tree.data(node.astext())
+
+ def depart_Text(self, node):
+ pass
+
+ def visit_section(self, node):
+ if self.inBody:
+ self.tree.end('body')
+ self.inBody = False
+ id = node.get('ids')[0]
+ self.tree.start('topic', {'id':id})
+ self.hasContent = True
+
+ def depart_section(self, node):
+ if self.inBody:
+ self.tree.end('body')
+ self.inBody = False
+ self.tree.end('topic')
+
+ def visit_title(self, node):
+ self.tree.start('title', {})
+
+ def depart_title(self, node):
+ self.tree.end('title')
+ self.tree.start('body', {})
+ self.inBody = True
+
+ def visit_paragraph(self, node):
+ self.tree.start('p', {})
+
+ def depart_paragraph(self, node):
+ self.tree.end('p')
+
+ def visit_compound(self, node):
+ raise nodes.SkipNode
+
+ def depart_compound(self, node):
+ pass
+
+ def visit_compact_paragraph(self, node):
+ self.tree.start('p', {})
+
+ def depart_compact_paragraph(self, node):
+ self.tree.end('p')
+
+ def visit_bullet_list(self, node):
+ self.tree.start('ul', {})
+
+ def depart_bullet_list(self, node):
+ self.tree.end('ul')
+
+
+ def visit_list_item(self, node):
+ self.tree.start('li', {})
+
+ def depart_list_item(self, node):
+ self.tree.end('li')
+
+ def visit_enumerated_list(self, node):
+ self.tree.start('ol', {})
+
+ def depart_enumerated_list(self, node):
+ self.tree.end('ol')
+
+ def visit_reference(self, node):
+ refuri = node['refuri']
+ format = ''
+ if refuri.startswith('http://'):
+ format = 'html'
+ name, ext = path.splitext(node.get('refuri'))
+ if ext:
+ format = ext[1:]
+ self.tree.start('xref', {'href':refuri, 'format':format})
+
+ def depart_reference(self, node):
+ self.tree.end('xref')
+
+ def visit_emphasis(self, node):
+ self.tree.start('i', {})
+
+ def depart_emphasis(self, node):
+ self.tree.end('i')
+
+ def visit_strong(self, node):
+ self.tree.start('b', {})
+
+ def depart_strong(self, node):
+ self.tree.end('b')
+
+ def visit_literal(self, node):
+ self.tree.start('tt', {})
+
+ def depart_literal(self, node):
+ self.tree.end('tt')
+
+ def visit_target(self, node):
+ raise nodes.SkipNode
+
+ def depart_target(self, node):
+ pass
+
+ def visit_image(self, node):
+ args = {}
+ args['href'] = path.relpath(node['uri'], path.dirname(self.builder.docname))
+ if node.has_key('align'):
+ args['align'] = node['align']
+ self.tree.start('image', args)
+
+ def depart_image(self, node):
+ self.tree.end('image')
+
+ def visit_problematic(self, node):
+ raise nodes.SkipNode
+
+ def depart_problematic(self, node):
+ pass
+
+ def visit_title_reference(self, node):
+ pass
+
+ def depart_title_reference(self, node):
+ pass
+
+ def visit_rubric(self, node):
+ self.tree.start('note', {'type':'notice'})
+
+ def depart_rubric(self, node):
+ self.tree.end('note')
+
+ def visit_note(self, node):
+ self.tree.start('note', {'type':'note'})
+
+ def depart_note(self, node):
+ self.tree.end('note')
+
+ def visit_warning(self, node):
+ self.tree.start('note', {'type':'warning'})
+
+ def depart_warning(self, node):
+ self.tree.end('note')
+
+ def visit_literal_block(self, node):
+ self.tree.start('codeblock', {})
+
+ def depart_literal_block(self, node):
+ self.tree.end('codeblock')
+
+ def visit_table(self, node):
+ self.tree.start('table', {})
+
+ def depart_table(self, node):
+ self.tree.end('table')
+
+ def visit_tgroup(self, node):
+ self.tree.start('tgroup', {'cols':str(node.get('cols'))})
+
+ def depart_tgroup(self, node):
+ self.tree.end('tgroup')
+
+ def visit_tbody(self, node):
+ self.tree.start('tbody', {})
+
+ def depart_tbody(self, node):
+ self.tree.end('tbody')
+
+ def visit_thead(self, node):
+ self.tree.start('thead', {})
+
+ def depart_thead(self, node):
+ self.tree.end('thead')
+
+ def visit_colspec(self, node):
+ self.tree.start('colspec', {})
+
+ def depart_colspec(self, node):
+ self.tree.end('colspec')
+
+ def visit_row(self, node):
+ self.tree.start('row', {})
+
+ def depart_row(self, node):
+ self.tree.end('row')
+
+ def visit_entry(self, node):
+ self.tree.start('entry', {})
+
+ def depart_entry(self, node):
+ self.tree.end('entry')
+
+ def visit_definition_list(self, node):
+ self.tree.start('dl', {})
+
+ def depart_definition_list(self, node):
+ self.tree.end('dl')
+
+ def visit_definition_list_item(self, node):
+ self.tree.start('dlentry', {})
+
+ def depart_definition_list_item(self, node):
+ self.tree.end('dlentry')
+
+ def visit_term(self, node):
+ self.tree.start('dt', {})
+
+ def depart_term(self, node):
+ self.tree.end('dt')
+
+ def visit_definition(self, node):
+ self.tree.start('dd', {})
+
+ def depart_definition(self, node):
+ self.tree.end('dd')
+
+ def visit_footnote_reference(self, node):
+ raise nodes.SkipNode
+
+ def depart_footnote_reference(self, node):
+ pass
+
+ def visit_footnote(self, node):
+ raise nodes.SkipNode
+
+ def depart_footnote(self, node):
+ pass
+
+ def visit_label(self, node):
+ raise nodes.SkipNode
+
+ def depart_label(self, node):
+ pass
+
+ def visit_inline(self, node):
+ print('inlines are not supported yet')
+ raise nodes.SkipNode
+
+ def depart_inline(self, node):
+ pass
+
+ def visit_seealso(self, node):
+ print('seealsos are not supported yet')
+ raise nodes.SkipNode
+
+ def depart_seealso(self, node):
+ pass
+
+ def visit_topic(self, node):
+ print('topics are not supported yet')
+ raise nodes.SkipNode
+
+ def depart_topic(self, node):
+ pass
+
+ def visit_block_quote(self, node):
+ self.tree.start('lq', {})
+
+ def depart_block_quote(self, node):
+ self.tree.end('lq')
+
+ def visit_line_block(self, node):
+ self.tree.start('lines', {})
+
+ def depart_line_block(self, node):
+ self.tree.end('lines')
+
+ def visit_line(self, node):
+ pass
+
+ def depart_line(self, node):
+ self.tree.data('\n')
diff --git a/scripts/qtextensions/shared/__init__.py b/scripts/qtextensions/shared/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/scripts/qtextensions/shared/__init__.py
diff --git a/scripts/qtextensions/shared/conf.py b/scripts/qtextensions/shared/conf.py
new file mode 100644
index 0000000..c0fa2b9
--- /dev/null
+++ b/scripts/qtextensions/shared/conf.py
@@ -0,0 +1,329 @@
+# -*- coding: utf-8 -*-
+#
+# Programming Qt for Symbian^3 Devices documentation build configuration file, created by
+# sphinx-quickstart on Fri Jul 8 08:24:25 2011.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+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.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+
+extensions = ['sphinx.ext.todo', 'sphinx.ext.extlinks', 'sphinx.ext.pngmath',
+ 'qtextensions.dita']
+
+# setup sphinx.ext.todo
+# Enable todos
+todo_include_todos = True
+
+# setup sphinx.ext.extlinks (see http://sphinx.pocoo.org/latest/ext/extlinks.html)
+
+# Sample Usage
+
+# :qt:`QPushButton <qpushbutton.html>`
+# :creator:`Qt Creator User Interface <creator-quick-tour.html>`
+# :mobility:`Connectivity <connectivity-api.html>`
+# :component:`ApplicationWindow <qml-applicationwindow.html>`
+
+extlinks = {
+ 'sdk': ('http://doc.qt.nokia.com/sdk-1.1/%s', None),
+ 'simulator': ('http://doc.qt.nokia.com/qtsimulator-1.1/%s', None),
+ 'qt': ('http://qt-project.org/doc/qt-4.8/%s', None),
+ 'qt5': ('http://qt-project.org/doc/qt-5.0/%s', None),
+ 'qt5-snapshot': ('http://doc-snapshot.qt-project.org/5.0/%s', None),
+ 'guides-homepage': ('http://qt-project.org/wiki/Developer-Guides/%s', None),
+ 'download': ('http://get.qt.nokia.com/developerguides/%s', None),
+ 'qtquick-repo': ('http://publisher.europe.nokia.com/jpasion/snapshot/qtquick-phase2/%s', None),
+ 'creator': ('http://doc.qt.nokia.com/qtcreator/%s', None),
+ 'mobility': ('http://doc.qt.nokia.com/qt-mobility-snapshot/%s', None),
+ 'component': ('http://doc.qt.nokia.com/qt-components-symbian-1.0/%s', None),
+ 'component11': ('http://doc.qt.nokia.com/qtquick-components-symbian-1.1/%s', None),
+ 'publish' : ('http://ed.europe.nokia.com/qmlbook/%s', None),
+ 'installer': ('http://doc.qt.nokia.com/smart-installer/%s', None),
+ 'jsondb': ('http://jsondb-docs.test.qt.nokia.com/gerrit/%s', None),
+ }
+
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'project'
+copyright = u'(C) 2012 Nokia. http://qt.nokia.com/learning'
+
+# 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.
+#
+# NOTE: this is default version which is used if you do now define version in the conf.py inside of the project
+#
+# The short X.Y version.
+version = '0.1'
+# The full version, including alpha/beta/rc tags.
+release = '0.1 (default)'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'qtweb'
+#html_style = 'sphinxdoc.css'
+
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+html_theme_options = {
+ # override theme mail address
+ # 'feedback_mail': 'jurgen.bocklage-ryannel@nokia.com'
+}
+
+# Add any paths that contain custom themes here, relative to this directory.
+html_theme_path = ['../themes/']
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+html_title = 'html_title'
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+html_short_title = 'html_short_title'
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# 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']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+html_sidebars = {
+ '**': ['globaltoc.html', 'localtoc.html', 'sourcelink.html'],
+}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+html_domain_indices = False
+
+# If false, no index is generated.
+html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+html_show_sourcelink = False
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+html_show_sphinx = False
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+html_add_permalinks = True
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'htmlhelp_basename'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+latex_paper_size = 'a4'
+
+# The font size ('10pt', '11pt' or '12pt').
+latex_font_size = '12pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'latex_document.tex', u'title in latex_docuements',
+ u'(C) 2012 Nokia. http://qt.nokia.com/learning', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+latex_use_parts = False
+
+# If true, show page references after internal links.
+latex_show_pagerefs = True
+
+# If true, show URL addresses after external links.
+latex_show_urls = 'footnote'
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+latex_domain_indices = False
+
+# latex_custom_preamble = """
+# \\definecolor{VerbatimColor}{rgb}{1.0,1.0,0.9}
+# \\definecolor{VerbatimBorderColor}{rgb}{1.0,1.0,0.5}
+# """
+# latex_elements = {
+# 'pointsize': '10pt',
+# 'preamble': latex_custom_preamble
+# }
+
+# change the font size of the code samples in the LaTex and PDF output
+# taken from http://stackoverflow.com/questions/9899283/how-do-you-change-the-code-example-font-size-in-latex-pdf-output-with-sphinx
+#
+from sphinx.highlighting import PygmentsBridge
+from pygments.formatters.latex import LatexFormatter
+class CustomLatexFormatter(LatexFormatter):
+ def __init__(self, **options):
+ super(CustomLatexFormatter, self).__init__(**options)
+ self.verboptions = r"formatcom=\footnotesize"
+PygmentsBridge.latex_formatter = CustomLatexFormatter
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'document_man_pages', u'title in man_pages',
+ [u'(C) 2011 Nokia. http://qt.nokia.com/learning'], 1)
+]
+
+
+# -- Options for Epub output ---------------------------------------------------
+
+# The basename for the epub file. It defaults to the project name w/o spaces
+epub_basename = 'document_epub_basename'
+
+# Bibliographic Dublin Core info.
+epub_title = u'epub_title'
+epub_author = u'Nokia, Qt Learning'
+epub_publisher = u'http://qt.nokia.com/learning'
+epub_copyright = u'(C) 2011 Nokia'
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
+
+# -- Options for Qt Help output ---------------------------------------------------
+# The basename for the Qt help file. It defaults to the project name w/o spaces
+qthelp_basename = 'qthelp_basename'
+