|
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). |
2 | 2 |
|
3 |
| -# Website content |
| 3 | +# Website Content |
4 | 4 |
|
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). |
6 | 6 |
|
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: |
9 | 8 |
|
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)) |
11 | 13 |
|
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. |
13 | 15 |
|
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: |
15 | 23 |
|
16 | 24 | ```javascript
|
17 | 25 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
|
18 | 26 | const sidebars = {
|
19 |
| - |
20 | 27 | ...
|
21 |
| - |
22 |
| - for_developers: [ |
| 28 | + reference: [ |
23 | 29 | { type: 'category',
|
24 |
| - label: 'For Developers', |
| 30 | + label: 'Reference', |
25 | 31 | 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 | + ... |
30 | 35 | ]
|
31 |
| - |
| 36 | + } |
| 37 | + ] |
32 | 38 | ...
|
| 39 | +}; |
33 | 40 | ```
|
34 | 41 |
|
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. |
36 | 43 |
|
37 | 44 | # Building the website
|
38 | 45 |
|
39 |
| -To install the packages required to build the documentation site run: |
| 46 | +To install the required packages for the documentation site, run: |
40 | 47 |
|
41 | 48 | ```
|
42 | 49 | $ yarn
|
43 | 50 | ```
|
44 | 51 |
|
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: |
47 | 53 |
|
48 | 54 | ```
|
49 | 55 | $ yarn start
|
50 | 56 | ```
|
51 | 57 |
|
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. |
53 | 59 |
|
54 | 60 | ## Build
|
55 | 61 |
|
| 62 | +To generate static content: |
| 63 | + |
56 | 64 | ```
|
57 | 65 | $ yarn build
|
58 | 66 | ```
|
59 | 67 |
|
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. |
61 | 69 |
|
62 | 70 | ## Deployment
|
63 | 71 |
|
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). |
0 commit comments