Writing Documentation with Markdown
This guide will teach you how to write documentation using Markdown and manage your content using Git and GitHub Desktop.
Getting Started
Prerequisites
- GitHub Account
- GitHub Desktop
- A text editor (we recommend VS Code)
Setting Up Your Environment
-
Clone the Repository
- Open GitHub Desktop
- Go to File > Clone Repository
- Select the documentation repository
- Choose a local path
- Click "Clone"
-
Open in VS Code
- In GitHub Desktop, click "Open in Visual Studio Code"
- Install recommended extensions:
- Markdown All in One
- markdownlint
Writing Documentation
File Structure
Documentation files should be organized as follows:
docs/
├── category-name/
│ ├── _category_.json
│ ├── index.md
│ └── article.md
└── another-category/
├── _category_.json
└── index.md
Creating New Content
-
Create a New File
- Create a
.md
file in the appropriate directory - Use lowercase with hyphens for filenames (e.g.,
getting-started.md
)
- Create a
-
Add Frontmatter
---
id: unique-id
title: Your Page Title
sidebar_label: Sidebar Label
sidebar_position: 1
---
Markdown Syntax
Headers
# H1 Title
## H2 Subtitle
### H3 Section
#### H4 Subsection
Text Formatting
**Bold text**
*Italic text*
~~Strikethrough~~
`inline code`
Lists
- Unordered list item
- Another item
- Nested item
1. Ordered list item
2. Second item
1. Nested ordered item
Links and Images
[Link text](https://example.com)

Code Blocks
```python
def hello_world():
print("Hello, World!")
```
Tables
| Header 1 | Header 2 |
|----------|----------|
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4 |
Admonitions
:::note
This is a note
:::
:::tip
This is a tip
:::
:::warning
This is a warning
:::
:::danger
This is a dangerous warning
:::
:::info
This is useful information
:::
Advanced Features
Tabs
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs>
<TabItem value="windows" label="Windows">
Windows-specific content
</TabItem>
<TabItem value="mac" label="macOS">
macOS-specific content
</TabItem>
</Tabs>
Details
<details>
<summary>Click to expand!</summary>
Hidden content here...
</details>
LaTeX Math
Math expression in a line: $\sum_{i=1}^n x_i$
Math expression in a block:
$$
\sum_{i=1}^n x_i
$$
Managing Changes
Using GitHub Desktop
-
Making Changes
- Open the repository in VS Code
- Make your changes
- Save the files
-
Committing Changes
- Open GitHub Desktop
- Review your changes
- Write a descriptive commit message:
- Summary: Brief description (50 chars or less)
- Description: Detailed explanation if needed
- Click "Commit to main"
-
Pushing Changes
- Click "Push origin" to upload your changes
- Your changes will be deployed automatically
Best Practices
-
Commit Messages
- Use clear, descriptive messages
- Start with a verb (Add, Update, Fix, etc.)
- Example: "Add installation guide for Windows users"
-
File Organization
- Keep related files together
- Use meaningful directory names
- Include images in an
images
subdirectory
-
Content Guidelines
- Write clear, concise content
- Use proper heading hierarchy
- Include code examples when relevant
- Add screenshots for visual guidance
- Break long pages into sections
- Use admonitions to highlight important information
Previewing Changes
-
Using VS Code Preview
- Open your Markdown file
- Press
Ctrl+Shift+V
(Windows/Linux) orCmd+Shift+V
(Mac) - Preview updates as you type
-
Using Local Development Server
- Follow the Local Testing Guide
- Changes appear in real-time
Common Issues and Solutions
-
Images Not Displaying
- Check file path is relative to the Markdown file
- Verify image exists in the specified location
- Ensure correct file permissions
-
Formatting Problems
- Use markdownlint to check for issues
- Verify frontmatter syntax
- Check for proper indentation
-
Deployment Issues
- Verify all files are committed
- Check build logs in Netlify
- Ensure no broken links
Remember: Always preview your changes locally before pushing them to ensure everything looks correct.