|
1 | | -Contributing as a documentarian |
2 | | -############################### |
| 1 | +.. _contributing_documentation: |
| 2 | + |
| 3 | +Contributing to the documentation |
| 4 | +################################# |
| 5 | + |
| 6 | +.. note:: |
| 7 | + |
| 8 | + Overall guidance on contributing to the documentation of a PyAnsys repository appears in |
| 9 | + `Documenting`_ in the *PyAnsys Developer's Guide*. |
| 10 | + |
| 11 | + You must also follow the `Documentation style`_ guide to |
| 12 | + ensure that all the documentation looks the same across the project. |
| 13 | + |
| 14 | +To contribute on the documentation you must start by setting up the PyDPF-Core repository |
| 15 | +by following the steps in :ref:`contributing_as_a_developer` section. |
| 16 | + |
| 17 | +In this page you can check how to : |
3 | 18 |
|
4 | 19 | .. grid:: 1 2 3 3 |
5 | 20 | :padding: 2 2 2 2 |
6 | 21 |
|
7 | | - .. grid-item-card:: :fa:`pencil` Write documentation |
8 | | - :link: write-documentation |
| 22 | + .. grid-item-card:: :fa:`th` Structure the documentation |
| 23 | + :link: structure-documentation |
9 | 24 | :link-type: ref |
10 | 25 |
|
11 | | - Explain how to get started, use, and contribute to the project. |
| 26 | + How the documentation is structured and where to locate files. |
12 | 27 |
|
13 | | - .. grid-item-card:: :fa:`laptop-code` Add a new example |
14 | | - :link: write-examples |
| 28 | + .. grid-item-card:: :fa:`pencil` Write documentation |
| 29 | + :link: write-product-use-documentation |
15 | 30 | :link-type: ref |
16 | 31 |
|
17 | | - Showcase the capabilities of PyDPF-Core by adding a new example. |
| 32 | + Explains and showcases the use of PyDPF-Core. |
18 | 33 |
|
19 | 34 | .. grid-item-card:: :fa:`book` Build the documentation |
20 | 35 | :link: build-documentation |
21 | 36 | :link-type: ref |
22 | 37 |
|
23 | 38 | Render the documentation to see your changes reflected. |
24 | 39 |
|
25 | | -.. _write-documentation: |
| 40 | +.. _structure-documentation: |
26 | 41 |
|
27 | | -Write documentation |
28 | | -=================== |
| 42 | +Structure the documentation |
| 43 | +=========================== |
29 | 44 |
|
30 | 45 | The documentation generator used in PyDPF-Core is `Sphinx`_. Most of the documents |
31 | | -are written in `reStructuredText`_. Some parts of the documentation, like the |
32 | | -:ref:`examples <Examples>`, use a mix of `reStructuredText`_ and Python, thanks to `Sphinx-Gallery`_. |
33 | | -If you are interested in writing examples, see the :ref:`writing examples <write-examples>` |
34 | | -section. |
| 46 | +are written in `reStructuredText`_. |
35 | 47 |
|
36 | 48 | The documentation is located in the ``doc/source`` directory. The landing page |
37 | 49 | is declared in the ``doc/source/index.rst`` file. The rest of the files contain |
|
42 | 54 | The layout of the ``doc/source`` directory is reflected in the slug of the |
43 | 55 | online documentation. For example, the |
44 | 56 | ``doc/source/getting_started/contribute/documentarian.rst`` renders as |
45 | | -``https://dpf.docs.pyansys.com/getting_started/contribute/documentarian.html``. |
| 57 | +``https://dpf.docs.pyansys.com/getting_started/contribute/documentarian.html``. |
46 | 58 |
|
47 | 59 | Thus, if you create a new file, it important to follow these rules: |
48 | 60 |
|
@@ -70,38 +82,75 @@ A table of contents can be declared using a directive like this: |
70 | 82 | The path to the file is relative to the directory where the table of contents |
71 | 83 | is declared. |
72 | 84 |
|
73 | | -.. _write-examples: |
| 85 | +.. _write-product-use-documentation: |
74 | 86 |
|
75 | | -Write a new example |
| 87 | +Write documentation |
76 | 88 | =================== |
77 | 89 |
|
78 | | -The :ref:`examples <Examples>` section of the documentation showcases different |
79 | | -capabilities of PyDPF-Core. Each example (grouped into folders of related examples) |
80 | | -is a standalone Python script. Despite being ``*.py`` files, they are written in a mix |
81 | | -of `reStructuredText`_ and Python. This is possible thanks to the `Sphinx-Gallery`_ |
82 | | -Sphinx extension. |
| 90 | +Our documentation tries to follow a structure principle that respects four different functions of the documentation. |
| 91 | +Each of them fulfills a different need for people working with our tool at different times, in different circumstances. |
| 92 | + |
| 93 | +Here is an overview of how our documentation is organized to help you know where you should include your contributions. |
| 94 | +Each section has their own guidelines that must be followed when creating new content. |
| 95 | +To check these specific guidelines click on the correspondent card below. |
| 96 | + |
| 97 | +.. grid:: 1 1 2 2 |
| 98 | + :gutter: 2 |
| 99 | + :padding: 2 |
| 100 | + :margin: 2 |
83 | 101 |
|
84 | | -Documentarians writing new examples are encouraged to familiarize themselves with |
85 | | -`structuring Python scripts for Sphinx-Gallery <https://sphinx-gallery.github.io/stable/syntax.html>`_. |
86 | | -Once the ``.py`` file for a new example is properly set up, Sphinx-Gallery automatically |
87 | | -generates `Sphinx`_ `reStructuredText`_ files from it. The rendering of the resulting reST will provide |
88 | | -users with ``.ipynb`` (Jupyter notebook) and ``.py`` files of each example, which users can download. |
| 102 | + .. grid-item-card:: **TUTORIALS** |
| 103 | + :link: ref_guidelines_tutorials |
| 104 | + :link-type: ref |
| 105 | + :class-title: sd-text-center sd-bg-light |
| 106 | + :class-header: sd-text-center |
89 | 107 |
|
90 | | -Finally, here are some tips for writing examples: |
| 108 | + Learning oriented |
| 109 | + ^^^^^^^^^^^^^^^^^ |
91 | 110 |
|
92 | | -- Start the example with an explanation of the main topic. Try to use as many relevant |
93 | | - keywords as possible in this section to optimize for Search Engine Optimization. |
| 111 | + **Function:** Teach how to get started and use PYDPF-core step by step |
94 | 112 |
|
95 | | -- Include an explanation with each code cell. The explanations should |
96 | | - be included before, not after, the corresponding code. |
| 113 | + Teach how to perform a task and showcase the underlying concepts, |
| 114 | + providing detailed explanations at each stage. A tutorial is centered around a given feature. |
97 | 115 |
|
98 | | -- The examples are built with the documentation. As part of the build process, |
99 | | - screenshots of rendered graphics are inserted in the document. You do not need |
100 | | - to include the screenshots yourself. |
| 116 | + .. grid-item-card:: **EXAMPLES** |
| 117 | + :link: ref_guidelines_examples |
| 118 | + :link-type: ref |
| 119 | + :class-title: sd-text-center sd-bg-light |
| 120 | + :class-header: sd-text-center |
101 | 121 |
|
102 | | -- When creating a new folder where more than one related example will be included, ensure |
103 | | - a ``README.txt`` file is also included. This file should contain reST to be used as the header |
104 | | - for the index page corresponding to the subsection for these examples in the generated documentation. |
| 122 | + Use-cases oriented |
| 123 | + ^^^^^^^^^^^^^^^^^^ |
| 124 | + |
| 125 | + **Function:** Show how to solve specifics key problems |
| 126 | + |
| 127 | + Showcase a specific key problem or use-case with a complete PyDPF script. They are more advanced than |
| 128 | + tutorials as they present end-to-end engineering workflows and assume basic knowledge of PyDPF-Core. |
| 129 | + |
| 130 | + .. grid-item-card:: **CONCEPTS** |
| 131 | + :class-title: sd-text-center sd-bg-light |
| 132 | + :class-header: sd-text-center |
| 133 | + |
| 134 | + Understanding oriented |
| 135 | + ^^^^^^^^^^^^^^^^^^^^^^ |
| 136 | + |
| 137 | + **Function:** Provide useful theoretical explanations for PyDPF-Core |
| 138 | + |
| 139 | + Discuss and explain key DPF principles and concepts, for the reader to understand the spirit of the underlying tool. |
| 140 | + |
| 141 | + |
| 142 | + .. grid-item-card:: **API REFERENCE** |
| 143 | + :class-title: sd-text-center sd-bg-light |
| 144 | + :class-header: sd-text-center |
| 145 | + |
| 146 | + Informing oriented |
| 147 | + ^^^^^^^^^^^^^^^^^^ |
| 148 | + |
| 149 | + **Function:** Describe PyDPF-Core APIs |
| 150 | + |
| 151 | + Provides technical reference on how PyDPF-Core works and how to use it but assume basic |
| 152 | + understanding of key DPF concepts. It is generated automatically along the documentation and |
| 153 | + is based on the source code. |
105 | 154 |
|
106 | 155 | .. _build-documentation: |
107 | 156 |
|
@@ -162,3 +211,10 @@ are modified. |
162 | 211 | .. code-block:: text |
163 | 212 |
|
164 | 213 | python -m tox -e doc-html -x testenv:doc-html.setenv+="BUILD_API=false" -x testenv:doc-html.setenv+="BUILD_EXAMPLES=false" |
| 214 | +
|
| 215 | +.. toctree:: |
| 216 | + :hidden: |
| 217 | + :maxdepth: 3 |
| 218 | + |
| 219 | + guidelines_tutorials |
| 220 | + guidelines_examples |
0 commit comments