Skip to content

FormatExamples

Jonathan Guyer edited this page Sep 26, 2014 · 1 revision

A recent post asked for the ability to format a single example file. The attached rudimentary script will do an OK job of this. It presumes that you are able to build FiPy's manual.

 * The script ''must'' be run from within the same directory as the example
 * To generate HTML from `examples/diffusion/mesh1D.py`
   {{{
   cd examples/diffusion
   python <path>/<to>/sphinx-oneoff.py -b html . sphinx_out mesh1D.py
   }}}
   You should be able to open `sphinx_out/mesh1D.html` in a browser.
 * To generate a PDF from `examples/diffusion/mesh1D.py`
   {{{
   cd examples/diffusion
   python <path>/<to>/sphinx-oneoff.py -b latex . sphinx_out mesh1D.py
   cd sphinx_out
   make
   }}}
   You should be able to open `mesh1D.pdf`.
Clone this wiki locally