Markdown Style Guide [AIR-1][AIT-1]¶
Table of Contents¶
Overview¶
This guide defines the standard markdown formatting rules for all documentation in the Anya Core project. Following these guidelines ensures consistency across our documentation and prevents common markdownlint issues.
General Rules¶
- File Names: Use lowercase with underscores for spaces (e.g.,
getting_started.md, notGetting Started.md) - Line Length: No line length restrictions (handled by markdownlint config)
- Line Endings: Use LF (
\n), not CRLF (\r\n) - File Encoding: UTF-8 without BOM
- Final Newline: Include a final newline at the end of each file
Headers¶
- Single H1: Each document should have exactly one H1 header at the top
- No Skipping Levels: Don't skip header levels (e.g., H2 should follow H1, not H3)
- Spacing: Include a blank line before and after headers
- Capitalization: Use title case for headers (e.g., "Getting Started Guide" not "Getting started guide")
- AI Labelling: Escape AI labelling tags in headers with backslashes:
# Component Name \[AIR-3\]\[AIS-3\]
Lists¶
- Indentation: Indent nested lists with 2 or 4 spaces
- Spacing: Include a blank line before and after lists
- Consistency: Use either all ordered (
1.) or all unordered (-) for the same level
Code Blocks¶
- Fenced Code Blocks: Use triple backticks with language specification
- Indentation: Don't indent code blocks with spaces
- Syntax Highlighting: Always specify the language for syntax highlighting
Links and Images¶
- Link Text: Use descriptive link text, not "click here" or URLs
- Image Alt Text: Always include descriptive alt text for images
- Relative Links: Use relative links for internal documentation
[API Documentation](../api/README.md)

Tables¶
- Headers: Always include a header row
- Alignment: Use colons to specify column alignment (
:---left,:---:center,---:right) - Spacing: Include a blank line before and after tables
| Name | Type | Description |
|------|:----:|------------:|
| id | string | Unique identifier |
| count | number | Number of items |
AI Labelling Tags¶
- Escaping: Always escape AI labelling tags to prevent markdownlint errors
- Position: Place AI labelling tags after the title/header
- Format: Follow the AI Labelling Guide format:
\[CATEGORY-LEVEL\]
Comments¶
- HTML Comments: Use HTML comments for notes that shouldn't appear in rendered markdown
- Markdownlint Directives: Place markdownlint directives in HTML comments at the top of the file
Frontmatter¶
- Format: Use YAML format between triple-dash lines
- Required Fields: Include at least
titleanddatefields - Position: Place frontmatter at the very beginning of the file
---
title: "Markdown_style_guide"
date: 2025-03-12
author: Anya Documentation Team
last_updated: 2025-05-30
---
[AIR-3][AIS-3][BPC-3][RES-3]
Admonitions¶
Use the following format for admonitions (notes, warnings, etc.):
> **Note:** This is important information that should be highlighted.
> **Warning:** This warns about potential issues or dangers.
> **Tip:** This provides helpful advice for better usage.
Automated Linting¶
We use markdownlint to enforce these guidelines. The configuration is in .markdownlint.json at the project root.
To automatically fix common issues:
## Install markdownlint-cli2 if not already installed
npm install --save-dev markdownlint-cli2
## Run the fixing script
node scripts/fix_markdown.js docs
Last Updated¶
2025-03-12