Skip to main content

Write documentation

Via GitHub​

The YunoHost documentation is managed through a Git repository.

If you are not familiar with GitHub, there is an "Edit" button at the bottom of each page that will redirect you to the GitHub online editor that will help you make change proposals (Pull Requests, PR).

However, if you are on an editing spree, you should fork the repository. You can then make all the commits (changes) you want on your forked repository, and submit them all at once in the same pull requests. GitHub's etiquette would advise you to gather in the same PR all related commits.

Because the online editor doesn't support uploading files, using Git is the prefered way if you need to upload media (e.g. images).

Docusaurus​

The documentation is built using Docusaurus. It generates static pages that can be served by a simple server.

tip

The official Docusaurus doc should be your primary source of documentation.

Install Docusaurus and its dependencies:

$ yarn

Local development​

Start a local development server, that automatically updates when files are edited:

$ yarn start

Build​

Build the final static files:

$ yarn build

This command generates static content into the build directory.

tip

You can serve those files locally using yarn serve

Deploy​

You can either copy the built files to a static file server (using My Webapp) or deploy the site to Github Pages.

Contents of the repository​

We are following the standard Docusaurus structure:

β”‚   # The main docs
β”œβ”€β”€ docs/
β”‚
β”‚ # The translations
β”œβ”€β”€ i18n
β”‚ ╰── *
β”‚ β”œβ”€β”€ code.json
β”‚ β”œβ”€β”€ docusaurus-theme-classic
β”‚ β”‚ β”œβ”€β”€ footer.json
β”‚ β”‚ ╰── navbar.json
β”‚ ╰── docusaurus-plugin-content-docs
β”‚ β”‚ # The same content as docs/
β”‚ β”œβ”€β”€ current/
β”‚ ╰── current.json
β”‚
β”‚ # The configuration files
β”œβ”€β”€ docusaurus.config.js
β”œβ”€β”€ package.json
β”œβ”€β”€ redirects.js
β”œβ”€β”€ sidebars.js
β”œβ”€β”€ yarn.lock
β”‚
β”‚ # Autogeneration scripts and templates
β”œβ”€β”€ scripts
β”‚ ╰── generate_docs.sh
β”‚
β”‚ # Custom Docusaurus code and theming
β”œβ”€β”€ src
β”‚ β”œβ”€β”€ components/
β”‚ β”œβ”€β”€ css/
β”‚ ╰── theme/
β”‚
β”‚ # Images, etc
╰── static/

Special pages​

Some pages of the documentation are automatically or dynamically generated.

See the generation script.