Contributing¶
This page provides guidance on how to contribute to DOLFIN.
Adding a demo¶
The below instructions are for adding a Python demo program to DOLFIN.
DOLFIN demo programs are written in reStructuredText, and converted to
Python/C++ code using pylit. The process for C++ demos is similar.
The documented demo programs are displayed at
http://fenics-dolfin.readthedocs.io/.
Creating the demo program¶
Create a directory for the demo under
demo/documented/, e.g.demo/documented/foo/python/.Write the demo in reStructuredText (rst), with the actual code in ‘code blocks’ (see other demos for guidance). The demo file should be named
demo_foo-bar.py.rst.Convert the rst file to to a Python file using
pylit(pylit is distributed with DOLFIN inutils/pylit)../../../../utils/pylit/pylit.py demo_foo-bar.py.rst
This will create a file
demo_foo-bar.py. Test that the Python script can be run.
Adding the demo to the documentation system¶
- Add the demo to the list in
doc/source/demos.rst. - To check how the documentation will be displayed on the web, in
doc/runmake htmland open the filedoc/build/html/index.htmlin a browser.
Make a pull request¶
- Create a git branch and add the
demo_foo-bar.py.rstfile to the repository. Do not add thedemo_foo-bar.pyfile. - If there is no C++ version, edit
test/regression/test.pyto indicate that there is no C++ version of the demo. - Make a pull request at
https://bitbucket.org/fenics-project/dolfin/pull-requests/ for your
demo to be considered for addition to DOLFIN. Add the
demo_foo-bar.py.rstfile to the repository, but do not add thedemo_foo-bar.pyfile.