Skip to content

Commit 1ea373f

Browse files
authored
Add Diataxis structure to our documentation (#1632)
The current documentation site contains a mix of documents without a clear structure, making it difficult to navigate and onboard new users. This PR takes the first step toward improving organization by adopting the [Diátaxis framework](https://diataxis.fr/). Existing documents have been reorganized into four categories: Tutorials, How-To Guides, Reference, and Explanation. The new structure is based on the [following roadmap](https://hackmd.io/UVd1tfaVQtOrHcK2xnPZaQ), co-authored with @jasagredo. [This issue](#1631) encompasses the entire documentation reorganization process. The goal is to consistently add content to the documentation site by allocating a fixed number of hours per week (eg 4) to this task.
2 parents 2b24a97 + c12a74a commit 1ea373f

File tree

73 files changed

+304
-393
lines changed

Some content is hidden

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

73 files changed

+304
-393
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ EOF
9090

9191
An alternative to using `nix` is to set up the development
9292
environment yourself. Follow [these
93-
instructions](https://developers.cardano.org/docs/get-started/cardano-node/installing-cardano-node/)
93+
instructions](https://developers.cardano.org/docs/operate-a-stake-pool/node-operations/installing-cardano-node/#building-via-cabal)
9494
to properly configure your system.
9595

9696
# Building the project
@@ -181,12 +181,11 @@ This section contain guidelines on what to check when making a pull request.
181181
- When bumping version bounds on the dependencies *it is not necessary* to
182182
increase the package version number. See [this
183183
section](#updating-the-dependencies-bounds).
184-
- When you want to create a changelog entry, follow [this and the following
185-
section](docs/website/contents/for-developers/ReleaseProcess.md#installing-scriv).
184+
- When you want to create a changelog entry, follow [this and the following section](docs/website/contents/howtos/contributing/how_to_make_a_release.md#installing-scriv).
186185

187186
## Following our git process
188187

189-
Our [git process](docs/website/contents/for-developers/GitProcess.md) describes
188+
Our [git process](docs/website/contents/howtos/contributing/consensus_git_process.md) describes
190189
the `git` practices we encourage when working with the code in this repository.
191190

192191
## Updating the documentation
@@ -197,7 +196,7 @@ documentation (see [this section](#documentation)).
197196
## Following the style guide
198197

199198
We have a [Haskell style
200-
guide](docs/website/contents/for-developers/StyleGuide.md) that should be
199+
guide](docs/website/contents/howtos/contributing/style_guide.md) that should be
201200
followed when writing code in Consensus. Our style guide is not set in stone,
202201
and improvements are always welcome.
203202

@@ -252,12 +251,12 @@ frustrations later on in the process.
252251

253252
We maintain a changelog. If your pull request requires a changelog entry, please
254253
follow [these
255-
instructions](docs/website/contents/for-developers/ReleaseProcess.md#adding-a-changelog-fragment).
254+
instructions](docs/website/contents/howtos/contributing/how_to_make_a_release.md#adding-a-changelog-fragment).
256255
Even if your change doesn't require a changelog fragment, create an empty one as
257256
CI will reject your change otherwise. We made this choice to ensure authors of
258257
PRs would always take a moment to consider whether a changelog fragment should
259258
be added for their PR. For more information see [our release
260-
process](docs/website/contents/for-developers/ReleaseProcess.md).
259+
process](docs/website/contents/howtos/contributing/how_to_make_a_release.md).
261260

262261
When creating a pull-request (PR), it is **crucial** that the PR:
263262

docs/website/README.md

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,72 @@
1-
The website for `ouroboros-consensus` is generated using [docusaurus](https://docusaurus.io/). If you want to build and view the generated website see Section [_Building the website_](#building-the-website).
1+
The website for `ouroboros-consensus` is generated using [Docusaurus](https://docusaurus.io/). To build and view the generated website, see [_Building the website_](#building-the-website).
22

3-
# Website content
3+
# Website Content
44

5-
The website source pages can be found in the [`contents`](./contents) directory. We divide our pages into two main categories:
5+
The front page is defined in the [`index.js`](src/components/HomepageFeatures/index.js) file. The main sections are configured in [`docusaurus.config.js`](./docusaurus.config.js).
66

7-
- "About Ouroboros", which contains high-level information about the Consensus protocols that the code in this repository implements. The pages for this category should be placed in the [`contents/about-ouroboros`](./contents/about-ouroboros) directory.
8-
- "For Developers", which contains information relevant for contributors to the Consensus code base. The pages for this category should be placed in the [`contents/for-developers`](./contents/for-developers) directory.
7+
The website's source pages are located in the [`contents`](./contents) directory. In accordance with the [Diátaxis framework](https://diataxis.fr/) for organizing technical documentation, we categorize our pages into four sections:
98

10-
The pages are written in Markdown format.
9+
- **Explanations** ([`contents/explanations`](./contents/explanations))
10+
- **Tutorials** ([`contents/tutorials`](./contents/tutorials))
11+
- **HOWTOs** ([`contents/howtos`](./contents/howtos))
12+
- **Reference** ([`contents/reference`](./contents/references))
1113

12-
## Adding a new page
14+
Refer to the [Diátaxis framework](https://diataxis.fr/) for guidance on the type of documentation that belongs in each section.
1315

14-
To add a new page create a Markdown file inside the appropriate directory (either [`contents/about-ouroboros`](./contents/about-ouroboros) or [`contents/for-developers`](./contents/for-developers) depending on the category). Then edit the [`sidebars.js`](./sidebars.js) file and add a reference to the new page in the desired place inside the sidebar item's configuration. For instance, if you add a new page `for-developers/foo.md`, Docusaurus will generate a reference called `for-developers/foo`, which can be used to add an entry to the sidebar as follows:
16+
All pages are written in Markdown format.
17+
18+
## Adding a New Page
19+
20+
To add a new page, create a Markdown file inside the appropriate directory (e.g., [`contents/explanations`](./contents/explanations)), based on the Diátaxis category the page belongs to.
21+
22+
Next, update [`sidebars.js`](./sidebars.js) and add a reference to the new page in the sidebar configuration. For example, if you add `reference/foo.md`, Docusaurus will generate a reference called `reference/foo`, which can be added to the sidebar as follows:
1523

1624
```javascript
1725
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
1826
const sidebars = {
19-
2027
...
21-
22-
for_developers: [
28+
reference: [
2329
{ type: 'category',
24-
label: 'For Developers',
30+
label: 'Reference',
2531
items: [
26-
'for-developers/index',
27-
'for-developers/ComponentDiagram',
28-
'for-developers/foo', // <--- Your new page
29-
'for-developers/ChainSync',
32+
'reference/index',
33+
'reference/foo', // <--- Your new page
34+
...
3035
]
31-
36+
}
37+
]
3238
...
39+
};
3340
```
3441

35-
The order of the page in the `items` list determines the order in which this entry will appear in the sidebar. See [`sidebars.js`](./sidebars.js) for the rationale behind not autogenerating this.
42+
The order of entries in the `items` list determines their placement in the sidebar. Refer to [`sidebars.js`](./sidebars.js) for the rationale behind manual sidebar configuration.
3643

3744
# Building the website
3845

39-
To install the packages required to build the documentation site run:
46+
To install the required packages for the documentation site, run:
4047

4148
```
4249
$ yarn
4350
```
4451

45-
After the necessary packages are installed by the above command, the
46-
documentation site can be built by running:
52+
After installation, build the documentation site by running:
4753

4854
```
4955
$ yarn start
5056
```
5157

52-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
58+
This starts a local development server and opens a browser window. Most changes are reflected live without needing to restart the server.
5359

5460
## Build
5561

62+
To generate static content:
63+
5664
```
5765
$ yarn build
5866
```
5967

60-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
68+
This command outputs the static content into the build directory, which can be hosted using any static content hosting service.
6169

6270
## Deployment
6371

64-
We deploy the website using a GitHub action. See [`.github/workflows/ci.yml`](../../.github/workflows/ci.yml).
72+
The website is deployed using a GitHub Action. See [`.github/workflows/ci.yml`](../../.github/workflows/ci.yml).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Consensus Protocol
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Design Goals
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Epoch Boundary Blocks
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Cardano Genesis
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Introduction
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Interaction with the Ledger Layer
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Managing Updates
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Mempool

0 commit comments

Comments
 (0)