Skip to content

Commit b737ed2

Browse files
committed
Prepare the blog
0 parents  commit b737ed2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1944
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
if: github.ref != 'refs/heads/main'
10+
steps:
11+
- name: 'Checkout'
12+
uses: actions/checkout@main
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
- run: npm install
17+
- run: npm run abridge
18+
- name: 'Build only'
19+
uses: shalzz/[email protected]
20+
env:
21+
BUILD_DIR: .
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
BUILD_ONLY: true
24+
25+
build_and_deploy:
26+
runs-on: ubuntu-latest
27+
if: github.ref == 'refs/heads/main'
28+
steps:
29+
- name: 'Checkout'
30+
uses: actions/checkout@main
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: 20
34+
- run: npm install
35+
- run: npm run abridge
36+
- name: 'Build and deploy'
37+
uses: shalzz/[email protected]
38+
env:
39+
PAGES_BRANCH: gh-pages
40+
BUILD_DIR: .
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.env
2+
public
3+
themes
4+
build
5+
storage
6+
node_modules
7+
package-lock.json
8+
static/demo.html
9+
static/tinysearch_engine.js
10+
static/tinysearch_engine.d.ts
11+
static/tinysearch_engine_bg.wasm.d.ts
12+
static/package.json
13+
static/js/pagefind.*.pf_meta
14+
static/js/index
15+
static/js/fragment

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blog.haskell.org

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Haskell Blog
2+
3+
## Local installation
4+
5+
The blog is made with [Zola], based on the [Abridge theme].
6+
7+
You will need:
8+
* The `zola` binary v0.19.1 or higher
9+
* `npm`
10+
11+
Once you have cloned this repository, run `npm install` and `npm run abridge` to initialise the front-end features like full-text search.
12+
13+
## Contribute content
14+
15+
### Blog post structure
16+
17+
#### Name
18+
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):
21+
22+
```
23+
2024-08-03-documentation-best-practices.md
24+
```
25+
26+
#### Front-matter
27+
28+
The file itself must contain a front-matter in TOML format that has the following properties:
29+
30+
```
31+
+++
32+
title = "Title of the post"
33+
date = YYYY-MM-DD
34+
[taxonomies]
35+
authors = ["Author's Name"] # The author's name. Will be indexed.
36+
categories = ["Haddock"] # A minima should be the name of the team ("Haddock", "HLS", "Cabal"). Will be indexed.
37+
tags = ["Practices"] # Something more precise like "Release", "Practice", "JavaScript", can be aded. Will be indexed.
38+
+++
39+
```
40+
41+
#### Summary
42+
43+
The eye-catcher that you wish to show on the front-page of the blog is the first paragraph.
44+
You can manually delimit where it ends by inserting `<!-- more -->` on a newline between this paragraph and the rest of the content.
45+
46+
Otherwise, in the absence of this comment, the first 150 characters will be used by Zola
47+
48+
### Local preview
49+
50+
Run `zola serve --drafts` in order to serve the website and automatically render it when files change.
51+
52+
[Zola]: https://www.getzola.org/
53+
[Abridge theme]: https://abridge.pages.dev/overview-abridge/

config.toml

