📋 Essential: All contributions must follow the PaperMoon Style Guide.
There are two main ways to contribute:
-
- Best for simple text changes like fixing typos or making small updates directly in your browser.
-
- Recommended for more complex contributions that require local testing or previewing changes.
For simple contributions like fixing typos or making small text changes, you can use GitHub's online editor.
- Navigate to the file you want to edit on GitHub.
- Click the pencil icon (✏️) to edit the file.
- Make your changes in the online editor.
- Follow the PaperMoon Style Guide.
- Scroll to Propose changes at the bottom of the editor.
- Add a descriptive commit message explaining your changes.
- Click Propose changes. GitHub will automatically:
- Fork the repository to your account.
- Create a branch with your changes.
- Open a pull request.
- Make sure to check Allow edits from maintainers.
For more complex contributions, which involve rendering (e.g., adding a .nav.yml section, code snippets, etc) or when you want to preview changes locally.
Before making contributions, set up the monorepo locally:
-
Fork the
polkadot-docsrepository on GitHub. -
Clone your fork:
git clone https://github.com/YOUR_USERNAME/polkadot-docs.git cd polkadot-docs -
Create a branch for your changes:
git checkout -b YOUR_FEATURE_BRANCH
-
Make your changes:
- Follow the PaperMoon Style Guide.
- Test your changes locally (see Run Polkadot Docs Locally).
-
Create pull request:
- Push your branch and create a pull request.
- Use the PR template to indicate your review preference.
Making changes to existing pages is the simplest contribution:
- Edit the content: Make your improvements directly to the existing markdown file.
- Follow style guide: Ensure your changes maintain proper formatting according to the PaperMoon Documentation Style Guide.
- Test locally: Verify your changes render correctly by running the Polkadot docs locally. Instructions can be found in the README.
Requirement: Follow the PaperMoon Documentation Style Guide.
To add a page to an existing section:
-
Create your markdown file following naming conventions.
-
Include required frontmatter (see Frontmatter Reference for all available fields):
--- title: Page Title (max 60 chars for SEO) description: Description for SEO (120-160 chars). categories: Category1, Category2 --- # Page Title ## Introduction Write 2-3 paragraphs to introduce the topic. ## Prerequisites List any required tools, knowledge, or setup.
Categories
Available categories for pages are listed in the
categories_infosection ofllms_config.jsonat the repository root.Search Engine Optimization (SEO)
Resources for good SEO:
-
Add your page to the
.nav.ymlfile in the same directory:- 'Your Page Display Name': 'your-file-name.md'
To create an entirely new section of documentation:
-
Create directory structure:
your-new-section/ ├── .nav.yml ├── index.md └── your-first-page.md -
Create
.nav.yml:title: Section Display Name nav: - 'Overview': index.md - 'Page Display Name': 'file-name.md' - subdirectory-name
title: Displayed in left navigationindex.md: Always first in nav list (if exists)- Files:
'Display Name': 'file-name.md' - Subdirectories: Listed by directory name
-
Create the
index.mdlanding page with frontmatter and content introducing the section.
This section covers tutorial-specific requirements and formatting.
Requirement: Follow the PaperMoon Documentation Style Guide.
Place your tutorial under the most relevant existing section of the docs. Set up file and asset paths to match the surrounding structure:
docs/<section>/<subsection>/<tutorial-name>.md
docs/images/<section>/<subsection>/<tutorial-name>/
docs/.snippets/code/<section>/<subsection>/<tutorial-name>/
---
title: Tutorial Title (max 60 chars)
description: Description 120-160 chars.
categories: Category1, Category2
page_badges:
tutorial_badge: Beginner | Intermediate | Advanced
---
# Tutorial Title
## Introduction
Brief explanation of what users will learn/build.
## Prerequisites
Required knowledge/tools.
## [Action-Oriented Section Title]
Instructions with commands.
## Verification
How to confirm it worked.
## Where to Go Next
Related tutorials.See Frontmatter Reference for a full list of available frontmatter fields.
- All code examples must be tested and functional.
- Always specify dependency versions (e.g.,
npm install polkadot-api@1.16.0). - Use action-oriented section titles.
- Include verification steps.
Where to store: docs/images/<path-matching-doc-structure>/
Requirements:
- Format:
.webp - Desktop screenshots: 1512px width, variable height
- Browser extension screenshots: 400x600px
How to use:
Adding annotations:
Use assets from the .assets/annotations directory:
- Arrows: Highlight single elements
- Steps: Highlight multiple elements (use numbers for numbered lists, letters for alphabetical lists)
Purpose: For any code used on the page or for reuse of text across multiple pages while maintaining it in one place.
Where to store: docs/.snippets/code/<path-matching-doc-structure>/<snippet-name>
How to use:
--8<-- 'code/<subdirectory>/<snippet-file-name>.js:10:20'File types:
- Text snippets:
.mdfiles for reusable copy - Code snippets: Use appropriate language extension (
.js,.py, etc.)
Learn more about snippets syntax.
Use these to highlight important information:
!!! tip
Helpful tips and shortcuts.
!!! note
Important information to remember.
!!! warning
Potential issues or caveats.Purpose: Display terminal/command output in a visual format that simulates a terminal session.
When to use: Anytime you need to show command output or terminal interactions in the documentation.
Basic syntax:
<div class="termynal" data-termynal>
<span data-ty="input"><span class="file-path"></span>your-command-here</span>
<span data-ty="progress"></span>
<span data-ty>Output line 1</span>
<span data-ty>Output line 2</span>
</div>
Every page begins with a YAML frontmatter block between --- delimiters. The fields below are all supported options.
| Field | Description |
|---|---|
title |
Page title. Keep to 60 characters or fewer for good SEO. |
description |
Meta description shown in search results. Aim for 120–160 characters. |
categories |
Comma-separated list of content categories used to group AI artifacts. Valid values are defined in llms_config.json. |
| Field | Type | Description |
|---|---|---|
short_description |
string | A shorter description used in auto-generated index tables (falls back to description if absent). |
tools |
string or list | Tools used on the page, shown in index tables. Accepts a comma-separated string or a YAML list. |
hide |
list | Hides page elements. Accepted values: navigation (hides left nav), toc (hides table of contents). |
template |
string | Overrides the page template. Only used on the homepage (home.html). |
footer_nav |
bool or int | Adds the page to the footer navigation. Use true to include in discovery order, or an integer for explicit ordering (lower numbers appear first). |
extra_javascript |
list | Additional JavaScript files to load on this page only. Used to activate interactive widgets. |
extra_css |
list | Additional CSS files to load on this page only. Used alongside extra_javascript for interactive widgets. |
page_badges |
object | Displays difficulty and CI status badges in the page header. See page_badges below. |
page_tests |
object | Links a test file to the page, shown as a "View tests" link. See page_tests below. |
toggle |
object | Groups pages into a switchable variant toggle (e.g. EVM vs PVM). See toggle below. |
Displays badge labels in the page header.
page_badges:
tutorial_badge: Beginner # or Intermediate, Advanced
test_workflow: workflow-name # filename of the GitHub Actions workflow (without .yml)tutorial_badge— renders a difficulty badge:Beginner,Intermediate,Advanced. Also used by index tables for the Difficulty column.test_workflow— links to a GitHub Actions status badge for the named workflow. Workflows must exist in thepolkadot-developers/polkadot-cookbookrepository under.github/workflows/.
Links a test file to the page, displayed as a "View tests" link in the page header. The path is relative to the root of the polkadot-developers/polkadot-cookbook repository.
page_tests:
path: polkadot-docs/path/to/tests/docs.test.tsPowers the page toggle feature, which groups related pages and lets readers switch between variants (e.g. EVM vs PVM) without leaving the section. All pages in a group must share the same group value.
toggle:
group: my-group-name # shared identifier across all pages in the toggle
variant: evm # this page's variant identifier
label: EVM # label shown on the toggle button
canonical: true # mark one page as canonical (the default shown in nav)