[Doc] Add all Matlab examples to the Sphinx docs

This commit is contained in:
Ray Speth 2013-08-22 21:46:37 +00:00
parent 1cedf904df
commit 4534bbd21b
5 changed files with 41 additions and 0 deletions

1
.gitignore vendored
View file

@ -35,3 +35,4 @@ config.log
coverage/
coverage.info
doc/sphinx/cython/examples/*.rst
doc/sphinx/matlab/examples/*.rst

View file

@ -34,4 +34,15 @@ if localenv['sphinx_docs']:
build(b)
localenv.Depends(sphinxdocs, b)
# Matlab examples: create individual documentation pages with the source
# for each example
for f in mglob(env, '#samples/matlab', 'm'):
tmpenv = env.Clone()
tmpenv['script_name'] = f.name
tmpenv['script_path'] = '../../../../samples/matlab/%s' % f.name
b = tmpenv.SubstFile('#doc/sphinx/matlab/examples/%s.rst' % f.name[:-2],
'#doc/sphinx/matlab/examples/example-script.rst.in')
build(b)
localenv.Depends(sphinxdocs, b)
localenv.AlwaysBuild(sphinxdocs)

View file

@ -0,0 +1,23 @@
.. _sec-cython-examples:
.. py:currentmodule:: cantera
Index of Examples
=================
This is an index of the examples included with the Cantera Matlab Toolbox.
Tutorials
---------
.. toctree::
:glob:
examples/tut*
Examples
--------
.. toctree::
:glob:
examples/[!tut]*

View file

@ -0,0 +1,5 @@
@script_name@
=======================================================================
.. literalinclude:: @script_path@
:language: matlab

View file

@ -7,3 +7,4 @@ Matlab Interface User's Guide
:maxdepth: 2
input-tutorial
examples