| 1 |
============ |
| 2 |
Contributing |
| 3 |
============ |
| 4 |
|
| 5 |
This page provides guidance on how to contribute to DOLFIN. For information |
| 6 |
about how to get involved and how to get in touch with the developers, see |
| 7 |
our `community page <https://fenicsproject.org/community/>`_. |
| 8 |
|
| 9 |
|
| 10 |
Adding a demo |
| 11 |
============= |
| 12 |
|
| 13 |
The below instructions are for adding a Python demo program to DOLFIN. |
| 14 |
DOLFIN demo programs are written in reStructuredText, and converted to |
| 15 |
Python/C++ code using ``pylit``. The process for C++ demos is similar. |
| 16 |
The documented demo programs are displayed at |
| 17 |
http://fenics-dolfin.readthedocs.io/. |
| 18 |
|
| 19 |
|
| 20 |
Creating the demo program |
| 21 |
------------------------- |
| 22 |
|
| 23 |
1. Create a directory for the demo under ``demo/documented/``, |
| 24 |
e.g. ``demo/documented/foo/python/``. |
| 25 |
2. Write the demo in reStructuredText (rst), with the actual code in |
| 26 |
'code blocks' (see other demos for guidance). The demo file should |
| 27 |
be named ``demo_foo-bar.py.rst``. |
| 28 |
3. Convert the rst file to to a Python file using ``pylit`` (pylit is |
| 29 |
distributed with DOLFIN in ``utils/pylit``) |
| 30 |
|
| 31 |
.. code-block:: ruby |
| 32 |
|
| 33 |
../../../../utils/pylit/pylit.py demo_foo-bar.py.rst |
| 34 |
|
| 35 |
This will create a file ``demo_foo-bar.py``. Test that the Python |
| 36 |
script can be run. |
| 37 |
|
| 38 |
|
| 39 |
Adding the demo to the documentation system |
| 40 |
------------------------------------------- |
| 41 |
|
| 42 |
1. Add the demo to the list in ``doc/source/demos.rst``. |
| 43 |
2. To check how the documentation will be displayed on the web, in |
| 44 |
``doc/`` run ``make html`` and open the file |
| 45 |
``doc/build/html/index.html`` in a browser. |
| 46 |
|
| 47 |
|
| 48 |
Make a pull request |
| 49 |
------------------- |
| 50 |
|
| 51 |
1. Create a git branch and add the ``demo_foo-bar.py.rst`` file to the |
| 52 |
repository. Do not add the ``demo_foo-bar.py`` file. |
| 53 |
2. If there is no C++ version, edit ``test/regression/test.py`` to |
| 54 |
indicate that there is no C++ version of the demo. |
| 55 |
3. Make a pull request at |
| 56 |
https://bitbucket.org/fenics-project/dolfin/pull-requests/ for your |
| 57 |
demo to be considered for addition to DOLFIN. Add the |
| 58 |
``demo_foo-bar.py.rst`` file to the repository, but do not add the |
| 59 |
``demo_foo-bar.py`` file. |
| 60 |
|