---
type: docs
title: "Contributors guide"
linkTitle: "Contributors guide"
weight: 10
description: Get started with contributing to the Dapr docs
---
In this guide, you'll learn how to contribute to the [Dapr docs repository](https://github.com/dapr/docs). Since Dapr docs are published to [docs.dapr.io](https://docs.dapr.io), you must make sure your contributions compile and publish correctly.
## Prerequisites
Before contributing to the Dapr docs:
- Review the [guidance around general Dapr project contributions]({{% ref contributing-overview%}}).
- Install and set up your local environment with [Hugo](https://gohugo.io/) with the [Docsy](https://docsy.dev) theme. Follow the instructions in the repository [README.md](https://github.com/dapr/docs/blob/master/README.md#environment-setup).
- Fork and clone the [docs repository](https://github.com/dapr/docs).
## Branch guidance
The Dapr docs handles branching differently than most code repositories. Instead of a `main` branch, every branch is labeled to match the major and minor version of a runtime release. For the full list visit the [Docs repo](https://github.com/dapr/docs#branch-guidance)
Generally, all of your docs updates should point to [docs branch for the latest release of Dapr](https://github.com/dapr/docs). The latest release is the default branch [https://github.com/dapr/docs]. For example, if you are fixing a typo, adding notes, or clarifying a point, make your changes into the default Dapr branch.
For any docs changes applicable to a release candidate or a pre-release version of the docs, point your changes into that particular branch. For example, if you are documenting an upcoming change to a component or the runtime, make your changes to the pre-release branch.
## Style and tone
Style and tone conventions should be followed throughout all Dapr documentation for consistency across all docs:
| Style/Tone | Guidance |
| ---------- | -------- |
| Casing | Use upper case only:
```
### Tabbed content
Tabs are made possible through [Hugo shortcodes](https://gohugo.io/content-management/shortcodes/).
The overall format is:
```
{{%/* tabpane [Tab1] [Tab2]%}}
{{% tab %}}
[Content for Tab1]
{{% /tab %}}
{{% tab %}}
[Content for Tab2]
{{% /tab %}}
{{% /tabpane */%}}
```
All content you author will be rendered to markdown, so you can include images, code blocks, YouTube videos, and more.
#### Example
````
{{%/* tabpane Windows Linux MacOS%}}
{{% tab %}}
```powershell
powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex"
```
{{% /tab %}}
{{% tab %}}
```bash
wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash
```
{{% /tab %}}
{{% tab %}}
```bash
brew install dapr/tap/dapr-cli
```
{{% /tab %}}
{{% /tabpane */%}}
````
This example will render to this:
{{% tabpane Windows Linux MacOS%}}
{{% tab %}}
```powershell
powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex"
```
{{% /tab %}}
{{% tab %}}
```bash
wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash
```
{{% /tab %}}
{{% tab %}}
```bash
brew install dapr/tap/dapr-cli
```
{{% /tab %}}
{{% /tabpane %}}
### Embedded code snippets
Use the `code-snippet` shortcode to reference code snippets from the `static/code` directory.
```
{{%/* code-snippet file="myfile.py" lang="python" */%}}
```
{{% alert title="Warning" color="warning" %}}
All Dapr sample code should be self-contained in separate files, not in markdown. Use these techniques to highlight the parts of the sample code users should focus on.
{{% /alert %}}
Use the `lang` (default `txt`) parameter to configure the language used for syntax highlighting.
Use the `marker` parameter to limit the embedded snipped to a portion of the sample file. This is useful when you want to show just a portion of a larger file. Typically, you'd do this by:
1. Surrounding the interesting code with comments.
1. Passing the comment text into `marker`.
The shortcode below and code sample:
```
{{%/* code-snippet file="./contributing-1.py" lang="python" marker="#SAMPLE" */%}}
```
```python
import json
import time
from dapr.clients import DaprClient
#SAMPLE
with DaprClient() as d:
req_data = {
'id': 1,
'message': 'hello world'
}
while True:
# Create a typed message with content type and body
resp = d.invoke_method(
'invoke-receiver',
'my-method',
data=json.dumps(req_data),
)
# Print the response
print(resp.content_type, flush=True)
print(resp.text(), flush=True)
time.sleep(2)
#SAMPLE
```
Will result in the following output:
{{% code-snippet file="contributing-1.py" lang="python" marker="#SAMPLE" %}}
Use the `replace-key-[token]` and `replace-value-[token]` parameters to limit the embedded snipped to a portion of the sample file. This is useful when you want abbreviate a portion of the code sample. Multiple replacements are supported with multiple values of `token`.
The shortcode below and code sample:
```
{{%/* code-snippet file="./contributing-2.py" lang="python" replace-key-imports="#IMPORTS" replace-value-imports="# Import statements" */%}}
```
```python
#IMPORTS
import json
import time
#IMPORTS
from dapr.clients import DaprClient
with DaprClient() as d:
req_data = {
'id': 1,
'message': 'hello world'
}
while True:
# Create a typed message with content type and body
resp = d.invoke_method(
'invoke-receiver',
'my-method',
data=json.dumps(req_data),
)
# Print the response
print(resp.content_type, flush=True)
print(resp.text(), flush=True)
time.sleep(2)
```
Will result in the following output:
{{% code-snippet file="./contributing-2.py" lang="python" replace-key-imports="#IMPORTS" replace-value-imports="# Import statements" %}}
### YouTube videos
Hugo can automatically embed YouTube videos using a shortcode:
```
{{%/* youtube [VIDEO ID] */%}}
```
#### Example
Given the video https://youtu.be/dQw4w9WgXcQ
The shortcode would be:
```
{{%/* youtube dQw4w9WgXcQ */%}}
```
### Buttons
To create a button in a webpage, use the `button` shortcode.
An optional "newtab" parameter will indicate if the page should open in a new tab. Options are "true" or "false". Default is "false", where the page will open in the same tab.
#### Link to an external page
```
{{%/* button text="My Button" link="https://example.com" */%}}
```
{{< button text="My Button" link="https://example.com" >}}
#### Link to another docs page
You can also reference pages in your button as well:
```
{{%/* button text="My Button" page="contributing" newtab="true" */%}}
```
{{< button text="My Button" page="contributing.md" newtab="true" >}}
#### Button colors
You can customize the colors using the Bootstrap colors:
```
{{%/* button text="My Button" link="https://example.com" color="primary" */%}}
{{%/* button text="My Button" link="https://example.com" color="secondary" */%}}
{{%/* button text="My Button" link="https://example.com" color="success" */%}}
{{%/* button text="My Button" link="https://example.com" color="danger" */%}}
{{%/* button text="My Button" link="https://example.com" color="warning" */%}}
{{%/* button text="My Button" link="https://example.com" color="info" */%}}
```
{{% button text="My Button" link="https://example.com" color="primary" %}}
{{% button text="My Button" link="https://example.com" color="secondary" %}}
{{% button text="My Button" link="https://example.com" color="success" %}}
{{% button text="My Button" link="https://example.com" color="danger" %}}
{{% button text="My Button" link="https://example.com" color="warning" %}}
{{% button text="My Button" link="https://example.com" color="info" %}}
### References
[Docsy authoring guide](https://www.docsy.dev/docs/adding-content/)
## Translations
The Dapr Docs supports adding language translations into the docs using git submodules and Hugo's built in language support.
You can find an example PR of adding Chinese language support in [PR 1286](https://github.com/dapr/docs/pull/1286).
Steps to add a language:
- Open an issue in the Docs repo requesting to create a new language-specific docs repo
- Once created, create a git submodule within the docs repo:
```sh
git submodule add