@@ -36,7 +36,7 @@ why a behaviour or a pattern exists, future maintainers might be tempted to drop
36
36
Not all types of documentation have the same life cycle. Different pieces of documentation are more or less stable, and this determines
37
37
which can act as a conceptual and theoretical foundation for your project.
38
38
39
- Examples of stable documentation include:
39
+ #### Stable documentation
40
40
41
41
* A README without code
42
42
* A vision statement
@@ -45,8 +45,7 @@ Examples of stable documentation include:
45
45
These ought not to change much, because they describe the basic problems that your code aims to address, solve or support in the long run.
46
46
While it is normal to fiddle around with the boundaries of your project at the beginning, in general these should change infrequently.
47
47
48
- Some other documentation is called volatile, like:
49
-
48
+ #### Volatile documentation
50
49
* Documentation generated at runtime
51
50
* Code examples
52
51
* Tests
@@ -61,18 +60,38 @@ your project.
61
60
> -- Cyrille Martraire, Living Documentation, 2019
62
61
63
62
64
- As such, here is a simplified model of the documentation cascade for a typical Haskell project, from the most volatile to the most stable
63
+ #### Documentation cascade
64
+
65
+ Here is a simplified model of the documentation cascade for a typical Haskell project, from the most volatile to the most stable
65
66
sources:
66
67
68
+ <img src =" flow-of-documentation.png " alt =" flow of documentation " width =70% >
69
+
70
+ <details ><summary >Code for this diagram</summary >
71
+
72
+ ``` mermaid
73
+ flowchart TD
74
+ A[Docs of your project]
75
+ B[Architecture document]
76
+ C[Official specs for your domain]
77
+ D["Docs of a core library (base, text, containers, etc)"]
78
+ E[GHC Manual]
79
+ F[Official specs for what the core libraries provide]
80
+ G[Papers]
81
+
82
+ A --> B
83
+ A --> D
84
+ A --> C
85
+
86
+ D --> E
87
+ D --> F
88
+ D --> G
67
89
```
68
- Haddocks of your library or a third-party library
69
- ├──> Official specs for your domain
70
- ├──> Architecture Document
71
- └─┬> Haddocks of a core library (base, text, vector, etc)
72
- ├──> GHC Manual
73
- ├──> Official specs for what the core libs provide
74
- └──> Papers (without paywalls)
75
- ```
90
+ </details >
91
+
92
+ > The Haddocks of your library or a third-party library have a dependency on the official specs for the domain, on an architecture document,
93
+ > and on haddocks from the core libraries (` base ` , ` text ` , ` containers ` , etc.).
94
+ > The haddocks of these core libraries depend on the GHC manual, official specs for their own domain, and papers.
76
95
77
96
Keep in mind that while the Haddocks of a project can refer to the project specs, or to an architecture document, these documents should
78
97
never refer to the project's current implementation. If you must refer to the code, point to where it's located.
@@ -91,31 +110,34 @@ The [Haddocks for the `Set` datatype](https://hackage.haskell.org/package/contai
91
110
(from the ` containers ` library) are an example of documentation which follows this model well:
92
111
93
112
* They point to an overview of the API ([ here] ( https://haskell-containers.readthedocs.io/en/latest/set.html ) : _ volatile_ )
94
- * They refer to the papers that have informed the design of its implementation: the absence of working links may be annoying,
95
- but the references can still be followed (_ stable_ )
113
+ * They refer to the papers that have informed the design of its implementation (_ stable_ )
96
114
97
115
### Understand for whom you write
98
116
99
- This section introduces the Diátaxis Framework for documentation:
117
+ It is of utmost importance that documentation answers the needs of the users, and for that we must understand these needs.
118
+ Users need specific kinds of documentation depending on the situation they are in.
100
119
101
- <img src =" https://diataxis.fr/_images/diataxis.png " width =100% >
120
+ A common framework used for the classification of documentation is the Diátaxis Framework. It defines four types of documentation
121
+ where each are a combination of _ Acquisition_ or _ Application_ , and _ Action_ or _ Cognition_ .
102
122
103
- > -- Diátaxis Framework, by Daniele Procida, https://diataxis.fr
123
+ If a new user in need of actively acquiring some practice with the project, they can safely be pointed to the "Tutorials" part
124
+ of your documentation: it is the part that focuses on "_ Acquisition_ " of knowledge through "_ Action_ ".
125
+ The focus of the tutorial is to make a prospective user acquire basic competence in handling the software: It is an ice-breaker.
104
126
127
+ However someone who is in need of a deeper – but perhaps less immediately applicable understanding of the project –
128
+ will be better served by the Explanation, which serves the need for thought (or _ Cognition_ )
105
129
106
- Diátaxis maps out the entire life cycle of one’s interaction with a system. Each of its four quadrants describes a different
107
- situation in which a user may find themselves.
130
+ Here is the quadrant:
108
131
132
+ <img src =" https://diataxis.fr/_images/diataxis.png " width =100% >
109
133
110
- Diátaxis is not just about filling out all the quadrants like a checklist (although they are all good to have!).
111
- Instead, it is about understanding how each section focusses on a particular combination of user needs and situations.
112
- If a new user in need of actively acquiring some practice with the project, they can safely be pointed to the "Tutorials" part
113
- of your documentation, as it is the part that focuses on "_ Acquisition_ " of knowledge through "_ Action_ ".
114
- The focus of the tutorial is to make a prospective user acquire basic competence in handling the software. It is an ice-breaker.
134
+ > -- Diátaxis Framework, by Daniele Procida, https://diataxis.fr
115
135
116
- However someone who is in need of a deeper – but perhaps less immediately applicable understanding of the project –
117
- will be better served by the Explanation, which serves the need for thought (or _ Cognition_ )
118
136
137
+ Diátaxis maps out the entire life cycle of one’s interaction with a system.
138
+
139
+ But is not just about filling out all the quadrants like a checklist (although they are all good to have!).
140
+ Instead, it is about understanding how each section focuses on a particular combination of user needs and situations.
119
141
120
142
In short, the message of Diátaxis is that you are not meant to write The One Documentation that covers everything —
121
143
inevitably, this produces documentation which is shallow due to its breadth. Instead, focus on the strategic aspects of your documentation,
0 commit comments