Create documentation

How to create new documentation file

2024-09-04
2 min read
Roberto

The extension for your documentation files is .mdx, which allows you to write them using Markdown syntax, enhanced with custom extras by Docshub. To begin creating a new document, you can choose from several options:

Using the CLI

You can use the CLI to create a new Markdown file. To do this, run the following the CLI docs:

DocsHub CLI Simplify your workspace setup, Docker configuration, and content creation with a single command.
Getting Started
2024-09-04

Creating a new document manually

  1. Create a new file in the src/docs (source code) or /docs volume (docker) directory with the .mdx extension.
# Source code:
src/docs/example.mdx

# Docker:
./docs/example.mdx
  1. At the beginning of the document, make sure to include the following parameters:
---
title: "Example Document"
sidebarTitle: "Example Document"
description: "Example Document description"
publishDate: "2024-09-04"
---

## Example Heading
  1. Write your content in the document using Markdown syntax. Also, you can use the following components:

Params

The following table lists all the fields available to use in the header of your .mdx files in DocsHub:

FieldDescriptionExample
titleThe main title of the document."Your Title Here"
sidebarTitleThe title displayed in the sidebar menu."Your Sidebar Title"
descriptionA brief description of the document."A brief description of the document."
publishDateThe publication date of the document."2024-09-04"
author.nameThe name of the document’s author."Your Name"
author.urlA link to the author’s profile or website."https://your-profile-link.com"
---
title: "Example Document"
sidebarTitle: "Example Document"
description: "Example Document description"
publishDate: "2024-09-04"
category: "Example"
author: { name: "Example", url: "https://docshub.vercel.app/" }
---

## Example Heading