Readme Nav Command
Scrapes a readme.io documentation site, expands all collapsed sidebar sections, and converts the sidebar into Mintlify navigation JSON ready to paste into docs.json.
Usage
wcc readme nav [url] [options]
The url argument is optional if readme.url (or source) is set in config.json.
Arguments
| Argument | Description |
|---|---|
[url] | URL of the readme.io docs or API reference page (e.g. https://docs.example.com/docs or https://docs.example.com/reference) |
Options
| Option | Description | Default |
|---|---|---|
-o, --output <file> | Output file for the navigation JSON | nav.json |
--links-dir <dir> | Directory for external link stub files | links |
--no-links | Skip writing stub files for external sidebar links | false |
--quiet | Suppress terminal output | false |
How it works
- Opens the URL in a headless Chromium browser using Playwright.
- Clicks every collapsed sidebar button until all sections are expanded.
- Parses the fully-expanded
nav.rm-Sidebarelement. - Converts each
rm-Sidebar-sectioninto a Mintlify navigation group. - Writes the result as a JSON array to
--output.
Sidebar links are collected whether they point to a guides project (/docs/...) or an API reference project (/reference/...) — readme.io uses /reference/ for both standalone reference sites and OpenAPI-backed endpoint pages. Links under any other prefix (e.g. /changelog/...) are skipped.
External links (those with target="_blank") are written as stub .mdx files under --links-dir, each containing a url frontmatter field that Mintlify can use as an external link entry.
Output format
The command writes a JSON array of navigation groups:
[
{
"group": "Getting Started",
"pages": [
"docs/quickstart",
{
"group": "Guides",
"root": "docs/guides",
"pages": ["docs/guides/first-steps", "docs/guides/advanced"]
}
]
}
]
A nested group only has a root field when its own sidebar link points to a distinct overview page. Many readme.io API reference groups instead set the group link's href to the same page as their first subpage (no dedicated overview page) — in that case root is omitted so the page isn't duplicated between root and pages.
Paste this array as the value of navigation.groups (or a tab's pages) in your docs.json.
Config file
Set defaults in config.json so you can run wcc readme nav without arguments:
{
"readme": {
"url": "https://docs.example.com/docs",
"output": "nav.json",
"links-dir": "links",
"no-links": false,
"quiet": false
}
}
The source top-level key is also used as a fallback URL if readme.url is not set.