Skip to main content

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

ArgumentDescription
[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

OptionDescriptionDefault
-o, --output <file>Output file for the navigation JSONnav.json
--links-dir <dir>Directory for external link stub fileslinks
--no-linksSkip writing stub files for external sidebar linksfalse
--quietSuppress terminal outputfalse

How it works

  1. Opens the URL in a headless Chromium browser using Playwright.
  2. Clicks every collapsed sidebar button until all sections are expanded.
  3. Parses the fully-expanded nav.rm-Sidebar element.
  4. Converts each rm-Sidebar-section into a Mintlify navigation group.
  5. 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.