@@ -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
@@ -58,21 +57,42 @@ your project.
58
57
59
58
60
59
> “When you refer to something, make sure the direction of the reference is from the more volatile to the more stable elements”
60
+ >
61
61
> -- Cyrille Martraire, Living Documentation, 2019
62
62
63
63
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
64
+ #### Documentation cascade
65
+
66
+ Here is a simplified model of the documentation cascade for a typical Haskell project, from the most volatile to the most stable
65
67
sources:
66
68
69
+ <img src =" flow-of-documentation.png " alt =" flow of documentation " width =70% >
70
+
71
+ <details ><summary >Code for this diagram</summary >
72
+
73
+ ``` mermaid
74
+ flowchart TD
75
+ A[Docs of your project]
76
+ B[Architecture document]
77
+ C[Official specs for your domain]
78
+ D["Docs of a core library (base, text, containers, etc)"]
79
+ E[GHC Manual]
80
+ F[Official specs for what the core libraries provide]
81
+ G[Papers]
82
+
83
+ A --> B
84
+ A --> D
85
+ A --> C
86
+
87
+ D --> E
88
+ D --> F
89
+ D --> G
67
90
```
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
- ```
91
+ </details >
92
+
93
+ > The Haddocks of your library or a third-party library have a dependency on the official specs for the domain, on an architecture document,
94
+ > and on haddocks from the core libraries (` base ` , ` text ` , ` containers ` , etc.).
95
+ > The haddocks of these core libraries depend on the GHC manual, official specs for their own domain, and papers.
76
96
77
97
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
98
never refer to the project's current implementation. If you must refer to the code, point to where it's located.
@@ -91,31 +111,34 @@ The [Haddocks for the `Set` datatype](https://hackage.haskell.org/package/contai
91
111
(from the ` containers ` library) are an example of documentation which follows this model well:
92
112
93
113
* 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_ )
114
+ * They refer to the papers that have informed the design of its implementation (_ stable_ )
96
115
97
116
### Understand for whom you write
98
117
99
- This section introduces the Diátaxis Framework for documentation:
118
+ It is of utmost importance that documentation answers the needs of the users, and for that we must understand these needs.
119
+ Users need specific kinds of documentation depending on the situation they are in.
100
120
101
- <img src =" https://diataxis.fr/_images/diataxis.png " width =100% >
121
+ A common framework used for the classification of documentation is the Diátaxis Framework. It defines four types of documentation
122
+ where each are a combination of _ Acquisition_ or _ Application_ , and _ Action_ or _ Cognition_ .
102
123
103
- > -- Diátaxis Framework, by Daniele Procida, https://diataxis.fr
124
+ If a new user in need of actively acquiring some practice with the project, they can safely be pointed to the "Tutorials" part
125
+ of your documentation: it is the part that focuses on "_ Acquisition_ " of knowledge through "_ Action_ ".
126
+ The focus of the tutorial is to make a prospective user acquire basic competence in handling the software: It is an ice-breaker.
104
127
128
+ However someone who is in need of a deeper – but perhaps less immediately applicable understanding of the project –
129
+ will be better served by the Explanation, which serves the need for thought (or _ Cognition_ )
105
130
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.
131
+ Here is the quadrant:
108
132
133
+ <img src =" https://diataxis.fr/_images/diataxis.png " width =100% >
109
134
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.
135
+ > -- Diátaxis Framework, by Daniele Procida, https://diataxis.fr
115
136
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
137
138
+ Diátaxis maps out the entire life cycle of one’s interaction with a system.
139
+
140
+ But is not just about filling out all the quadrants like a checklist (although they are all good to have!).
141
+ Instead, it is about understanding how each section focuses on a particular combination of user needs and situations.
119
142
120
143
In short, the message of Diátaxis is that you are not meant to write The One Documentation that covers everything —
121
144
inevitably, this produces documentation which is shallow due to its breadth. Instead, focus on the strategic aspects of your documentation,
0 commit comments