# Docs Development Guidelines
Welcome to our docs developer guidelines!
We store documentation related to Netdata inside of
the [`netdata/netdata` repository](https://github.com/netdata/netdata) on GitHub.
The Netdata team aggregates and publishes all documentation at [learn.netdata.cloud](/) using
[Docusaurus](https://v2.docusaurus.io/) over at the [`netdata/learn` repository](https://github.com/netdata/learn).
## Before you get started
Anyone interested in contributing to documentation should first read the [Netdata style guide](#styling-guide) further
down below and the [Netdata Community Code of Conduct](https://github.com/netdata/.github/blob/main/CODE_OF_CONDUCT.md).
Netdata's documentation uses Markdown syntax. If you're not familiar with Markdown, read
the [Mastering Markdown](https://guides.github.com/features/mastering-markdown/) guide from GitHub for the basics on
creating paragraphs, styled text, lists, tables, and more, and read further down about some special
occasions [while writing in MDX](#mdx-and-markdown).
### Netdata's Documentation structure
Netdata's documentation is separated into 5 categories.
- **Getting Started**: This section’s purpose is to present “What is Netdata” and for whom is it for while also
presenting all the ways Netdata can be deployed. That includes Netdata’s platform support, Standalone deployment,
Parent-child deployments, deploying on Kubernetes and also deploying on IoT nodes.
- Stored in **WIP**
- Published in **WIP**
- **Concepts**: This section’s purpose is to take a pitch on all the aspects of Netdata. We present the functionality of
each component/idea and support it with examples but we don’t go deep into technical details.
- Stored in the `/docs/concepts` directory in the `netdata/netdata` repository.
- Published in **WIP**
- **Tasks**: This section's purpose is to break down any operation into a series of fundamental tasks for the Netdata
solution.
- Stored in the `/docs/tasks` directory in the `netdata/netdata` repository.
- Published in **WIP**
- **References**: This section’s purpose is to explain thoroughly every part of Netdata. That covers settings,
configurations and so on.
- Stored near the component they refer to.
- Published in **WIP**
- **Collectors References**: This section’s purpose is to explain thoroughly every collector that Netdata supports and
it's configuration options.
- Stored in stored near the collector they refer to.
- Published in **WIP**
## How to contribute
The easiest way to contribute to Netdata's documentation is to edit a file directly on GitHub. This is perfect for small
fixes to a single document, such as fixing a typo or clarifying a confusing sentence.
Click on the **Edit this page** button on any published document on [Netdata Learn](https://learn.netdata.cloud). Each
page has two of these buttons: One beneath the table of contents, and another at the end of the document, which take you
to GitHub's code editor. Make your suggested changes, keeping the [Netdata style guide](#styling-guide)
in mind, and use the ***Preview changes*** button to ensure your Markdown syntax works as expected.
Under the **Commit changes** header, write descriptive title for your requested change. Click the **Commit changes**
button to initiate your pull request (PR).
Jump down to our instructions on [PRs](#making-a-pull-request) for your next steps.
### Edit locally
Editing documentation locally is the preferred method for complex changes that span multiple documents or change the
documentation's style or structure.
Create a fork of the Netdata Agent repository by visit the [Netdata repository](https://github.com/netdata/netdata) and
clicking on the **Fork** button.
GitHub will ask you where you want to clone the repository. When finished, you end up at the index of your forked
Netdata Agent repository. Clone your fork to your local machine:
```bash
git clone https://github.com/YOUR-GITHUB-USERNAME/netdata.git
```
Create a new branch using `git checkout -b BRANCH-NAME`. Use your favorite text editor to make your changes, keeping
the [Netdata style guide](https://github.com/netdata/netdata/blob/master/docs/contributing/style-guide.md) in mind. Add, commit, and push changes to your fork. When you're
finished, visit the [Netdata Agent Pull requests](https://github.com/netdata/netdata/pulls) to create a new pull request
based on the changes you made in the new branch of your fork.
### Making a pull request
Pull requests (PRs) should be concise and informative. See our [PR guidelines](/contribute/handbook#pr-guidelines) for
specifics.
- The title must follow the [imperative mood](https://en.wikipedia.org/wiki/Imperative_mood) and be no more than ~50
characters.
- The description should explain what was changed and why. Verify that you tested any code or processes that you are
trying to change.
The Netdata team will review your PR and assesses it for correctness, conciseness, and overall quality. We may point to
specific sections and ask for additional information or other fixes.
After merging your PR, the Netdata team rebuilds the [documentation site](https://learn.netdata.cloud) to publish the
changed documentation.
## Writing Docs
We have three main types of Docs: **References**, **Concepts** and **Tasks**.
### Metadata Tags
All of the Docs however have what we call "metadata" tags. these help to organize the document upon publishing.
So let's go through the different necessary metadata tags to get a document properly published on Learn:
- Docusaurus Specific:\
These metadata tags are parsed automatically by Docusaurus and are rendered in the published document. **Note**:
Netdata only uses the Docusaurus metadata tags releveant for our documentation infrastructure.
- `title: "The title of the document"` : Here we specify the title of our document, which is going to be converted
to the heading of the published page.
- `description: "The description of the file"`: Here we give a description of what this file is about.
- `custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/COLLECTORS.md`: Here is an example of
the link that the user will be redirected to if he clicks the "Edit this page button", as you see it leads
directly to the edit page of the source file.
- Netdata Learn specific:
- `learn_status: "..."`
- The options for this tag are:
- `"published"`
- `"unpublished"`
- `learn_topic_type: "..."`
- The options for this tag are:
- `"Getting Started"`
- `"Concepts"`
- `"Tasks"`
- `"References"`
- `"Collectors References"`
- This is the Topic that the file belongs to, and this is going to resemble the start directory of the file's
path on Learn for example if we write `"Concepts"` in the field, then the file is going to be placed
under `/Concepts/....` inside Learn.
- `learn_rel_path: "/example/"`
- This tag represents the rest of the path, without the filename in the end, so in this case if the file is a
Concept, it would go under `Concepts/example/filename.md`. If you want to place the file under the "root"
topic folder, input `"/"`.
- ⚠️ In case any of these "Learn" tags are missing or falsely inputted the file will remain unpublished. This is by
design to prevent non-properly tagged files from getting published.
While Docusaurus can make use of more metadata tags than the above, these are the minimum we require to publish the file
on Learn.
### Doc Templates
These are the templates we use for our Documentation files:
Reference Docs
The template that is used for Reference files is:
```
```
## Configuration files
### Data collection
```
go.d/apache.conf
```
To make changes, see `the ./edit-config task `
### Alerts
none
## Requirements to run this module
- none
## Requirement on the monitored application
- `Apache` with enabled [`mod_status`](https://httpd.apache.org/docs/2.4/mod/mod_status.html)
## Auto detection
### Single node installation
. . . we autodetect localhost:port and what configurations are defaults
### Kubernetes installations
. . . Service discovery, click here
## Metrics
Columns: Context | description (of the context) | units (of the context) | dimensions | alerts
- Requests in `requests/s`
- Connections in `connections`
- Async Connections in `connections`
- Scoreboard in `connections`
- Bandwidth in `kilobits/s`
- Workers in `workers`
- Lifetime Average Number Of Requests Per Second in `requests/s`
- Lifetime Average Number Of Bytes Served Per Second in `KiB/s`
- Lifetime Average Response Size in `KiB`
### Labels
just like Task Docs
The template that is used for Task files is:
```
```
## Description
A small description of the Task.
## Prerequisites
Describe all the information that the user needs to know before proceeding with the task.
## Context
Describe the background information of the Task, the purpose of the Task, and what will the user achieve by completing
it.
## Steps
A task consists of steps, here provide the actions needed from the user, so he can complete the task correctly.
## Result
Describe the expected output/ outcome of the result.
## Example
Provide any examples needed for the Task
Concept Docs
The template of the Concept files is:
```
```
## Description
In our concepts we have a more loose structure, the goal is to communicate the "concept" to the user, starting with
simple language that even a new user can understand, and building from there.
Service Discovery and Auto-Detection:
Install netdata with docker |
| **Recommended** | Getting started guide
Service discovery and auto-detection
Install Netdata with Docker |
### Abbreviations (acronyms and initialisms)
Use abbreviations (including [acronyms and initialisms](https://www.dictionary.com/e/acronym-vs-abbreviation/)) in
documentation when one exists, when it's widely accepted within the monitoring/sysadmin community, and when it improves
the readability of a document.
When introducing an abbreviation to a document for the first time, give the reader both the spelled-out version and the
shortened version at the same time. For example:
> Use Netdata to monitor Extended Berkeley Packet Filter (eBPF) metrics in real-time.
> After you define an abbreviation, don't switch back and forth. Use only the abbreviation for the rest of the document.
You can also use abbreviations in a document's title to keep the title short and relevant. If you do this, you should
still introduce the spelled-out name alongside the abbreviation as soon as possible.
### Clause order
When instructing users to take action, give them the context first. By placing the context in an initial clause at the
beginning of the sentence, users can immediately know if they want to read more, follow a link, or skip ahead.
| | |
|-----------------|--------------------------------------------------------------------------------|
| Not recommended | Read the reference guide if you'd like to learn more about custom dashboards. |
| **Recommended** | If you'd like to learn more about custom dashboards, read the reference guide. |
### Oxford comma
The Oxford comma is the comma used after the second-to-last item in a list of three or more items. It appears just
before "and" or "or."
| | |
|-----------------|------------------------------------------------------------------------------|
| Not recommended | Netdata can monitor RAM, disk I/O, MySQL queries per second and lm-sensors. |
| **Recommended** | Netdata can monitor RAM, disk I/O, MySQL queries per second, and lm-sensors. |
### Future releases or features
Do not mention future releases or upcoming features in writing unless they have been previously communicated via a
public roadmap.
In particular, documentation must describe, as accurately as possible, the Netdata Agent _as of
the [latest commit](https://github.com/netdata/netdata/commits/master) in the GitHub repository_. For Netdata Cloud,
documentation must reflect the *current state* of [production](https://app.netdata.cloud).
### Informational links
Every link should clearly state its destination. Don't use words like "here" to describe where a link will take your
reader.
| | |
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| Not recommended | To install Netdata, click [here](https://github.com/netdata/netdata/blob/master/packaging/installer/README.md). |
| **Recommended** | To install Netdata, read the [installation instructions](https://github.com/netdata/netdata/blob/master/packaging/installer/README.md). |
Use links as often as required to provide necessary context. Blog posts and guides require less hyperlinks than
documentation. See the section on [linking between documentation](#linking-between-documentation) for guidance on the
Markdown syntax and path structure of inter-documentation links.
### Contractions
Contractions like "you'll" or "they're" are acceptable in most Netdata writing. They're both authentic and playful, and
reinforce the idea that you, as a writer, are guiding users through a particular idea, process, or feature.
Contractions are generally not used in press releases or other media engagements.
### Emoji
Emoji can add fun and character to your writing, but should be used sparingly and only if it matches the content's tone
and desired audience.
### Switching Linux users
Netdata documentation often suggests that users switch from their normal user to the `netdata` user to run specific
commands. Use the following command to instruct users to make the switch:
```bash
sudo su -s /bin/bash netdata
```
### Hostname/IP address of a node
Use `NODE` instead of an actual or example IP address/hostname when referencing the process of navigating to a dashboard
or API endpoint in a browser.
| | |
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Not recommended | Navigate to `http://example.com:19999` in your browser to see Netdata's dashboard.
Navigate to `http://203.0.113.0:19999` in your browser to see Netdata's dashboard. |
| **Recommended** | Navigate to `http://NODE:19999` in your browser to see Netdata's dashboard. |
If you worry that `NODE` doesn't provide enough context for the user, particularly in documentation or guides designed
for beginners, you can provide an explanation:
> With the Netdata Agent running, visit `http://NODE:19999/api/v1/info` in your browser, replacing `NODE` with the IP
> address or hostname of your Agent.
### Paths and running commands
When instructing users to run a Netdata-specific command, don't assume the path to said command, because not every
Netdata Agent installation will have commands under the same paths. When applicable, help them navigate to the correct
path, providing a recommendation or instructions on how to view the running configuration, which includes the correct
paths.
For example, the [configuration](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md) doc first
teaches users how to find the Netdata config
directory and navigate to it, then runs commands from the `/etc/netdata` path so that the instructions are more
universal.
Don't include full paths, beginning from the system's root (`/`), as these might not work on certain systems.
| | |
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Not recommended | Use `edit-config` to edit Netdata's configuration: `sudo /etc/netdata/edit-config netdata.conf`. |
| **Recommended** | Use `edit-config` to edit Netdata's configuration by first navigating to your [Netdata config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory), which is typically at `/etc/netdata`, then running `sudo edit-config netdata.conf`. |
### `sudo`
Include `sudo` before a command if you believe most Netdata users will need to elevate privileges to run it. This makes
our writing more universal, and users on `sudo`-less systems are generally already aware that they need to run commands
differently.
For example, most users need to use `sudo` with the `edit-config` script, because the Netdata config directory is owned
by the `netdata` user. Same goes for restarting the Netdata Agent with `systemctl`.
| | |
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| Not recommended | Run `edit-config netdata.conf` to configure the Netdata Agent.
Run `systemctl restart netdata` to restart the Netdata Agent. |
| **Recommended** | Run `sudo edit-config netdata.conf` to configure the Netdata Agent.
Run `sudo systemctl restart netdata` to restart the Netdata Agent. |
## Markdown syntax
Netdata's documentation uses Markdown syntax.
If you're not familiar with Markdown, read the [Mastering
Markdown](https://guides.github.com/features/mastering-markdown/) guide from GitHub for the basics on creating
paragraphs, styled text, lists, tables, and more.
The following sections describe situations in which a specific syntax is required.
### Syntax standards (`remark-lint`)
The Netdata team uses [`remark-lint`](https://github.com/remarkjs/remark-lint) for Markdown code styling.
- Use a maximum of 120 characters per line.
- Begin headings with hashes, such as `# H1 heading`, `## H2 heading`, and so on.
- Use `_` for italics/emphasis.
- Use `**` for bold.
- Use dashes `-` to begin an unordered list, and put a single space after the dash.
- Tables should be padded so that pipes line up vertically with added whitespace.
If you want to see all the settings, open the
[`remarkrc.js`](https://github.com/netdata/netdata/blob/master/.remarkrc.js) file in the `netdata/netdata` repository.
### MDX and markdown
While writing in Docusaurus, you might want to take leverage of it's features that are supported in MDX formatted files.
One of those that we use is [Tabs](https://docusaurus.io/docs/next/markdown-features/tabs). They use an HTML syntax,
which requires some changes in the way we write markdown inside them.
In detail:
Due to a bug with docusaurus, we prefer to use `