Skip to content

Commit a3215df

Browse files
committed
Re-org for images
1 parent cf9c2e5 commit a3215df

File tree

3 files changed

+65
-29
lines changed

3 files changed

+65
-29
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Once you have cloned this repository, run `npm install` and `npm run abridge` to
1616

1717
#### Name
1818

19-
Blog posts are located in the `content` directory, as markdown files. The files themselves start with the (expected) date of publication
20-
and contain their title in a "slug" format (alphanumeric characters, words separated by a hyphen, all lowercase):
19+
Blog posts are located in the `content` directory, as markdown files. The files themselves contain
20+
their title in a "slug" format (alphanumeric characters, words separated by a hyphen, all lowercase):
2121

2222
```
23-
2024-08-03-documentation-best-practices.md
23+
documentation-best-practices.md
2424
```
2525

2626
#### Front-matter
@@ -45,6 +45,19 @@ You can manually delimit where it ends by inserting `<!-- more -->` on a newline
4545

4646
Otherwise, in the absence of this comment, the first 150 characters will be used by Zola
4747

48+
#### Images and other files
49+
50+
If you want to add images to your blog post, create a folder named after the blog post, and write the content of the post to an `index.md`
51+
file within it. Put your associated files in the same directory.
52+
53+
For instance:
54+
55+
```
56+
documentation-best-practices
57+
├── flow-of-documentation.png
58+
└── index.md
59+
```
60+
4861
### Local preview
4962

5063
Run `zola serve --drafts` in order to serve the website and automatically render it when files change.
38.2 KB
Loading

content/2024-08-03-documentation-best-practices.md renamed to content/documentation-best-practices/index.md

Lines changed: 49 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ why a behaviour or a pattern exists, future maintainers might be tempted to drop
3636
Not all types of documentation have the same life cycle. Different pieces of documentation are more or less stable, and this determines
3737
which can act as a conceptual and theoretical foundation for your project.
3838

39-
Examples of stable documentation include:
39+
#### Stable documentation
4040

4141
* A README without code
4242
* A vision statement
@@ -45,8 +45,7 @@ Examples of stable documentation include:
4545
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.
4646
While it is normal to fiddle around with the boundaries of your project at the beginning, in general these should change infrequently.
4747

48-
Some other documentation is called volatile, like:
49-
48+
#### Volatile documentation
5049
* Documentation generated at runtime
5150
* Code examples
5251
* Tests
@@ -58,21 +57,42 @@ your project.
5857

5958

6059
> “When you refer to something, make sure the direction of the reference is from the more volatile to the more stable elements”
60+
>
6161
> -- Cyrille Martraire, Living Documentation, 2019
6262
6363

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
6567
sources:
6668

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
6790
```
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.
7696
7797
Keep in mind that while the Haddocks of a project can refer to the project specs, or to an architecture document, these documents should
7898
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
91111
(from the `containers` library) are an example of documentation which follows this model well:
92112

93113
* 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_)
96115

97116
### Understand for whom you write
98117

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.
100120

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_.
102123

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.
104127

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_)
105130

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:
108132

133+
<img src="https://diataxis.fr/_images/diataxis.png" width=100%>
109134

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
115136
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_)
118137

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.
119142

120143
In short, the message of Diátaxis is that you are not meant to write The One Documentation that covers everything —
121144
inevitably, this produces documentation which is shallow due to its breadth. Instead, focus on the strategic aspects of your documentation,

0 commit comments

Comments
 (0)