Skip to content

Commit

Permalink
Docs-related Docs (#5103)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansermino authored Jan 8, 2025
1 parent 1591641 commit f0e6cd4
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 11 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ forward to your contributions. 🎉
## I Have a Question

> If you want to ask a question, we assume that you have read the available
> [Documentation](https://forest-docs-v2.pages.dev/).
> [Documentation](https://docs.forest.chainsafe.io/).
Before you ask a question, it is best to search for existing
[Issues](https://github.com/ChainSafe/forest/issues) or
Expand Down Expand Up @@ -82,7 +82,7 @@ steps in advance to help us fix any potential bug as fast as possible.
- Make sure that you are using the latest version.
- Determine if your bug is really a bug and not an error on your side e.g. using
incompatible environment components/versions (Make sure that you have read the
[documentation](https://forest-docs-v2.pages.dev/). If you are looking for
[documentation](https://docs.forest.chainsafe.io/). If you are looking for
support, you might want to check [this section](#i-have-a-question)).
- To see if other users have experienced (and potentially already solved) the
same issue you are having, check if there is not already a bug report existing
Expand Down Expand Up @@ -143,7 +143,7 @@ community to understand your suggestion and find related suggestions.
#### 🎯 Before Submitting an Enhancement

- Make sure that you are using the latest version.
- Read the [documentation](https://forest-docs-v2.pages.dev/) carefully and find
- Read the [documentation](https://docs.forest.chainsafe.io/) carefully and find
out if the functionality is already covered, maybe by an individual
configuration.
- Perform a [search](https://github.com/ChainSafe/forest/issues) to see if the
Expand Down Expand Up @@ -225,7 +225,7 @@ eternally grateful and hope you will continue to contribute to the project.
### 📚 Improving The Documentation

The documentation is currently hosted on
[forest-docs-v2.pages.dev](https://forest-docs-v2.pages.dev/). If you find any
[docs.forest.chainsafe.io](https://docs.forest.chainsafe.io/). If you find any
issues with the documentation, please create an issue as the repository is not
public yet.

Expand Down
67 changes: 60 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,85 @@

This directory contains a Docusaurus documentation website for both user and developer documentation.

## Getting Started

> Note: This project uses [Yarn](https://yarnpkg.com/getting-started/install)
### Installation

Install the required dependencies:

```
$ yarn
```

### Local Development

Start local development server:

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
### Build

### Spellcheck
To compile an optimized production build:

```
yarn spellcheck
$ yarn build
```

You can add unknown words to `dictionary.txt`.
### CI Checks

### Build
These commands are recommended to run before commiting code. They are run as checks in CI.

```
$ yarn build
yarn spellcheck # Checks spelling
yarn format # Run prettier to fix formatting issues
yarn typecheck # Validate typescript files
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
> **How to Fix Spellcheck Errors:** You can add unknown words to `dictionary.txt`.
### Deployment

The documentation site is continuously deployed to CloudFlare Pages, triggered on every commit to `main`. [This workflow](/.github/workflows/docs-deploy.yml) defines the deployment process.

## Site Structure

The site it comprised of two sub-sites - user documentation (`/`) and developer documentation (`/developers`). There is intentionally no link from the user docs to the developer docs, to avoid overwhelming users with unnecessary info.

### User Docs

Available at the root (`/`), default location for anyone visiting the documentation domain. Source files are under `docs/user`

Follows the [Diátaxis](https://diataxis.fr/) framework for structuring documentation. The site is divided into four types of documentation: tutorials (Getting Started), how-to guides (Guides), explanations (Knowledge Base) and reference (Reference).

#### CLI Docs

These docs are automatically generated from the Forest CLI. See [script](/docs/docs/users/reference/cli.sh).

#### JSON-RPC Docs

We use the OpenRPC document from Forest to populate the documentation for each method. For this we use `@metamask/docusaurus-openrpc`.

### Developer Docs

Available at `/developers`, source code is located in `docs/developers`. Comprised of a collection of documents aimed at contributors. May be relevant to power users.

> Note: As a general rule of thumb, if it involes reading or writing Rust, it should live under the Developer documentation.
## Contributing

### References

- [Docusaurus Guide](https://docusaurus.io/docs/category/guides)
- [Docusaurus Configuration Docs](https://docusaurus.io/docs/api/docusaurus-config)
- [Forest Contributor Guidelines](../CONTRIBUTING.md)

### Useful Features

- Admonitions (eg. Info, Warning, etc): https://docusaurus.io/docs/markdown-features/admonitions
- Mermaid Diagrams: https://docusaurus.io/docs/markdown-features/diagrams
- MDX (embedding JavaScript): https://docusaurus.io/docs/markdown-features/react
- Code Blocks: https://docusaurus.io/docs/markdown-features/code-blocks

0 comments on commit f0e6cd4

Please sign in to comment.