diff --git a/doc/SConscript b/doc/SConscript index a4c078373..d39033cae 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -25,21 +25,6 @@ def extract_python_docstring(pyfile, summary_only=True): return doc -def extract_matlab_summary(mfile): - """ Returns a one-line summary comment from a .m file """ - doc = '' - with open(mfile) as f: - for line in f: - line = line.strip() - if line.startswith('%'): - doc = line.strip('%').strip() - if doc: - break - name = os.path.basename(mfile)[:-2].replace('_', ' ') - if doc.lower().replace('_', ' ').startswith(name): - doc = doc[len(name):].strip() - return doc - # Set up functions to pseudo-autodoc the MATLAB toolbox def extract_matlab_docstring(mfile, level): @@ -100,9 +85,10 @@ def extract_matlab_docstring(mfile, level): return docstring + '\n' + def get_function_name(str): """ - Return the function or classdef signature, assuming that + Return the Matlab function or classdef signature, assuming that the string starts with either 'function ' or 'classdef '. """ if str.startswith('function '): @@ -206,7 +192,7 @@ if localenv['sphinx_docs']: # Set the title header title = page.title - tempenv['title'] = '='*len(title) + '\n' + title + '\n' + '='*len(title) + tempenv['title'] = '='*len(title) + '\n' + title + '\n' + '='*len(title) doc = '' # The base directory of the MATLAB toolbox relative to the sphinx build directory @@ -246,30 +232,4 @@ if localenv['sphinx_docs']: build(c) localenv.Depends(sphinxdocs, c) - # Matlab examples: create individual documentation pages with the source - # for each example - examples = [] - tutorials = [] - 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/example-script.rst.in') - build(b) - localenv.Depends(sphinxdocs, b) - summary = [':doc:`{0} `:'.format(f.name, f.name[:-2]), - extract_matlab_summary(f.abspath), - ''] - if f.name.startswith('tut'): - tutorials.extend(summary) - else: - examples.extend(summary) - - localenv['matlab_tutorials'] = '\n'.join(tutorials) - localenv['matlab_examples'] = '\n'.join(examples) - b = localenv.SubstFile('#doc/sphinx/matlab/examples.rst', - '#doc/sphinx/matlab/examples.rst.in') - build(b) - localenv.Depends(sphinxdocs, b) localenv.AlwaysBuild(sphinxdocs) diff --git a/doc/sphinx/matlab/example-script.rst.in b/doc/sphinx/matlab/example-script.rst.in deleted file mode 100644 index aa4d452f6..000000000 --- a/doc/sphinx/matlab/example-script.rst.in +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -.. _matlab-example-@script_name@: - -@script_name@ -======================================================================= - -.. literalinclude:: @script_path@ - :language: matlab diff --git a/doc/sphinx/matlab/examples.rst.in b/doc/sphinx/matlab/examples.rst.in deleted file mode 100644 index 47973c7ad..000000000 --- a/doc/sphinx/matlab/examples.rst.in +++ /dev/null @@ -1,16 +0,0 @@ -.. _sec-matlab-examples: - -Index of Matlab Examples -======================== - -This is an index of the examples included with the Cantera Matlab Toolbox. - -Tutorials ---------- - -@matlab_tutorials@ - -Examples --------- - -@matlab_examples@ diff --git a/doc/sphinx/matlab/index.rst b/doc/sphinx/matlab/index.rst index 2052a2139..64e8d6d98 100644 --- a/doc/sphinx/matlab/index.rst +++ b/doc/sphinx/matlab/index.rst @@ -16,4 +16,3 @@ Matlab Interface User's Guide code-docs/one-dim code-docs/data code-docs/utilities - examples