mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-02 05:16:36 +08:00
Updates to examples and documentation.
This commit is contained in:
@@ -227,3 +227,35 @@ def requires(var):
|
||||
|
||||
return requiresVarWrapper
|
||||
return requiresVar
|
||||
|
||||
def _makeExample(filePath):
|
||||
|
||||
import os
|
||||
name = filePath.split(os.path.sep)[-1][:-3]
|
||||
out = """.. _examples_%s:
|
||||
|
||||
.. ------------------------------ ..
|
||||
.. THIS FILE IS AUTO GENEREATED ..
|
||||
.. ------------------------------ ..
|
||||
|
||||
%s
|
||||
%s
|
||||
|
||||
.. plot::
|
||||
|
||||
from SimPEG import Examples
|
||||
Examples.%s.run()
|
||||
|
||||
.. literalinclude:: ../../SimPEG/Examples/%s.py
|
||||
:language: python
|
||||
:linenos:
|
||||
"""%(name,name.replace('_',' '),'='*len(name),name,name)
|
||||
|
||||
rst = os.path.sep.join((filePath.split(os.path.sep)[:-3] + ['docs', 'examples', name + '.rst']))
|
||||
|
||||
f = open(rst, 'w')
|
||||
f.write(out)
|
||||
f.close()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user