|
| 1 | +.. _documenting-content: |
| 2 | + |
| 3 | +*************************** |
| 4 | +Documentation content guide |
| 5 | +*************************** |
| 6 | + |
| 7 | +These guidelines aim to improve the consistency, cohesiveness, and organization of the |
| 8 | +:ref: documentation concerning using the library by broadly articulating the intended purpose, |
| 9 | +scope, and audience of each of the following sections: |
| 10 | + |
| 11 | +:ref:`plot_types` |
| 12 | + | Summary of chart types that are implemented as high-level API |
| 13 | +
|
| 14 | +:ref:`User guide <users-guide-index>` |
| 15 | + | Explanations of features, components, and architecture. |
| 16 | +
|
| 17 | +:ref:`tutorials` |
| 18 | + | Lessons on developing visualizations |
| 19 | +
|
| 20 | +:ref:`examples-index` |
| 21 | + | Demonstrations of specific library features |
| 22 | +
|
| 23 | +:ref:`api-reference` |
| 24 | + | Descriptions of the public modules, objects, methods, and functions. |
| 25 | +
|
| 26 | + |
| 27 | +.. note:: |
| 28 | + |
| 29 | + While parts of the current documentation may not yet align with these guidelines, |
| 30 | + we expect that new documentation contributions will also bring existing documentation |
| 31 | + into alignment. |
| 32 | + |
| 33 | + .. note: based on note in https://matplotlib.org/3.7.3/devel/coding_guide.html |
| 34 | +
|
| 35 | +Audience |
| 36 | +======== |
| 37 | + |
| 38 | +The Matplotlib audience encompasses a wide spectrum of readers, from users who are first |
| 39 | +getting introduced to using Matplotlib through the documentation to experienced developers |
| 40 | +who want to make something extremely customized. Instead of trying to write for the |
| 41 | +entire spectrum, each document should identify its band so that reader can assess |
| 42 | +whether the document is appropriate for them. The documentation should generally use the |
| 43 | +leveling of :doc:`tags <tag_glossary>` and :ref:`issues <new_contributors>`, meaning |
| 44 | +that the audienced is identified based on how much contextual understanding of |
| 45 | +Matplotlib is a pre-requisite for following along with the document. |
| 46 | + |
| 47 | +Documents can communicate this leveling through :doc:`tags <tag_guidelines>`, their |
| 48 | +location in the docs, and in text as appropriate. For example: |
| 49 | + |
| 50 | + This guide assumes that the reader understands the general concept of Artists, as |
| 51 | + explained in :doc:`../users/explain/artists/artist_intro` |
| 52 | + |
| 53 | + |
| 54 | +Scope |
| 55 | +===== |
| 56 | +Many concepts in Matplotlib assume a grounding in visualization, statistics, Python |
| 57 | +programming, and other topics to understand how they work. These concepts should be |
| 58 | +contextualized using common terminology, but the focus for all documents should not |
| 59 | +stray from the Matplotlib topic. For example: |
| 60 | + |
| 61 | + Some of the path components require multiple vertices to specify them: for example |
| 62 | + CURVE 3 is a `Bézier curve <https://en.wikipedia.org/wiki/B%C3%A9zier_curve>`_ with |
| 63 | + one control point and one end point, and CURVE4 has three vertices for the two |
| 64 | + control points and the end point. The example below shows a CURVE4 Bézier spline -- |
| 65 | + the Bézier curve will be contained in the convex hull of the start point, the two |
| 66 | + control points, and the end point |
| 67 | + |
| 68 | + |
| 69 | +This explanation of drawing a curve using control points from :ref:`paths` never |
| 70 | +explicitly defines a *Bézier curve*, instead linking out to an external |
| 71 | +reference. This explanation is written in a manner where the definition of |
| 72 | +*Bézier curve* can be inferred from context and also understanding is not harmed if the |
| 73 | +reader does not infer the definition. |
| 74 | + |
| 75 | + |
| 76 | +Guidelines |
| 77 | +========== |
| 78 | + |
| 79 | +This content guide is heavily influenced by the `Diátaxis <https://diataxis.fr/>`_ |
| 80 | +framework for technical documentation; this framework proposes that all technical |
| 81 | +documentation is roughly one of 4 types - tutorials, how-to-guides, |
| 82 | +technical reference, and explanation - and that the appropriate type is determined |
| 83 | +by whether *what* is x? (cognition) vs *how* to do x?(action) is being documented, and |
| 84 | +whether the document's purpose is *acquiring* (learning) or *applying* (using) skills. |
| 85 | +Broadly, our documentation as viewed through a diátaxis lens: |
| 86 | + |
| 87 | +.. list-table:: |
| 88 | + :header-rows: 1 |
| 89 | + :widths: 20 30 20 30 |
| 90 | + |
| 91 | + * - section |
| 92 | + - goal |
| 93 | + - type |
| 94 | + - example |
| 95 | + * - :ref:`plot_types` |
| 96 | + - View available chart types. |
| 97 | + - | `Reference <https://diataxis.fr/reference/>`_ |
| 98 | + | what, use |
| 99 | + - :ref:`sphx_glr_plot_types_stats_pie.py` |
| 100 | + * - :ref:`User guide <users-guide-index>` |
| 101 | + - Understand features, components, and architecture |
| 102 | + - | `Explanation <https://diataxis.fr/explanation/>`_ |
| 103 | + | what, learn |
| 104 | + - :ref:`annotations` |
| 105 | + * - :ref:`tutorials` |
| 106 | + - Work through the stages of building a visualization. |
| 107 | + - | `Tutorials <https://diataxis.fr/tutorials/>`_ |
| 108 | + | how, learn |
| 109 | + - :ref:`pie_donut_labels` |
| 110 | + * - :ref:`examples-index` |
| 111 | + - Execute a visualization task. |
| 112 | + - | `How-to guides <https://diataxis.fr/how-to-guides/>`_ |
| 113 | + | how, use |
| 114 | + - :ref:`sphx_glr_gallery_text_labels_and_annotations_rainbow_text.py` |
| 115 | + * - :ref:`api-reference` |
| 116 | + - Look up the input/output/behavior of public API. |
| 117 | + - | `Reference <https://diataxis.fr/reference/>`_ |
| 118 | + | what, use |
| 119 | + - `.Axes.annotate` |
| 120 | + |
| 121 | +Detailed guidelines for each section are documented at their respective pages: |
| 122 | + |
| 123 | +.. toctree:: |
| 124 | + |
| 125 | + plot_types |
| 126 | + user_guide |
| 127 | + tutorials |
| 128 | + examples |
| 129 | + api |
0 commit comments