Lines changed: 311 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
+++
2+
title = "Documentation Best Practices"
3+
date = 2024-08-02
4+
[taxonomies]
5+
authors = ["Hécate"]
6+
categories = ["Haddock"]
7+
tags = ["Practices"]
8+
+++
9+
10+
In the Haddock team, part of our mission is to help with writing documentation, and promoting best practices. This article will help you write the best documentation you can!
11+
12+
<!-- more -->
13+
14+
We adapt documentation outside practices to our ecosystem, and leverage our own technologies to empower Haskell users with their documentation work.
15+
16+
Let us see some of these techniques, and how the Haddock team can be of help.
17+
18+
## Writing documentation for your software project
19+
20+
### Justify yourself
21+
22+
When you create software, there is a pipeline from your brain straight to your code. Your decisions — such as the libraries you’ve used,
23+
or your program architecture — shape how your code is structured and written.
24+
25+
Unfortunately, simply writing the code isn’t enough.The reasoning behind the decisions you made is as important as the decisions themselves. In the short term, solving a problem may let you move ahead immediately, but what keeps you on the correct path is understanding what
26+
brought you to that solution.
27+
28+
Indeed, your choices may not be as popular as you think they are! Of course, you decided on them because you already convinced yourself
29+
that they’re best. But you have a user base to convince as well, and they may not see things the same way you do.
30+
31+
As such, it is vitally important to document which decisions you made and to justify why you made them. If it’s not immediately obvious
32+
why a behaviour or a pattern exists, future maintainers might be tempted to drop it — only to discover too late why it was needed.
33+
34+
### The reference flow of documentation
35+
36+
Not all types of documentation have the same life cycle. Different pieces of documentation are more or less stable, and this determines
37+
which can act as a conceptual and theoretical foundation for your project.
38+
39+
Examples of stable documentation include:
40+
41+
* A README without code
42+
* A vision statement
43+
* The value proposition and the core domain
44+
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+
While it is normal to fiddle around with the boundaries of your project at the beginning, in general these should change infrequently.
47+
48+
Some other documentation is called volatile, like:
49+
50+
* Documentation generated at runtime
51+
* Code examples
52+
* Tests
53+
* Configuration
54+
55+
These are *expected* to change frequently, as your project changes, your API evolves, and you change configuration options.
56+
Volatile documentation is expensive to maintain, but also very valuable, as it shows in a concrete way how the user can interact with
57+
your project.
58+
59+
60+
> “When you refer to something, make sure the direction of the reference is from the more volatile to the more stable elements”
61+
> -- Cyrille Martraire, Living Documentation, 2019
62+
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
65+
sources:
66+
67+
```
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+
```
76+
77+
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+
never refer to the project's current implementation. If you must refer to the code, point to where it's located.
79+
The (current, volatile) code cannot be the justification for the (planned, stable) architecture.
80+
81+
The GHC manual is much more stable than the haddocks of a Core library, which is why documentation should flow from
82+
the library to the manual.
83+
84+
Finally, papers serve the same purpose as architecture documents, where they describe techniques that may be implemented,
85+
but theyshould not point to code that is subject to change – lest they point to a library that has evolved so much
86+
that it no longer relates to the paper.
87+
88+
#### Example: The Set data structure
89+
90+
The [Haddocks for the `Set` datatype](https://hackage.haskell.org/package/containers-0.6.5.1/docs/Data-Set.html)
91+
(from the `containers` library) are an example of documentation which follows this model well:
92+
93+
* 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_)
96+
97+
### Understand for whom you write
98+
99+
This section introduces the Diátaxis Framework for documentation:
100+
101+
<img src="https://diataxis.fr/_images/diataxis.png" width=100%>
102+
103+
> -- Diátaxis Framework, by Daniele Procida, https://diataxis.fr
104+
105+
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.
108+
109+
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.
115+
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+
119+
120+
In short, the message of Diátaxis is that you are not meant to write The One Documentation that covers everything —
121+
inevitably, this produces documentation which is shallow due to its breadth. Instead, focus on the strategic aspects of your documentation,
122+
and you will produce documentation of better quality, with a clear purpose that it can fulfill more easily.
123+
124+
Through the lens of Diátaxis, the module API documentation produced by Haddock is a *Reference*.
125+
126+
## Reach Out
127+
128+
Should you need any help in writing or proof-reading documentation, please stop by the [Matrix chatroom](https://matrix.to/#/#haddock:matrix.org) of the Haddock team,
129+
or ping us with the [@haddock](https://gitlab.haskell.org/groups/haddock/-/group_members?sort=last_joined) group tag on the
130+
[Haskell Gitlab](https://gitlab.haskell.org/). We would be more than happy to lend you a hand and discuss how to best serve your users,
131+
you included.
132+
133+
## Read More
134+
135+
* [Haddock manual](https://haskell-haddock.readthedocs.io/latest/)
136+
* [The theory behind Diátaxis](https://diataxis.fr/theory/)
137+
* [How to contribute to Haddock](https://gitlab.haskell.org/ghc/ghc/-/blob/master/utils/haddock/CONTRIBUTING.md?ref_type=heads)

content/_index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
+++
2+
paginate_by = 3
3+
sort_by = "date"
4+
template = "index.html"
5+
+++

content/archive/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+++
2+
template = "archive.html"
3+
4+
[extra]
5+
sec = ""
6+
+++

content/pages/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
+++
2+
render = false
3+
+++

content/pages/about.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
+++
2+
title = "About this blog"
3+
path = "about"
4+
template = "pages.html"
5+
draft = false
6+
+++
7+
8+
## About this blog
9+
10+
Welcome to the Haskell Project's blog!
11+
12+
This is the place where the various teams that power the language and its ecosystem communicate about their progress, innovations,
13+
and new releases.
14+
15+
The Haskell.org Committee is the publisher of this website. Please contact us at `committee <at> haskell <dot> org` if you wish to
16+
signal content that goes against our [Guidelines For Respectful Communication](https://haskell.foundation/guidelines-for-respectful-communication/).

0 commit comments

Comments
 (0)