Skip to content
Browse files

Adapting Kivy sphinx docs system for kivy-statecharts.

  • Loading branch information...
1 parent 9ea35f5 commit a5da749e7afc0b747de550684468087ca9e5ea96 @geojeff committed
View
162 docs/Makefile
@@ -2,152 +2,86 @@
#
# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
+PYTHON = ~/.virtualenvs/kivy_statecharts/bin/python
+SPHINXOPTS = -W
+#SPHINXOPTS =
+SPHINXBUILD = ~/.virtualenvs/kivy_statecharts/bin/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) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sources
+ALLSPHINXOPTSGT = -d build/doctrees_gettext $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sources
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+.PHONY: help clean html web pickle htmlhelp latex changes linkcheck gettext
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 " singlehtml to make a single large HTML file"
- @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 " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @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)"
+ @echo " html to make standalone HTML files"
+ @echo " pickle to make pickle files (usable by e.g. sphinx-web)"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " changes to make an overview over all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
clean:
- -rm -rf $(BUILDDIR)/*
+ -rm -rf build/*
html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ mkdir -p build/html build/doctrees
+ $(PYTHON) autobuild.py
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html
@echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+ @echo "Build finished. The HTML pages are in build/html."
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+gettext:
+ mkdir -p build/html build/doctrees_gettext
+ $(PYTHON) autobuild.py
+ $(SPHINXBUILD) -b gettext $(ALLSPHINXOPTSGT) build/gettext
@echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+ @echo "Build finished. The Gettext pages are in build/gettext."
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ mkdir -p build/pickle build/doctrees
+ $(PYTHON) autobuild.py
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle
@echo
- @echo "Build finished; now you can process the pickle files."
+ @echo "Build finished; now you can process the pickle files or run"
+ @echo " sphinx-web build/pickle"
+ @echo "to start the sphinx-web server."
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
+web: pickle
htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ mkdir -p build/htmlhelp build/doctrees
+ $(PYTHON) autobuild.py
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/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/kivy-statecharts.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/kivy-statecharts.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/kivy-statecharts"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/kivy-statecharts"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+ ".hhp project file in build/htmlhelp."
latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ mkdir -p build/latex build/doctrees
+ $(PYTHON) autobuild.py
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/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:
- $(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:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+ @echo "Build finished; the LaTeX files are in build/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
+ mkdir -p build/changes build/doctrees
+ $(PYTHON) autobuild.py
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes
@echo
- @echo "The overview file is in $(BUILDDIR)/changes."
+ @echo "The overview file is in build/changes."
linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ mkdir -p build/linkcheck build/doctrees
+ $(PYTHON) autobuild.py
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/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."
+ "or in build/linkcheck/output.txt."
View
200 docs/autobuild.py
@@ -0,0 +1,200 @@
+'''
+Copied from kivy/docs.
+
+Script to generate Kivy API from source code.
+
+Code is messy, but working.
+Be careful if you change anything in !
+
+'''
+
+ignore_list = (
+)
+
+import os
+import sys
+from glob import glob
+
+import kivy_statecharts
+
+# force loading of kivy_statechart modules
+import kivy_statecharts.debug.monitor
+import kivy_statecharts.debug.sequence_matcher
+import kivy_statecharts.private.state_path_matcher
+import kivy_statecharts.system.async
+import kivy_statecharts.system.empty_state
+import kivy_statecharts.system.history_state
+import kivy_statecharts.system.state
+import kivy_statecharts.system.statechart
+
+# Directory of doc
+base_dir = os.path.dirname(__file__)
+dest_dir = os.path.join(base_dir, 'sources')
+examples_framework_dir = os.path.join(base_dir, '..', 'examples', 'framework')
+
+def writefile(filename, data):
+ global dest_dir
+ # avoid to rewrite the file if the content didn't change
+ f = os.path.join(dest_dir, filename)
+ print 'write', filename
+ if os.path.exists(f):
+ with open(f) as fd:
+ if fd.read() == data:
+ return
+ h = open(f, 'w')
+ h.write(data)
+ h.close()
+
+# Search all kivy-statecharts modules
+l = [(x, sys.modules[x], os.path.basename(sys.modules[x].__file__).rsplit('.', 1)[0]) for x in sys.modules if x.startswith('kivy_statecharts') and sys.modules[x]]
+
+# Extract packages from modules
+packages = []
+modules = {}
+for name, module, filename in l:
+ if name in ignore_list:
+ continue
+ if filename == '__init__':
+ packages.append(name)
+ else:
+ if hasattr(module, '__all__'):
+ modules[name] = module.__all__
+ else:
+ modules[name] = [x for x in dir(module) if not x.startswith('__')]
+
+packages.sort()
+
+# Create index
+api_index = \
+'''API Reference
+-------------
+
+The API reference is a lexicographic list of all the different classes,
+methods and features that kivy-statecharts offers.
+
+.. toctree::
+ :maxdepth: 2
+
+'''
+for package in [x for x in packages if len(x.split('.')) <= 2]:
+ api_index += " api-%s.rst\n" % package
+
+writefile('api-index.rst', api_index)
+
+# Create index for all packages
+template = \
+'''==========================================================================================================
+$SUMMARY
+==========================================================================================================
+
+$EXAMPLES_REF
+
+.. automodule:: $PACKAGE
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+$EXAMPLES
+'''
+
+template_examples = \
+'''.. _example-reference%d:
+
+Examples
+--------
+
+%s
+'''
+
+template_examples_ref = \
+'''# :ref:`Jump directly to Examples <example-reference%d>`'''
+
+def extract_summary_line(doc):
+ if doc is None:
+ return
+ for line in doc.split('\n'):
+ line = line.strip()
+ # don't take empty line
+ if len(line) < 1:
+ continue
+ # ref mark
+ if line.startswith('.. _'):
+ continue
+ return line
+
+for package in packages:
+ summary = extract_summary_line(sys.modules[package].__doc__)
+ if summary is None:
+ summary = 'NO DOCUMENTATION (package %s)' % package
+ t = template.replace('$SUMMARY', summary)
+ t = t.replace('$PACKAGE', package)
+ t = t.replace('$EXAMPLES_REF', '')
+ t = t.replace('$EXAMPLES', '')
+
+ # search packages
+ for subpackage in packages:
+ packagemodule = subpackage.rsplit('.', 1)[0]
+ if packagemodule != package or len(subpackage.split('.')) <= 2:
+ continue
+ t += " api-%s.rst\n" % subpackage
+
+ # search modules
+ m = modules.keys()
+ m.sort(key=lambda x: extract_summary_line(sys.modules[x].__doc__))
+ for module in m:
+ packagemodule = module.rsplit('.', 1)[0]
+ if packagemodule != package:
+ continue
+ t += " api-%s.rst\n" % module
+
+ writefile('api-%s.rst' % package, t)
+
+
+# Create index for all module
+m = modules.keys()
+m.sort()
+refid = 0
+for module in m:
+ summary = extract_summary_line(sys.modules[module].__doc__)
+ if summary is None:
+ summary = 'NO DOCUMENTATION (module %s)' % package
+
+ # search examples
+ example_output = []
+ example_prefix = module
+ if module.startswith('kivy_statecharts.'):
+ example_prefix = module[5:]
+ example_prefix = example_prefix.replace('.', '_')
+
+ # try to found any example in framework directory
+ list_examples = glob('%s*.py' % os.path.join(examples_framework_dir, example_prefix))
+ for x in list_examples:
+ # extract filename without directory
+ xb = os.path.basename(x)
+
+ # add a section !
+ example_output.append('File :download:`%s <%s>` ::' % (
+ xb, os.path.join('..', x)))
+
+ # put the file in
+ with open(x, 'r') as fd:
+ d = fd.read().strip()
+ d = '\t' + '\n\t'.join(d.split('\n'))
+ example_output.append(d)
+
+ t = template.replace('$SUMMARY', summary)
+ t = t.replace('$PACKAGE', module)
+ if len(example_output):
+ refid += 1
+ example_output = template_examples % (refid, '\n\n\n'.join(example_output))
+ t = t.replace('$EXAMPLES_REF', template_examples_ref % refid)
+ t = t.replace('$EXAMPLES', example_output)
+ else:
+ t = t.replace('$EXAMPLES_REF', '')
+ t = t.replace('$EXAMPLES', '')
+ writefile('api-%s.rst' % module, t)
+
+
+# Generation finished
+print 'Generation finished, do make html'
View
242 docs/conf.py
@@ -1,242 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# kivy-statecharts documentation build configuration file, created by
-# sphinx-quickstart on Fri Sep 14 15:29:50 2012.
-#
-# 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 = []
-
-# 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'kivy-statecharts'
-copyright = u'2012, Jeff Pittman'
-
-# 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.1'
-# The full version, including alpha/beta/rc tags.
-release = '0.1'
-
-# 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 = 'default'
-
-# 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 = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# 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 = {}
-
-# 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 = True
-
-# 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 = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# 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
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'kivy-statechartsdoc'
-
-
-# -- Options for LaTeX output --------------------------------------------------
-
-latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'kivy-statecharts.tex', u'kivy-statecharts Documentation',
- u'Jeff Pittman', '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 = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output --------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'kivy-statecharts', u'kivy-statecharts Documentation',
- [u'Jeff Pittman'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-
-# -- Options for Texinfo output ------------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- ('index', 'kivy-statecharts', u'kivy-statecharts Documentation',
- u'Jeff Pittman', 'kivy-statecharts', 'One line description of project.',
- 'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
View
190 docs/make.bat
@@ -1,190 +0,0 @@
-@ECHO OFF
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
- set SPHINXBUILD=sphinx-build
-)
-set BUILDDIR=_build
-set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
-set I18NSPHINXOPTS=%SPHINXOPTS% .
-if NOT "%PAPER%" == "" (
- set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
- set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
-)
-
-if "%1" == "" goto help
-
-if "%1" == "help" (
- :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. singlehtml to make a single large HTML file
- 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. devhelp to make HTML files and a Devhelp project
- echo. epub to make an epub
- echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
- echo. text to make text files
- echo. man to make manual pages
- echo. texinfo to make Texinfo files
- echo. gettext to make PO message catalogs
- echo. changes to make an overview over 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
- goto end
-)
-
-if "%1" == "clean" (
- for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
- del /q /s %BUILDDIR%\*
- goto end
-)
-
-if "%1" == "html" (
- %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The HTML pages are in %BUILDDIR%/html.
- goto end
-)
-
-if "%1" == "dirhtml" (
- %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
- goto end
-)
-
-if "%1" == "singlehtml" (
- %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
- goto end
-)
-
-if "%1" == "pickle" (
- %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can process the pickle files.
- goto end
-)
-
-if "%1" == "json" (
- %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can process the JSON files.
- goto end
-)
-
-if "%1" == "htmlhelp" (
- %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can run HTML Help Workshop with the ^
-.hhp project file in %BUILDDIR%/htmlhelp.
- goto end
-)
-
-if "%1" == "qthelp" (
- %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; now you can run "qcollectiongenerator" with the ^
-.qhcp project file in %BUILDDIR%/qthelp, like this:
- echo.^> qcollectiongenerator %BUILDDIR%\qthelp\kivy-statecharts.qhcp
- echo.To view the help file:
- echo.^> assistant -collectionFile %BUILDDIR%\qthelp\kivy-statecharts.ghc
- goto end
-)
-
-if "%1" == "devhelp" (
- %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished.
- goto end
-)
-
-if "%1" == "epub" (
- %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The epub file is in %BUILDDIR%/epub.
- goto end
-)
-
-if "%1" == "latex" (
- %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
- goto end
-)
-
-if "%1" == "text" (
- %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The text files are in %BUILDDIR%/text.
- goto end
-)
-
-if "%1" == "man" (
- %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The manual pages are in %BUILDDIR%/man.
- goto end
-)
-
-if "%1" == "texinfo" (
- %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
- goto end
-)
-
-if "%1" == "gettext" (
- %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
- if errorlevel 1 exit /b 1
- echo.
- echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
- goto end
-)
-
-if "%1" == "changes" (
- %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
- if errorlevel 1 exit /b 1
- echo.
- echo.The overview file is in %BUILDDIR%/changes.
- goto end
-)
-
-if "%1" == "linkcheck" (
- %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
- if errorlevel 1 exit /b 1
- echo.
- echo.Link check complete; look for any errors in the above output ^
-or in %BUILDDIR%/linkcheck/output.txt.
- goto end
-)
-
-if "%1" == "doctest" (
- %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
- if errorlevel 1 exit /b 1
- echo.
- echo.Testing of doctests in the sources finished, look at the ^
-results in %BUILDDIR%/doctest/output.txt.
- goto end
-)
-
-:end
View
13 docs/sources/api-index.rst
@@ -0,0 +1,13 @@
+API Reference
+-------------
+
+The API reference is a lexicographic list of all the different classes,
+methods and features that kivy-statecharts offers.
+
+.. toctree::
+ :maxdepth: 2
+
+ api-kivy_statecharts.rst
+ api-kivy_statecharts.debug.rst
+ api-kivy_statecharts.private.rst
+ api-kivy_statecharts.system.rst
View
13 docs/sources/api-kivy_statecharts.debug.monitor.rst
@@ -0,0 +1,13 @@
+==========================================================================================================
+NO DOCUMENTATION (module kivy_statecharts.system)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.debug.monitor
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
View
15 docs/sources/api-kivy_statecharts.debug.rst
@@ -0,0 +1,15 @@
+==========================================================================================================
+NO DOCUMENTATION (package kivy_statecharts.debug)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.debug
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
+ api-kivy_statecharts.debug.sequence_matcher.rst
+ api-kivy_statecharts.debug.monitor.rst
View
13 docs/sources/api-kivy_statecharts.debug.sequence_matcher.rst
@@ -0,0 +1,13 @@
+==========================================================================================================
+NO DOCUMENTATION (module kivy_statecharts.system)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.debug.sequence_matcher
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
View
14 docs/sources/api-kivy_statecharts.private.rst
@@ -0,0 +1,14 @@
+==========================================================================================================
+NO DOCUMENTATION (package kivy_statecharts.private)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.private
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
+ api-kivy_statecharts.private.state_path_matcher.rst
View
13 docs/sources/api-kivy_statecharts.private.state_path_matcher.rst
@@ -0,0 +1,13 @@
+==========================================================================================================
+NO DOCUMENTATION (module kivy_statecharts.system)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.private.state_path_matcher
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
View
13 docs/sources/api-kivy_statecharts.rst
@@ -0,0 +1,13 @@
+==========================================================================================================
+NO DOCUMENTATION (package kivy_statecharts)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
View
13 docs/sources/api-kivy_statecharts.system.async.rst
@@ -0,0 +1,13 @@
+==========================================================================================================
+NO DOCUMENTATION (module kivy_statecharts.system)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.system.async
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
View
13 docs/sources/api-kivy_statecharts.system.empty_state.rst
@@ -0,0 +1,13 @@
+==========================================================================================================
+NO DOCUMENTATION (module kivy_statecharts.system)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.system.empty_state
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
View
13 docs/sources/api-kivy_statecharts.system.history_state.rst
@@ -0,0 +1,13 @@
+==========================================================================================================
+NO DOCUMENTATION (module kivy_statecharts.system)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.system.history_state
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
View
18 docs/sources/api-kivy_statecharts.system.rst
@@ -0,0 +1,18 @@
+==========================================================================================================
+NO DOCUMENTATION (package kivy_statecharts.system)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.system
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
+ api-kivy_statecharts.system.history_state.rst
+ api-kivy_statecharts.system.async.rst
+ api-kivy_statecharts.system.empty_state.rst
+ api-kivy_statecharts.system.statechart.rst
+ api-kivy_statecharts.system.state.rst
View
13 docs/sources/api-kivy_statecharts.system.state.rst
@@ -0,0 +1,13 @@
+==========================================================================================================
+NO DOCUMENTATION (module kivy_statecharts.system)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.system.state
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
View
13 docs/sources/api-kivy_statecharts.system.statechart.rst
@@ -0,0 +1,13 @@
+==========================================================================================================
+NO DOCUMENTATION (module kivy_statecharts.system)
+==========================================================================================================
+
+
+
+.. automodule:: kivy_statecharts.system.statechart
+ :members:
+ :show-inheritance:
+
+.. toctree::
+
+
View
195 docs/sources/conf.py
@@ -0,0 +1,195 @@
+# -*- coding: utf-8 -*-
+#
+# Kivy documentation build configuration file, created by
+# sphinx-quickstart on Wed Jan 21 22:37:12 2009.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# The contents of this file are pickled, so don't put values in the namespace
+# that aren't pickleable (module imports are okay, they're removed automatically).
+#
+# All configuration values have a default value; values that are commented out
+# serve to show the default value.
+
+import sys, os
+
+# If your extensions are in another directory, add it 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('sphinxext'))
+
+# General configuration
+# ---------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['autodoc', 'sphinx.ext.todo', 'preprocess', 'sphinx.ext.ifconfig']
+
+# Todo configuration
+todo_include_todos = True
+
+# XXX HACK mathieu: monkey patch the autodoc module, to give a better priority
+# for ClassDocumenter, or the cython class will be documented as AttributeClass
+import sphinx.ext.autodoc
+sphinx.ext.autodoc.ClassDocumenter.priority = 10
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['.templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General substitutions.
+project = 'Kivy'
+copyright = '2010, The Kivy Authors'
+
+# The default replacements for |version| and |release|, also used in various
+# other places throughout the built documents.
+#
+os.environ['KIVY_DOC_INCLUDE'] = '1'
+import kivy
+print kivy.__file__
+
+version = kivy.__version__
+release = kivy.__version__
+
+# 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'
+
+# suppress exclusion warnings
+exclude_patterns = ['guide/layouts.rst', 'api-index.rst',
+ 'api-kivy.lib.osc*']
+
+# 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 = 'kivy_pygments_theme.KivyStyle'
+
+
+# Options for HTML output
+# -----------------------
+
+# The style sheet to use for HTML and HTML Help pages. A file of that name
+# must exist either in Sphinx' static/ path, or in one of the custom paths
+# given in html_static_path.
+html_style = 'default.css'
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (within the static path) to place at the top of
+# the sidebar.
+html_logo = 'logo_kivy.png'
+
+# 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 = {}
+
+# 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_use_modindex = True
+
+# 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, the reST sources are included in the HTML build as _sources/<name>.
+#html_copy_source = 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 = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'Kivydoc'
+
+
+# Options for LaTeX output
+# ------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, document class [howto/manual]).
+latex_documents = [
+ ('index', 'Kivy.tex', 'Kivy Documentation',
+ 'The Kivy Developers', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+latex_elements = {
+ 'fontpkg': r'\usepackage{mathpazo}',
+ 'papersize': 'a4paper',
+ 'pointsize': '10pt',
+ 'preamble': r'\usepackage{kivystyle}'
+}
+latex_additional_files = ['kivystyle.sty',
+ '../../kivy/data/logo/kivy-icon-512.png']
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+latex_use_parts = True
+
+# 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_use_modindex = True
View
0 docs/index.rst → docs/sources/index.rst
File renamed without changes.
View
3 kivy_statecharts/system/state.py
@@ -574,7 +574,7 @@ def path_relative_to(self, state):
return path
def get_substate(self, value, callback=None):
- '''Used to get a substate of this state that matches a given value.
+ '''Used to get a substate of this state that matches a given value.
If the value is a state object, then the value will be returned if
it is indeed a substate of this state, otherwise null is returned.
@@ -608,6 +608,7 @@ def get_substate(self, value, callback=None):
* value {State|String} - Used to identify a substate of this state.
* callback {Function} - Optional callback.
'''
+
if value is None:
return None

0 comments on commit a5da749

Please sign in to comment.
Something went wrong with that request. Please try again.