[Doc] Add all Matlab examples to the Sphinx docs
This commit is contained in:
parent
1cedf904df
commit
4534bbd21b
5 changed files with 41 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -35,3 +35,4 @@ config.log
|
|||
coverage/
|
||||
coverage.info
|
||||
doc/sphinx/cython/examples/*.rst
|
||||
doc/sphinx/matlab/examples/*.rst
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
23
doc/sphinx/matlab/examples.rst
Normal file
23
doc/sphinx/matlab/examples.rst
Normal 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]*
|
||||
5
doc/sphinx/matlab/examples/example-script.rst.in
Normal file
5
doc/sphinx/matlab/examples/example-script.rst.in
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
@script_name@
|
||||
=======================================================================
|
||||
|
||||
.. literalinclude:: @script_path@
|
||||
:language: matlab
|
||||
|
|
@ -7,3 +7,4 @@ Matlab Interface User's Guide
|
|||
:maxdepth: 2
|
||||
|
||||
input-tutorial
|
||||
examples
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue