This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Documentation

Articles describing how to contribute documentation to TrueNAS projects.

Article Content Out of Date?

We welcome community contributions to keep this documentation current! Click Edit Page in the top right corner to propose changes to this article. See Updating Content for more information.

The TrueNAS project welcomes all documentation contributions!

The Documentation Hub uses Hugo to create the documentation websites. Articles are written in a combination of Markdown and HTML syntax.

The tutorials in this section are designed to guide you with different kinds of documentation contributions and two different tutorial article templates. There is also an article template that you can copy and use to submit new articles. Please feel free to propose changes and add new content to these articles to help others learn how to contribute to project documentation!

Want to discuss your in-progress changes or other TrueNAS contributions? The TrueNAS contributors #truenas-docs Slack workspace is available for contributors to discuss their changes and help each other improve the software. You can request to join this workspace at truenas.slack.com.

Content Styling

This guide has many examples of how to style your documentation contributions. TrueNAS documentation uses standardized Commonmark Markdown, HTML, and Hugo syntax to transform text, add images, stylize tables, and link to other locations. The guide is not exhaustive but contains examples of the elements that are most commonly used when writing TrueNAS documentation. To learn more about each markup language, see these resources:

Markdown Examples

TrueNAS Documentation Hub articles make use of the following formatting options:

Headers

Use hashes (#) to designate a section of content:

# Level 1
## Level 2
### Level 3

On this website, the article title is designated as a level 1 heading. The rest of the section content should be organized with level 2 and greater headings. This populates the article navigation sidebar with links to the different sections of your article.

Inline Text Decoration

Approved usage of in-line text formatting is as follows:

  • Italics: *text* used for variables in command strings or examples
  • Bold: **text** used for on-screen UI elements such as the name of a screen or field as it appears on the screen
  • Preformatted/Code: `text` use for command strings

You can also use standard HTML tags to transform text. For example:

  • Command with variables command variable
  • Marked/Highlighted: <mark>text</mark>
  • Insert: <ins>text</ins>
  • Underlined: <u>text</u>
  • Subscripted: <sub>text</sub>
  • Superscripted: <sup>TM</sup>
  • Deleted: <del>text</del>
  • Strikethrough: <strike>text</strike>
Escape Characters

To escape a syntax character so that the character is displayed without transformation, use a backslash (\).

You can also use HTML escapes to add comments: <!-- this text does not display in the rendered article -->

Linking

Linking to a site that is outside docs.truenas.com is done with square brackets and parentheses:

[example link text](www.example.com)

You can also link directly just by typing the URL with no additional markup: www.example.com

HTML linking syntax is also allowed: <a href="www.example.com">Example Site</a>

You can also use the ref shortcode to link to documents on the TrueNAS Documentation Hub website. For example, linking to an existing article such as a TrueNAS tutorial [Dashboard]({{ ref “/SCALE/Dashboard/CustomizingDashboard.md” }}).

To link to another section of the same article, use an anchor (#) to refer to that section header. The header title needs to be in lower case and spaces replaced with dashes (-): [Escape Characters](#escape-characters)

Lists

Lists can be ordered or unordered:

1. First
2. Second
3. Third

* Who
* What
* When

If inserting an image after a list number, indent the image to align with the text following the number to continue the numbering sequence for the remaining step numbers. For example:

1. First step

   insert image link, preceded and followed by an empty line

2. Second step
3. Third step

If inserting an image or text related to and between bullet points, indent the text over to align with the bullet point text. If an image, insert a blank line before and after the image link.

Code Blocks

A backtick (`) starts or stops an inline code-. For example, enter ls to list directory contents. Using three ` backticks on a line starts or stops a multi-line block:

This is a multi-line code block.
foo
bar
baz

If including a variable in the code example, use the HTML <code> and </code> tags and the <i>variable</i> tags to enclose the variable.

Block Quotes

Use the right carat (>) to designate a block quote:

> The entire paragraph is formatted as the quote.
>
> You can use a > for every line of the quote or at the beginning of each paragraph of text.
Tables

You can use the Markdown table syntax to produce simple tables or the truetable shortcode to apply the Documentation Hub table formatting. For example:

| Setting | Description |
|---------|-------------|
| **Field name** | Description of what to enter into this field. |

or use the ‘{{< truetable >}}` and {{< /truetable >}} tags to apply TrueNAS formatting to the table (do not include the escaping backslash \). For example:

{{\< truetable>}}
| Setting | Description |
|---------|-------------|
| **Field name** | Description of what to enter into this field. |
{{\< /truetable >}}

If you want to use specific column sizes, you can use HTML tags to customize how your table displays.

Expand/Collapse Text

You can use the {{\< expand >}} shortcode to create an expandable section of text such as those used in this article (do not include the escaping backslash \). For example:

{{\< expand "Text for the expandable text block" "v" >}}
Enter the text or title for the expandable text in double quotes followed by the "v" to indicate the start of the expandable text:
End the section with the close tag.
{{\< /expand >}}

You can use the expand short code as a bullet point list item. the arrow is enough to indicate a point in a bullet list if all list items are also expandable.

Hugo Style Elements

There are many style elements you can use that are built into the Hugo static site generator. This site uses Hugo shortcode syntax for images, internal references, and admonition boxes.

Linking to Other Articles on this Website

Internal references use the ref shortcode to look up a file by name, or the ref shortcode to link to another article on the Documentation Hub website:

[Creating a new ZFS Pool]({{\< ref "pools" >}})
(do not include the escaping backslash \)

If linking to file names that are not unique, you must also include the path to that file. For example:

[Creating a new Dataset]({{\< ref "/SCALE/Datasets/ManagingDatasets" >}})

Linking to the index file of an article bundle requires using the generic linking syntax to point to the article location:

You find information on applications in the [Apps article]({{\< ref "/SCALE/ScaleTutorials/apps" >).
(do not include the escaping backslash \)

You can also use an anchor to link to a specific section within an article:

[Section Level 3]({{\< ref "example.md#section-level-3" >}})
(do not include the escaping backslash \)
Images

To add an image to your article, you must add the image file to your article bundle. You can insert an image without a caption with a simple image link using this markdown string:

![image name](\"path/directory/folder/imagename.png")
(do not include the escaping backslash \)

Or use the trueimage shortcode in your article to link to the image and define the additional caption parameters:

{{\< trueimage src="path/to/image.png" alt="Example Image" id="Example Image" >}}
(do not include the escaping backslash \)

You can also use HTML to link to an image file that is relative to the site /static/ directory:

<img src="/docs/images/network-interfaces.png" width='700px'>
Admonition Boxes

To create a simple note box use the hint shortcode:

{{\< hint type="info" >}}
This is a simple note box with a blue background and a darker blue border
{{\< /hint >}}
(do not include the escaping backslash \)

You can apply a type to the alert boxes (i.e., info and warning) to define the color of the box:

{{\< hint type="warning" >}}
This is an alert that is titled Warning and uses a red coloration.
{{\< /hint >}}
(do not include the escaping backslash \)

You can include a title for the admonition using the title=\"Title Text" in the {{\< hint >}} string. For example:

{{\< hint type="info" title="Admonition Titles" >}}
This is the text in the information box.
{{\< /hint >}}
(do not include the escaping backslash \)

This renders as:

Admonition Titles

This is the text in the information box.

Graphical Fonts and Icons

You can call either the Font Awesome or Material Design graphical fonts in your text to be more precise about what buttons or icons to click in the TrueNAS web interface. Below are examples of icons we already use on the Docs website, along with the exact code you would add to the Markdown file to call that icon.

To find icons that you can include with your text, please refer to the Material Design or Font Awesome Icon Libraries. Note that we only support the Free and Solid Font Awesome icons.

To improve accessibility assistance, please use the aria-hidden and title fields with your icon. This allows users who require accessibility assistance like screen readers to know what icon is being used.

Icon Examples

= <i class="fa fa-ellipsis-v" aria-hidden="true" title="Options"></i>

= <i class="fa fa-cog" aria-hidden="true" title="Settings"></i>

= <i class="fa fa-pencil" aria-hidden="true" title="Pencil"></i>

= <i class="fa fa-bell" aria-hidden="true" title="Alert"></i>

= <i class="fa fa-trash" aria-hidden="true" title="Delete"></i>

= <i class="fa fa-eye" aria-hidden="true" title="eye"></i>

= <i class="fa fa-bars" aria-hidden="true" title="Menu"></i>

= <i class="material-icons" aria-hidden="true" title="System Update">system_update_alt</i>

Key Strokes

When a specific keyboard key or key combination is used, use the <kbd> HTML code to highlight the keystrokes. Here are a few examples:

Ctrl + C = <kbd>Ctrl + C</kbd>

Delete = <kbd>Delete</kbd>

Command+c = <kbd>Command+c</kbd>

Shift+Insert = <kbd>Shift+Insert</kbd>

General Content Rules to Follow

Do not use the following in your articles:

  • The word will. It either does or does not do something. Use active voice and present tense when writing content. For example, do not type “The system will restart.” Instead, use “The system restarts.”

  • The word may. We all say it but we are not giving permission to do something, we are saying it might do something. You can also replace may with can or should if these words better describe the situation. Only use may when granting permission to do something.

  • Do not use possessive case. Replace the (’s) instances with a statement. For example, do not say “The system’s IP address.” Instead, say “The IP address for the system.” You can use its or their, but try to avoid possessives where possible.

  • Do not use contractions. Contractions do not translate well for non-English and English as a second language reader populations. For example, change instances such as doesn’t to does not.

  • Spell out numbers between one and ten when referring to numbers of items in general terms. If you are referring to entering a number, type the digit (for example, enter 1 in the field). Use digits for numbers greater than ten.

Updating Content

Changes wanted! Contributing changes to the TrueNAS documentation has never been easier. The Documentation Hub is specifically built to allow users to quickly propose changes to the content without having to install any special applications. All that is required is to have a GitHub account and a basic understanding of Markdown .

You need to log in to your GitHub account to propose any changes. The repository automatically builds a preview site for each open pull request (PR) created in GitHub. The link to this preview site is added to the PR as a comment. The preview updates with the changes you make to the pull request, so you can always see an accurate preview of the changes you make to the website.

Making Quick Changes to an Article

We welcome community contributions to keep the documentation current!

Click Edit Page in the top right corner of an article screen to propose changes to the article.

To check your changes for bugs in the Markdown or HTML syntax, switch to the Preview changes tab. The preview renders generic Markdown but does not render Hugo-specific syntax.

Replacing an Image

To update an existing image, click Edit Page and find the image location and name in the article source text. Name a replacement image with the same name as the existing image you are replacing.

In the repository, click Code and go to the image location in the repository. Images are located in the /static/images/ directory and in the same folder location as indicated in the image path found in the article text file as part of an article bundle.

Click Upload files and either drag and drop the new or replacement image into the file upload area or open the file browser to select your image. Naming the new image name the same as the old image automatically replaces the old image with the new one in every article that includes it.

If adding a new image to the article, give the PNG image a descriptive name, such as Adding an SMB Share or Add SMB Share Advanced Settings and save it in the appropriate /static/images/ folder. Enter the path to the image and the image name to the image link in the article.

Editing an Included File

Some article content comes from a separate include file statement, also referred to as a shortcode. This statement pulls in content from a different location and allows using common text in multiple website articles simultaneously. These files are called snippets. Updating an /static/includes/ file updates the content in every article that uses that included snippet file!

For example, the snippet file AdvancedScheduler.md is called into articles where the procedure mentions creating a custom schedule for tasks that can run on a schedule, such as for replication, cloud sync, and other data protection tasks. You can insert the include file shortcode anywhere in the body of an article. The example below shows this inside the expand tags.

Clicking Edit Page opens the article markdown file, but only these lines are visible for the included content (the added \ characters prevent rendering the shortcodes in this article):

{{\< expand "Advanced Scheduler" "v" >}}
{{\< include file="/static/includes/AdvancedScheduler.md" >}}
{{\< /expand >}}
(Do not include the escaping backslashes \)

In the above example, the expand and /expand shortcode tags create an expansion/collapse function in the document. The include shortcode is within the expandable element: {{\< include file="/static/includes/AdvancedScheduler.md" >}}. (Do not include the escaping backslashes )

The repository file static/includes/AdvancedScheduler.md contains the text for the included snippet. To update the content, edit the AdvancedScheduler.md file. Multiple documents can use a snippet file, so only make changes to snippet content that applies to this included file. Changing the snippet content makes the same changes in all articles calling this file. Make changes directly in the article that are specific to the article but not applicable to all other articles that share the snippet. For example, make only content changes that apply to the advanced scheduler in the snippet, but do not include mentions about tasks that use the scheduler.

Master and Version Branch Differences

TrueNAS documentation uses branches to organize content related to specific software releases and updates, for example, the 24.04 and 23.10 branches of the Documentation Hub.

  • Content changes in the master branch result in changes to the TrueNAS Nightly Development Documentation content. To make changes in the master branch, fork this branch to create a simple copy of the main repository. Make changes in your forked master as the base for your changes. Do not make changes directly to the TrueNAS master branch of the Documentation Hub repository.

  • To make content changes in the 24.04 branch, select the 24.04 as the base, then create a fork of that main repository. This ensures approved modifications are added to the TrueNAS 24.04 (Dragonfish) Documentation content.

  • To make content changes in the 23.10 branch, select the 23.10 as the base, then create a fork of that main repository. This ensures that approved modifications are added to the TrueNAS 23.10 (Cobia) Documentation content.

Fork the Repo

To submit a change or a new article, create a fork (local copy) of the main repository, edit your local copy, and then propose merging your changes back into the main repository.

To start, click the Edit Page link in the top right of the site.

To fork the repo to your GitHub account, click the green Fork this repository button.

Syncing an Existing Fork

When you already have a fork of the documentation repository, we recommend you sync your fork before continuing on to make changes. This updates your local copy with changes made to the main repository after you forked it.

  1. Open your fork repository, typically found by opening the GitHub profile drop-down and clicking Your repositories.
  2. Find the sync status bar and click Pull request.
  3. Set the base repository to your fork and the head repository to truenas/documentation. You might need to click compare across forks first.
  1. Click Create pull request and continue to merge the pull request.

Edit the page as needed.

When the changes are complete, add a quick overview of the changes made in the** Description** box, and click the green Commit changes button.

When the page refreshes the changes are complete in your forked repository. Now you can request merging these changes to the main repository using a pull request (PR). Click on Pull Requests.

After the Pull Requests page opens, click the green New Pull Request button.

Confirm that the base repository is set to truenas/documentation and base is set to master or the version branch you are changing (i.e., if you are using 24.04, set that as the base). Set head repository to your forked repository, for example, q5sys/documentation. Set compare to master, or the version branch if proposing changes to either of those branches. Ensure these options are correct, then click the green Create pull request button to create the PR.

Describe your changes and click the green Create pull request button.

That is it! Other contributors review and merge your changes!

As part of the review process, automation builds a preview of the docs site with your changes. When the build completes, a comment appears in the PR that shows the automation result. Click on Show all checks and Details to see a live demo of the site with your changes.

Adding a New Article

Thanks for your interest in submitting documentation articles! This article shows you how to add a new article to the TrueNAS Documentation Hub. All that is required is a GitHub account and your favorite text editor. Taking screenshots for your article is also recommended.

To add an article, construct a bundle that contains your text file and any images, then open a pull request on the repository. There is an Article Template available that can simplify creating your article.

Creating an Article Bundle

Find a place on your local system to create a directory for your article. Name the directory according to the title of your article.

Open the directory and create a new file called index.md. This file contains all the text for your article.

Writing the Article

The first few lines of the index.md are reserved for an intro block called the “front matter” that contains the document title and other information. For example, this article uses basic front matter:

---
title: "Adding a New Article"
weight: 20
---

After setting the front matter, continue writing your article. Raw text is supported, or you can add Markdown syntax. Markdown is designed to be easy to write and read, but also supports directly adding HTML elements. See the Style Guide for syntax help and other suggestions for writing the article. You can generally style the article however you like, but please be aware that other contributors can review the article and change the styling.

Adding Images

If you want to include screenshots of the TrueNAS User Interface with your article, add these files to your article bundle. Be sure to have unique names for each image file.

Uploading the Article Bundle

Open the appropriate repository section for the new content article.

Click Upload files and drag and drop the article bundle directory into the repository. GitHub shows all the files to upload.

Opening a Pull Request

Note

Forking the repository might be needed as part of opening a Pull Request.

Make sure all your files have been uploaded then scroll down to the Commit changes section and write a summary and description of your changes. Select Create a new branch for this commit and start a pull request. and click Propose changes. GitHub can take a few moments to process the files.

Make sure you’re happy with the summary and description of your article, then click Create pull request.

After the pull request is created, the repository automatically builds a preview of the documentation site that has your changes included. The link to this preview is added to the Pull Request after the build completes.

Other contributors will review and merge your article!

Article Template

This template provides general information on constructing and writing TrueNAS tutorial articles. It contains a template example article with front matter, styling, and syntax examples.

Refer to the Style Guide for specific text syntax and formatting examples, Markdown and Hugo website enhancements, and content guidelines to follow.

Application tutorials follow a specific format that covers the installation screens and deployment process. If submitting a tutorial for a community-maintained application article, please see Contributing to Apps and the Community App Tutorial Template at the TrueNAS Apps Market.

Front Matter

Every article needs a front-matter section that contains these parameters:

  • title for the article title.
  • description that provides a summary of the article content. Keep the description to less than 160 characters. The character count includes spaces between alphanumeric and special characters.
  • weight that orders the article in the table of contents.

Optional front matter parameters are:

  • aliases where you include links to articles removed from the website that should be directed to this page.
  • tags where you include a single word or a few word flags for the article content. Tags are used internally to pull articles into the Related Articles sections at the bottom of articles and externally for search optimization.

Article Template

Feel free to copy this article template example and rework it when writing your articles for this website. You can copy the template/ directory to provide a starting point for contributing an article or article bundle that includes links to images.

---
title: "Example Article"
description: "This is a template for any tutorial article on the Documentation Hub website."
weight: 5
---

This is an introductory paragraph for the article.
It should explain the purpose of the procedure, describe what the feature is or can be used to accomplish, and can include links to other websites about the article subject or that support the procedure the article covers.
The introduction typically includes an explanation of why this procedure is beneficial and/or who is the typical audience for this content.
When the procedure is advanced, users might want some references to other sources that have more details or deeper explanations about what the system is doing.

After introducing the material, describe the process to accomplish the task.
Writing in short, declarative sentences that are structured very simply can help readers avoid confusion.
It also makes translations easier!

## Prerequisites
This section can be titled **Prerequisites**, **Before You Begin**, or **First Steps**.
It should cover actions the reader should or must take before they begin the procedure detailed in the article.

Typical first steps might include configuring data storage, adding certificates, and creating user accounts on the TrueNAS system or remote provider if describing a procedure involving a third party.

## How to Do *X*

Begin outlining the procedure steps.
The first step is typically to log in to the system and go to a location like **System > General**.
Including a screenshot is a good way for the reader to confirm they are in the correct location and to get more context.

{{\< trueimage src="/docs/images/SCALE/imagename.png" alt="Image Name Text" id="Image Name Text" >}}

{{\< hint type="danger" >}}
Danger, information, and warnings admonition boxes include information about common errors that are made during the procedure.
These admonitions are best placed before listing out any specific changes to make to the system.
This can help prevent mistakes and educate the reader about common troubleshooting steps.
{{\< /hint >}}

The step procedure should not exceed a maximum of 10 steps in an ordered list.
If the procedure exceeds 10 steps, use sub-steps.
A good practice is to organize the procedure into what to do and how to do it steps.
What steps are the primary list items, and the how to do it are the sub-step items.

Enter screen names and fields on screens in **bold** and a variable value in *italics*.

Be precise with buttons or setting names to avoid confusing the reader.

### Entering Commands

Sometimes a user might need to open a shell to enter a command.
To avoid confusing readers, use either the back backtick or HTML <code> and </code> tags for any command name or string.
If the command string includes a variable, use the HTML <code> and <i> open and close tags to show the string properly formatted.
Do not use all caps for a command or variable, or brackets to enclose a variable.
Some CLI and API command syntax might require the square or curly brackets as part of the string and some commands or command values are case sensitive.

Use inline and multi-line code blocks to define exactly what to type and show an example of the output.
Entering `ifconfig` shows more information about the network interfaces:
```
root@freenas[~]# ifconfig
em0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        ether 00:1b:21:7e:70:ca
        hwaddr 00:1b:21:7e:70:ca
        inet 1.234.56.789 netmask 0xffc11 broadcast 1.234.56.789
        nd6 options=1<PERFORMNUD>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
```

## Final Steps

Make sure to include any final steps the user can take to confirm they executed the procedure correctly.
Be specific!
Using vague terms can mislead or confuse the reader. Do not assume the reader knows what you are talking about.
Instead, directly state what happens. for example:
"Click *Generate Debug* to compile the system information into a *.tar* file.
A dialog opens to download the file to your local system."

This is a good place to put any troubleshooting tips, in case the user is not seeing the expected result.

If a command or setting should produce a specific result, provide that information.
If the command or setting does not produce the result provide information on what that means and how to correct or resolve the problem.