@mintlify/cli 4.0.1763 → 4.0.1764

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/__test__/migrate.test.ts +186 -0
  2. package/__test__/validateRules.test.ts +36 -0
  3. package/bin/cli.js +35 -0
  4. package/bin/migrate.js +54 -0
  5. package/bin/tsconfig.build.tsbuildinfo +1 -1
  6. package/bin/validate/files.js +16 -4
  7. package/bin/validate/mdx.js +1 -1
  8. package/migrate/index.md +56 -0
  9. package/migrate/sources/confluence.md +120 -0
  10. package/migrate/sources/docsify.md +128 -0
  11. package/migrate/sources/document360.md +117 -0
  12. package/migrate/sources/docus.md +136 -0
  13. package/migrate/sources/docusaurus.md +143 -0
  14. package/migrate/sources/fern.md +130 -0
  15. package/migrate/sources/fumadocs.md +141 -0
  16. package/migrate/sources/gitbook.md +120 -0
  17. package/migrate/sources/github-wiki.md +90 -0
  18. package/migrate/sources/jekyll.md +104 -0
  19. package/migrate/sources/mdbook.md +98 -0
  20. package/migrate/sources/mkdocs.md +113 -0
  21. package/migrate/sources/nextra.md +144 -0
  22. package/migrate/sources/notion.md +99 -0
  23. package/migrate/sources/nuxt.md +113 -0
  24. package/migrate/sources/pdf.md +99 -0
  25. package/migrate/sources/readme.md +118 -0
  26. package/migrate/sources/redocly.md +114 -0
  27. package/migrate/sources/starlight.md +136 -0
  28. package/migrate/sources/vitepress.md +143 -0
  29. package/migrate/sources/vuepress.md +153 -0
  30. package/migrate/topics/api.md +76 -0
  31. package/migrate/topics/changelog.md +47 -0
  32. package/migrate/topics/conversion.md +194 -0
  33. package/migrate/topics/discovery.md +93 -0
  34. package/migrate/topics/navigation.md +82 -0
  35. package/migrate/topics/verify.md +58 -0
  36. package/package.json +10 -10
  37. package/src/cli.tsx +47 -0
  38. package/src/migrate.ts +76 -0
  39. package/src/validate/files.ts +23 -3
  40. package/src/validate/mdx.ts +1 -1
@@ -0,0 +1,120 @@
1
+ # GitBook
2
+
3
+ Hosted GitBook sites (`*.gitbook.io` or a custom domain) and GitBook content synced to GitHub or GitLab. GitBook calls each content container a section (older docs: space); a site publishes one or more sections, each optionally with variants.
4
+
5
+ ## Detect
6
+
7
+ - Rendered HTML has `<meta name="generator" content="GitBook ...">` and loads assets from `/~gitbook/static/` and `/~gitbook/image`.
8
+ - `<page-url>.md` returns markdown containing `{% hint %}`, `{% tabs %}` or `<figure>` blocks.
9
+ - In a repo: `.gitbook.yaml`, `SUMMARY.md`, `.gitbook/assets/`, `.gitbook/includes/`, or `gitbook-docs.yaml`.
10
+
11
+ ## Get the source
12
+
13
+ ### From the repo
14
+
15
+ A Git Sync repo, one per section and variant. Layout:
16
+
17
+ - `.gitbook.yaml`: `root` (content directory, default `./`), `structure.readme` (default `README.md`), `structure.summary` (default `SUMMARY.md`), `redirects`. Resolve all paths relative to `root`. Reference: https://gitbook.com/docs/docs-as-code/git-sync/content-configuration
18
+ - `SUMMARY.md`: the navigation and the inventory.
19
+ - `.gitbook/assets/`: uploaded images and files. `.gitbook/includes/`: reusable content. `.gitbook/vars.yaml`: section variables.
20
+ - `gitbook-docs.yaml`, when present, maps the site's sections to directories.
21
+
22
+ ### From an export
23
+
24
+ The export is the Git Sync repo. The customer enables Git Sync per section with the direction GitBook → GitHub/GitLab into an empty repo, then gives you a clone. The opposite direction overwrites their GitBook content; tell them to confirm the direction. Repeat for every published section and variant. Steps: https://www.mintlify.com/docs/migration/gitbook.md
25
+
26
+ ### From the live site
27
+
28
+ Every published page serves raw markdown at `<page-url>.md`; `llms.txt` and `llms-full.txt` list pages. `sitemap.xml` is a `<sitemapindex>` with one `sitemap-pages.xml` per section and language. Quirks (`mint migrate --topic discovery`, Mirror the raw source):
29
+
30
+ - The site or section root does not answer on `<root>.md`; fetch `<root>/readme.md`.
31
+ - Strip the leading `> For the complete documentation index, see [llms.txt]...` line and everything from `\n---\n# Agent Instructions...` to end of file.
32
+ - Published `.md` shows variable expressions, not their values. Resolve them from the rendered page.
33
+
34
+ Private sections, unpublished changes and reusable-content source are not reachable here (`mint migrate --topic discovery`, Gated content).
35
+
36
+ ## Config → docs.json
37
+
38
+ GitBook site customization is not in the repo. Read it from the published HTML.
39
+
40
+ | GitBook | docs.json |
41
+ | -------------------------------------------------------- | -------------------------------------------------------------- |
42
+ | Site title | `name` |
43
+ | Logo (light/dark) | `logo.light`, `logo.dark` |
44
+ | Site icon / favicon | `favicon` |
45
+ | Primary / tint color | `colors.primary` |
46
+ | Header links | `navbar.links` |
47
+ | Footer links | `footer.links` |
48
+ | Sections shown as top-level tabs | `navigation.tabs` |
49
+ | Variants used for versions | `navigation.versions` if the customer migrates them |
50
+ | Variants used for languages | `navigation.languages` if the customer migrates them |
51
+ | `.gitbook/vars.yaml` variables | `variables` (`mint migrate --topic conversion`, Template tags) |
52
+ | `.gitbook.yaml` `redirects` and site-level redirects | `redirects` (see URLs and redirects) |
53
+ | Site sharing, visitor auth, adaptive content | drop and report |
54
+ | Integrations (analytics, chat, feedback), custom scripts | drop and report |
55
+ | Search and AI assistant settings | drop and report |
56
+
57
+ ## Navigation
58
+
59
+ Walk `SUMMARY.md`. Without a repo, rebuild the same tree from the rendered sidebar of each section.
60
+
61
+ - `## Heading` lines become groups, in order.
62
+ - `* [Title](path.md)` becomes a page; indented children make it a nested group whose own page goes first.
63
+ - `[Title](path.md "Label")`: the quoted text is the sidebar label (`mint migrate --topic conversion`, Frontmatter).
64
+ - External links become navigation links where Mintlify supports them.
65
+ - Pages with frontmatter `hidden: true` stay reachable but out of navigation; (`mint migrate --topic navigation`, Structure rules).
66
+ - Page frontmatter `icon` maps to the page `icon` (`mint migrate --topic conversion`, Icons).
67
+
68
+ ## Content conversion
69
+
70
+ Run these in order on every file. Match every `{% ... %}` with a non-greedy pattern such as `\{%[\s\S]*?%\}`, never `\{%[^%]*%\}`, because attribute values contain URL-encoded `%`.
71
+
72
+ | GitBook | Mintlify |
73
+ | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
74
+ | `{% hint style="info" %}` | `<Info>` |
75
+ | `{% hint style="success" %}` | `<Check>` |
76
+ | `{% hint style="warning" %}` | `<Warning>` |
77
+ | `{% hint style="danger" %}` | `<Danger>` |
78
+ | `{% tabs %}{% tab title="X" %}` | `<Tabs><Tab title="X">` |
79
+ | `{% stepper %}{% step %}` | `<Steps><Step title="...">`; title from the step's first heading or bold line, else `Step N` |
80
+ | `{% columns %}{% column %}` | `<Columns>` |
81
+ | `{% code title="f.js" lineNumbers="true" overflow="wrap" %}` around a fence | fence with `title="f.js"`, `lines`, `wrap` |
82
+ | `<details><summary>X</summary>` | `<Accordion title="X">` |
83
+ | `<table data-view="cards">` | `<CardGroup>` of `<Card>`; target from the `data-card-target` column |
84
+ | `{% content-ref url="x.md" %}` (and legacy `{% page-ref %}`) | `<Card>` linking to the page |
85
+ | `{% embed url="X" %}` | YouTube/video embed if supported, else a link `[X](X)` |
86
+ | `{% file src="X" %}` | download link to the copied file |
87
+ | `{% include "../.gitbook/includes/x.md" %}` | snippet (`mint migrate --topic conversion`, Reusable content) |
88
+ | `{% updates %}` entries | `<Update>` (see `mint migrate --topic changelog`) |
89
+ | `<code class="expression">space.vars.X</code>`, `page.vars.X` | `{{X}}` (`mint migrate --topic conversion`, Template tags) |
90
+ | `$$...$$` | LaTeX, unchanged |
91
+ | `<a class="button primary" href>` | plain link; report |
92
+ | `<mark style="color:...">text</mark>` | `text` |
93
+ | `<figure><img src alt><figcaption>` / `<picture><source srcset>` | image with alt; keep a non-empty caption in `<Frame caption>` |
94
+
95
+ Then:
96
+
97
+ - Convert `<div data-gb-custom-block data-tag="hint|tabs|tab" ...>` variants to the same components as their `{% %}` forms, then drop remaining `data-gb-custom-block` openers and their closers.
98
+ - Strip any `{% ... %}` still present after mapping.
99
+ - Unescape GitBook backslash escapes (`\[ \] \( \) \{ \} \_ \*`) before MDX escaping.
100
+ - Remove the empty heading anchors GitBook emits (`<a href="#x" id="x"></a>` inside or above headings). GitBook heading ids differ from Mintlify's (`mint migrate --topic conversion`, Heading IDs).
101
+
102
+ ## Assets
103
+
104
+ - Repo: copy `.gitbook/assets/` into `images/` keeping relative structure. Asset filenames often contain spaces and parentheses (`mint migrate --topic conversion`, Images and files).
105
+ - Live site: images appear as `/files/<id>`, `https://<n>-files.gitbook.io/~/files/v0/b/...?alt=media&token=...` and `/~gitbook/image?url=<encoded>` (a resized proxy; decode `url=` for the original).
106
+ - `/files/<id>` URLs that 404 on the site usually exist in `.gitbook/assets/`; recover them from the repo before reporting them missing.
107
+
108
+ ## URLs and redirects
109
+
110
+ - Page URLs come from the `SUMMARY.md` hierarchy, not file paths. Keep each page at its published path; `README.md` pages publish at the directory path (`mint migrate --topic conversion`, Files).
111
+ - Scraped markdown links pages by id: `/pages/<id>` and `/spaces/<id>/pages/<id>`. Resolve them from the rendered page links (`mint migrate --topic conversion`, Links).
112
+ - Convert `.gitbook.yaml` `redirects` (old path → file) to `redirects`, prefixing the section path, because GitBook scopes them to one section (`mint migrate --topic navigation`, Redirects). Ask the customer for site-level redirects; they are not in the repo.
113
+ - The default variant may be served without its slug; add redirects for both forms.
114
+
115
+ ## Known gaps
116
+
117
+ - Visitor authentication, adaptive content and site sharing settings.
118
+ - OpenAPI blocks: specs live at organization level, not in the section export. Ask the customer for the spec file or URL; then follow `mint migrate --topic api`.
119
+ - Buttons, inline icons (`<i class="fa-...">`), and integration blocks with no equivalent.
120
+ - Reusable content owned by a section outside the export.
@@ -0,0 +1,90 @@
1
+ # GitHub Wiki
2
+
3
+ ## Detect
4
+
5
+ - The user names a wiki or gives `https://github.com/<owner>/<repo>/wiki`. A wiki is a separate git repository; nothing in the main repo signals it.
6
+ - In a clone: the remote ends in `.wiki.git`; `Home.<ext>` at the root; optional `_Sidebar.<ext>` and `_Footer.<ext>`; files named like page titles; `[[...]]` links; no config file.
7
+ - Not a wiki: Docsify, which uses a lowercase `_sidebar.md` beside an `index.html` that sets `window.$docsify`. Check real filename case with `git ls-files`.
8
+
9
+ ## Get the source
10
+
11
+ ### From the repo
12
+
13
+ - `git clone https://github.com/<owner>/<repo>.wiki.git`. Only the default branch is published.
14
+ - Every file in a markup format GitHub renders is a page (https://github.com/github/markup#markups). Convert non-Markdown pages to Markdown first (for example `pandoc -t gfm`).
15
+
16
+ ### From an export
17
+
18
+ None; use the `.wiki.git` clone.
19
+
20
+ ### From the live site
21
+
22
+ GitHub's own page list: `https://github.com/<owner>/<repo>/wiki/_pages`. Use the clone for sources.
23
+
24
+ Reference: https://docs.github.com/en/communities/documenting-your-project-with-wikis
25
+
26
+ ## Config → docs.json
27
+
28
+ Wikis have no config.
29
+
30
+ | Wiki source | docs.json |
31
+ | --------------------------------------------------------- | --------------------------------- |
32
+ | repository name / About description | `name` / `description` |
33
+ | repository URL | `navbar.links` (`type: github`) |
34
+ | image at the top of `_Sidebar.md` | `logo` |
35
+ | external links in `_Sidebar.md` | `navigation.global.anchors` |
36
+ | `_Footer.md` links | `footer.links` / `footer.socials` |
37
+ | `_Footer.md` prose, revision info, wiki search, clone box | drop and report |
38
+
39
+ ## Navigation
40
+
41
+ - `_Sidebar.md` is free-form Markdown. A heading, bold line or unlinked list item with children → group; nested lists → nested groups; a heading that links a page → group with that page as `root`; each page link → a page, in order.
42
+ - Sidebar links to headings (`Page#section`) have no sidebar slot: report.
43
+ - A page listed twice keeps its first position. `[[Home]]` is the home page.
44
+ - Pages missing from `_Sidebar.md` were still reachable from GitHub's page list: ask the user where they go.
45
+ - No `_Sidebar.md`: GitHub showed only the alphabetical page list.
46
+ - A `_Sidebar.md` inside a folder applies to that folder's pages, often a translation: report it.
47
+
48
+ ## Content conversion
49
+
50
+ - Flat namespace: a page's name is its file name without extension; folders do not count. Names match case-insensitively and treat `-` and space as the same. Build a page name → new path index (`Home` → the index page; `mint migrate --topic conversion`, Links); resolve name clashes by hand.
51
+ - The page title is the file name with `-` shown as a space. GitHub renders it above the body, so a body `# H1` is a section heading: drop it only if it repeats the page name.
52
+
53
+ | Wiki | Mintlify |
54
+ | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
55
+ | `[[Page Name]]` | `[Page Name](/<path>)` via the table |
56
+ | `[[Link text\|Page Name]]` (text first in Markdown pages; Gollum order) | `[Link text](/<path>)` |
57
+ | `[[Page Name#anchor]]` | `/<path>#anchor` |
58
+ | `[[text\|https://...]]` | `[text](https://...)` |
59
+ | `[[image.png]]`, `[[/path/image.png\|alt=Text]]` | `![Text](/path/image.png)`; other image options drop |
60
+ | `[[Page\|Text]]` in `.mediawiki` pages | MediaWiki order: page first |
61
+ | `[[...]]` to a page that does not exist | plain text; report |
62
+ | `[[_TOC_]]` | delete |
63
+ | `https://github.com/<owner>/<repo>/wiki/Page-Name`, `/<owner>/<repo>/wiki/Page-Name`, bare `Page-Name` | `/<path>` via the table |
64
+ | relative links that leave the wiki (`../issues/12`, `../blob/main/x`) | absolute GitHub URLs resolved from `/<owner>/<repo>/wiki/<page>` |
65
+ | `#user-content-x` | `#x` |
66
+ | `> [!NOTE]` style alerts | (`mint migrate --topic conversion`, GitHub alerts) |
67
+ | `:emoji:` shortcodes | the emoji |
68
+
69
+ Skip `[[...]]` inside code. Link syntax: https://github.com/gollum/gollum/wiki#link-tag
70
+
71
+ ## Assets
72
+
73
+ - Non-page files in the wiki repo are served under the wiki URL. Copy every referenced file into the docs repo.
74
+ - Images hosted on `user-images.githubusercontent.com`, `github.com/user-attachments/...` or the main repo's `blob/` URLs: download them.
75
+
76
+ ## URLs and redirects
77
+
78
+ - Old URLs are `https://github.com/<owner>/<repo>/wiki` (Home) and `https://github.com/<owner>/<repo>/wiki/<Page-Name>`. They stay on github.com and cannot redirect. Add no `redirects` for them, and do not tell the user they will redirect.
79
+ - Produce a route table instead (outside the docs content), one row per wiki page: `wiki_url`, `page_name`, `new_path`, `status` (`migrated`, `merged into <path>`, `dropped`).
80
+ - Offer, but do not do without approval: replace each wiki page with a "Moved to <new URL>" line, point `Home` and `_Sidebar.md` at the new site, then disable the wiki.
81
+
82
+ ## Known gaps
83
+
84
+ - Old wiki URLs cannot redirect.
85
+ - Wiki revision history (kept only if the wiki is merged with `git subtree add`).
86
+ - Formatting lost when converting non-Markdown pages.
87
+ - `[[...]]` image options other than `alt`.
88
+ - Sidebar prose, images and heading links.
89
+ - Links that were already broken on the wiki, and links to `_pages`, `_history` or revision URLs.
90
+ - Heading anchors (`mint migrate --topic conversion`, Heading IDs).
@@ -0,0 +1,104 @@
1
+ # Jekyll
2
+
3
+ Covers Jekyll and Just the Docs (JTD)-style themes.
4
+
5
+ ## Detect
6
+
7
+ - `_config.yml` at the root or in `docs/`.
8
+ - JTD: `theme: just-the-docs` or `remote_theme: just-the-docs/just-the-docs` (or `pmarsceill/just-the-docs`), or the gem in `Gemfile`. Pages carry `nav_order` / `parent`.
9
+ - Confirming tells: `_layouts/`, `_includes/`, `_data/`, `_posts/`, a `Gemfile` with `jekyll` or `github-pages`.
10
+ - Not Jekyll: `_config.yml` with `_toc.yml` (Jupyter Book) or with `hexo` in `package.json`.
11
+ - `gem "github-pages"`, or a `remote_theme` with no `Gemfile`, means GitHub Pages' build, which force-enables plugins such as `jekyll-optional-front-matter`, `jekyll-titles-from-headings`, `jekyll-relative-links` and `jekyll-readme-index`.
12
+
13
+ ## Get the source
14
+
15
+ ### From the repo
16
+
17
+ - Pages: `.md`, `.markdown` and `.html` files with front matter outside `_` folders and outside `exclude`. Collections: `_<name>/` folders declared under `collections:` (inside `collections_dir` if set). Posts: `_posts/`.
18
+ - Build: `JEKYLL_ENV=production bundle exec jekyll build -d <dir>` (`mint migrate --topic discovery`, From the repo).
19
+
20
+ ### From an export
21
+
22
+ None; the site is built from the repo.
23
+
24
+ ### From the live site
25
+
26
+ `sitemap.xml` comes from jekyll-sitemap. Sources come from the repo named in `repository` or `gh_edit_repository`.
27
+
28
+ ## Config → docs.json
29
+
30
+ | \_config.yml | docs.json |
31
+ | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
32
+ | `title` / `description` | `name` / `description` |
33
+ | `logo` / `favicon_ico` (JTD) | `logo` / `favicon` |
34
+ | `color_scheme: dark` (JTD) | `appearance.default: "dark"` |
35
+ | custom JTD color scheme (`_sass/color_schemes/<name>.scss`) | `colors.primary` from its link color |
36
+ | `aux_links` (JTD) | `navbar.links` |
37
+ | `nav_external_links` (JTD) | `navigation.global.anchors` |
38
+ | `footer_content`, `_includes/footer_custom.html` | `footer.links` / `footer.socials`; report other text |
39
+ | `repository`, `gh_edit_repository` | `navbar.links` (`type: github`) |
40
+ | `ga_tracking` (JTD), `google_analytics` | `integrations.ga4.measurementId` |
41
+ | `twitter`, `github_username`, `social` | `footer.socials` |
42
+ | keys read as `{{ site.x }}` | `variables` (`mint migrate --topic conversion`, Template tags) |
43
+ | `url`, `baseurl` | none; their host and path are part of every old URL |
44
+ | `callouts` (JTD) | none; names the callouts used in Content conversion |
45
+ | `permalink`, `defaults`, `collections` | none; drive URLs and Navigation |
46
+ | `plugins` | `jekyll-redirect-from` → URLs below; `jekyll-seo-tag`, `jekyll-sitemap`, `jekyll-feed` → drop; others report |
47
+ | `search_*`, `heading_anchors`, `nav_sort`, `mermaid`, `markdown`, `kramdown`, `highlighter`, `sass`, `exclude`, `include` | drop |
48
+
49
+ References: https://jekyllrb.com/docs/configuration/ and https://just-the-docs.com/docs/configuration/
50
+
51
+ ## Navigation
52
+
53
+ - JTD (https://just-the-docs.com/docs/navigation/): every page with a `title` and without `nav_exclude: true` is in the sidebar. Top level has no `parent`; children set `parent: <parent title>`, with `grand_parent` or `ancestor` to disambiguate. Order within a level: `nav_order` (numbers before strings), else title. A page with children → group with that page as `root`. Excluded parents exclude their children.
54
+ - JTD collections: `just_the_docs.collections.<name>.name` → one group per collection after the normal pages; `nav_fold: true` → `expanded: false`; `nav_exclude` drops the collection.
55
+ - Other themes: a `_data/*.yml` nav file (shape defined by the `_includes/` template that loops over it; usually `title`/`url`/`children`). Resolve each `url` to its source file.
56
+ - JTD shows front matter `title` in the sidebar and the body H1 on the page.
57
+
58
+ ## Content conversion
59
+
60
+ | Jekyll / Kramdown / JTD | Mintlify |
61
+ | ------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
62
+ | `{{ site.x }}`, `{{ page.x }}`, `{% if %}`, `{% for %}`, `{% assign %}`, `{% capture %}`, `{% raw %}` | (`mint migrate --topic conversion`, Template tags) |
63
+ | `{{ site.baseurl }}`, `relative_url`, `absolute_url` | root-relative path |
64
+ | `{% link path/file.md %}`, `{% post_url slug %}` | that page's new path |
65
+ | `{% include x.md k="v" %}` (from `_includes/`), `{% include_relative x.md %}`; `{{ include.k }}` reads params | (`mint migrate --topic conversion`, Reusable content) |
66
+ | HTML includes (note, figure, video, details) | the matching component; report others |
67
+ | `{% highlight lang linenos mark_lines="1 2" %}` | fence with `lines` and `highlight={1,2}` |
68
+ | JTD callout IAL `{: .name }` before a paragraph or blockquote; `{: .name-title }` with a `> Title` first line | callout chosen by the meaning of `name` in `callouts:`; undeclared names rendered plain |
69
+ | `{: .label }` / `{: .label .label-green }` | `<Badge>` |
70
+ | `{: .btn }` links | link or `<Card>` |
71
+ | `{: #id }` under a heading, `## Heading {#id}` | (`mint migrate --topic conversion`, Heading IDs) |
72
+ | `{: .no_toc }`, `{: .text-delta }`, in-page TOC (`{:toc}`), `{::options}`, ALDs | delete |
73
+ | `{::comment}` | MDX comment |
74
+ | `nav_exclude: true` | leave out of navigation |
75
+ | `search_exclude: true` | `searchable: false` |
76
+ | `last_modified_date` | `lastUpdatedDate` |
77
+ | `redirect_from` / `redirect_to` | URLs below |
78
+ | `layout`, `nav_order`, `parent`, `grand_parent`, `ancestor`, `has_children`, `has_toc`, `nav_fold`, `published`, `categories`, `tags` | drop |
79
+
80
+ References: https://jekyllrb.com/docs/liquid/tags/ and https://just-the-docs.com/docs/ui-components/callouts/
81
+
82
+ ## Assets
83
+
84
+ - Copy `assets/`, `images/` and other referenced files outside `_` folders at the same paths.
85
+ - Skip `_sass/`, `_layouts/`, theme CSS and `vendor/`. Report `_sass/custom` rules that hide or inject content.
86
+
87
+ ## URLs and redirects
88
+
89
+ - Global `permalink` sets page URLs (https://jekyllrb.com/docs/permalinks/): unset (`date`), `none` or `ordinal` → `dir/name.md` serves `/dir/name.html` (`mint migrate --topic navigation`, Redirects); `pretty` → `/dir/name/`; custom patterns end in `/` or `:output_ext`. `dir/index.md` → `/dir/`.
90
+ - Front matter `permalink` overrides per page; collections use `collections.<name>.permalink`, default `/:collection/:path` plus the global style's suffix.
91
+ - `redirect_from` values → one redirect each to this page. `redirect_to` → a redirect from this page's path; the page itself goes.
92
+ - Posts default to `/:categories/:year/:month/:day/:title.html`.
93
+ - `jekyll-readme-index` (on GitHub Pages builds) serves `README.md` as its folder (`mint migrate --topic conversion`, Files).
94
+ - A `CNAME` file means the site served at that domain's root, whatever `baseurl` says.
95
+
96
+ ## Known gaps
97
+
98
+ - Liquid logic replaced with static output (`mint migrate --topic conversion`, Template tags).
99
+ - Posts index, pagination, categories, tags, RSS.
100
+ - Custom `_layouts/` and `_includes/` chrome with no docs.json field.
101
+ - JTD callout colors, label colors, `nav_fold`, auto child-page lists on parent pages, edit-time format.
102
+ - Kramdown abbreviations, definition lists, math engine options.
103
+ - GitHub Pages-only plugins (`jekyll-gist`, `jemoji`, `jekyll-mentions`).
104
+ - Heading anchors (`mint migrate --topic conversion`, Heading IDs).
@@ -0,0 +1,98 @@
1
+ # mdBook
2
+
3
+ ## Detect
4
+
5
+ - `book.toml` with a `[book]` table. Only mdBook uses it, so it wins over every other signal.
6
+ - `SUMMARY.md` in the source dir (`[book] src`, default `src/`). GitBook and HonKit also use `SUMMARY.md`, but with `book.json` or `.gitbook.yaml` and no `book.toml`.
7
+ - `mdbook build`, `mdbook test` or `cargo install mdbook-<plugin>` in CI.
8
+
9
+ ## Get the source
10
+
11
+ ### From the repo
12
+
13
+ - Chapters live under `[book] src`, which can point outside the book root. Only chapters listed in `SUMMARY.md` publish; every non-Markdown file under `src` is copied to the site.
14
+ - Build: `mdbook build -d <dir>` (`mint migrate --topic discovery`, From the repo).
15
+
16
+ ### From an export
17
+
18
+ None; the book is built from the repo.
19
+
20
+ ### From the live site
21
+
22
+ The rendered sidebar gives chapters, order and part titles; `print.html` holds every chapter. Sources come from `git-repository-url` or `edit-url-template`.
23
+
24
+ ## Config → docs.json
25
+
26
+ | book.toml | docs.json |
27
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
28
+ | `[book] title` / `description` | `name` / `description` |
29
+ | `[book] logo` (relative to `src`) | `logo` |
30
+ | `[output.html] git-repository-url` | `navbar.links` (`type: github` for GitHub) |
31
+ | `default-theme` and `preferred-dark-theme` both dark (`coal`, `navy`, `ayu`) | `appearance.default: "dark"` |
32
+ | `additional-css` / `additional-js` | (`mint migrate --topic navigation`, Chrome); also delete admonish assets |
33
+ | `google-analytics` | `integrations.ga4.measurementId` |
34
+ | `[output.html.redirect]` | `redirects` (URLs below) |
35
+ | `[output.html.fold] enable = false` | nested groups `expanded: true` |
36
+ | `site-url`, `cname` | none; their host and path are part of every old URL |
37
+ | `theme/` folder | report custom templates; a custom favicon → `favicon` (the stock one is mdBook's logo) |
38
+ | `authors`, `language`, `edit-url-template`, `mathjax-support`, `input-404`, `no-section-label`, `smart-punctuation`, `[output.html.playground]`, `[output.html.code.hidelines]`, `[output.html.search]`, `[output.html.print]`, `[rust]`, `[build]`, other backends | drop and report |
39
+
40
+ Reference: https://rust-lang.github.io/mdBook/format/configuration/
41
+
42
+ ## Navigation
43
+
44
+ `SUMMARY.md` is the whole navigation (https://rust-lang.github.io/mdBook/format/summary.html):
45
+
46
+ - `# Summary` on the first line is ignored.
47
+ - Prefix chapters (bare links before the first list) and suffix chapters (bare links after the last list) are unnested pages before and after the numbered chapters.
48
+ - Part titles (`# Part`, h1 only) → one group per part.
49
+ - Numbered chapters (`-` or `*` items, nested by indentation) → pages; a chapter with children → group with that chapter as `root`.
50
+ - Draft chapters `[Title]()` have no file: report as planned chapters.
51
+ - Separators (`---`): drop.
52
+ - The sidebar label is the `SUMMARY.md` link text; the page heading is the chapter's H1.
53
+ - mdBook numbers chapters (`1.`, `2.3.`) unless `no-section-label`. Report prose that cites chapter numbers.
54
+
55
+ ## Content conversion
56
+
57
+ | mdBook | Mintlify |
58
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
59
+ | `{{#include file}}` and `file:2`, `file::10`, `file:2:`, `file:2:10`, `file:anchor` (`ANCHOR:` / `ANCHOR_END:` markers). Paths are relative to the chapter; expanded as text, so they work inside fences | code: (`mint migrate --topic conversion`, Code imports); prose: (`mint migrate --topic conversion`, Reusable content) |
60
+ | `{{#rustdoc_include file:sel}}` | the selected lines only; report the lost expand toggle |
61
+ | `{{#playground file}}` | a static `rust` fence; report the lost Run button |
62
+ | `{{#title X}}` | `title` |
63
+ | `\{{#...}}` (escaped, in docs about mdBook) | literal text in inline code or a fence |
64
+ | Rust fence attributes (`rust,ignore`, `no_run`, `should_panic`, `compile_fail`, `editable`, `noplayground`, `mdbook-runnable`, `edition20xx`) | `rust` |
65
+ | hidden lines in Rust fences: first non-space characters `# ` or a lone `#`; `##` is an escaped `#`; `#[` and `#!` are code | delete hidden lines |
66
+ | custom hide prefixes (`[output.html.code.hidelines]`, fence `hidelines=<prefix>`) | delete those lines too |
67
+ | `> [!NOTE]` style alerts | (`mint migrate --topic conversion`, GitHub alerts) |
68
+ | mdbook-admonish ` ```admonish type ` (`title="..."`, `collapsible=true`); aliases per https://tommilligan.github.io/mdbook-admonish/reference.html | (`mint migrate --topic conversion`, Admonitions); collapsible → `<Accordion>` |
69
+ | mdbook-tabs `{{#tabs}}` / `{{#tab name="X"}}` | `<Tabs>` / `<Tab>` |
70
+ | MathJax `\\( \\)`, `\\[ \\]` | `$ $`, `$$ $$`, with Markdown escapes inside the math undone |
71
+ | mdbook-toc `<!-- toc -->` | delete |
72
+ | `## Heading { #id .class }` | (`mint migrate --topic conversion`, Heading IDs); drop classes |
73
+ | definition lists (`term` then `: definition`) | a list or table |
74
+ | `<i class="fa fa-x">` | `<Icon>` |
75
+ | elements with `class="hidden"` | delete |
76
+
77
+ Reference: https://rust-lang.github.io/mdBook/format/mdbook.html
78
+
79
+ ## Assets
80
+
81
+ - Non-Markdown files under `src` that chapters reference keep their paths.
82
+ - Files included from outside `src` are code, not assets.
83
+
84
+ ## URLs and redirects
85
+
86
+ - `src/a/b.md` → `/a/b.html` (`mint migrate --topic navigation`, Redirects).
87
+ - The built-in `index` preprocessor turns `README.md` chapters into `index.html` (`mint migrate --topic conversion`, Files).
88
+ - The first chapter is also written as the book's `/index.html`.
89
+ - `[output.html.redirect]` keys are absolute old paths; values are relative or absolute targets. Fragment keys (`/page.html#frag`) cannot be redirect sources: report them.
90
+
91
+ ## Known gaps
92
+
93
+ - Rust playground, `editable` code, `mdbook test` doctests.
94
+ - The hidden-line toggle and `rustdoc_include` expansion.
95
+ - Chapter numbering, draft chapters, separators.
96
+ - Print page, EPUB and PDF backends.
97
+ - Custom preprocessors, cmdrun, i18n-helpers (`po/`), graphviz/plantuml/svgbob diagrams.
98
+ - Fragment redirects; heading anchors (`mint migrate --topic conversion`, Heading IDs).
@@ -0,0 +1,113 @@
1
+ # MkDocs
2
+
3
+ Covers MkDocs, Material for MkDocs, Zensical and ProperDocs.
4
+
5
+ ## Detect
6
+
7
+ - `mkdocs.yml` / `mkdocs.yaml`: MkDocs. `theme.name: material` means Material for MkDocs.
8
+ - `zensical.toml`: Zensical (MkDocs keys in TOML under `[project]`). `properdocs.yml`: ProperDocs. Both also read `mkdocs.yml`.
9
+ - Python dependencies (`mkdocs`, `mkdocs-material`, `zensical`, `properdocs`) or `mkdocs build` in CI confirm it.
10
+ - The config file wins. If there are several, migrate the one CI builds and report the others.
11
+ - Resolve `INHERIT:` (deep-merges a parent config) and `!ENV [VAR, default]` (use the default, report the variable) before mapping. Read `!!python/...` tags as text.
12
+
13
+ ## Get the source
14
+
15
+ ### From the repo
16
+
17
+ - Pages are the `.md` files under `docs_dir` (default `docs/`), minus `exclude_docs`.
18
+ - Build: `mkdocs build -d <dir>` or `zensical build` (`mint migrate --topic discovery`, From the repo).
19
+
20
+ ### From an export
21
+
22
+ None; the site is built from the repo.
23
+
24
+ ### From the live site
25
+
26
+ Page sources through `repo_url` + `edit_uri`.
27
+
28
+ ## Config → docs.json
29
+
30
+ | mkdocs.yml | docs.json |
31
+ | -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
32
+ | `site_name` / `site_description` | `name` / `description` |
33
+ | `repo_url` | `navbar.links` (`type: github` for GitHub) |
34
+ | `theme.logo` / `theme.favicon` | `logo` / `favicon` |
35
+ | `theme.palette.primary` | `colors.primary`, from the rendered link color's hex (Material color names are not CSS colors) |
36
+ | `theme.palette` with only `scheme: slate` | `appearance.default: "dark"` |
37
+ | `theme.font.text` | `fonts.family` |
38
+ | `extra.social` | `footer.socials` |
39
+ | `extra.analytics` (`provider: google`) | `integrations.ga4.measurementId` |
40
+ | `extra.*` read by the macros plugin | `variables` (`mint migrate --topic conversion`, Template tags) |
41
+ | `extra_css` / `extra_javascript` | (`mint migrate --topic navigation`, Chrome) |
42
+ | `nav` | Navigation below |
43
+ | `site_url` | none; its host and path prefix are part of every old URL |
44
+ | `copyright`, `edit_uri`, `theme.features`, `markdown_extensions`, `hooks`, `theme.custom_dir`, build and server keys | drop and report |
45
+
46
+ Plugins: `redirects` → URLs below; `git-revision-date*` → `metadata.timestamp`; `awesome-pages`, `awesome-nav`, `literate-nav` → Navigation; `search`, `social`, `minify`, `privacy`, `offline` → drop; `macros`, `mkdocstrings`, `gen-files`, `mkdocs-jupyter`, `blog`, `i18n`, `mike` → Known gaps.
47
+
48
+ Reference: https://www.mkdocs.org/user-guide/configuration/
49
+
50
+ ## Navigation
51
+
52
+ - `nav` entries: `- Label: page.md`, `- page.md` (label from the page), `- Label: https://...` (external), `- Section: [ ... ]` (nested).
53
+ - Material `theme.features: navigation.tabs`: each top-level section is a tab. Without it, top-level sections are groups.
54
+ - Material `navigation.indexes`: a section's leading `index.md` is the section's own page → group `root`.
55
+ - External `nav` entries → `navigation.global.anchors`, or a tab `href` if they sat in the tab row.
56
+ - No `nav`: MkDocs lists each folder's files alphabetically, `index` first, subfolders after files.
57
+ - `.pages` (awesome-pages) and `.nav.yml` (awesome-nav) set per-folder title and order. A literate-nav `SUMMARY.md` is a nested link list read like `nav`; it is not a page.
58
+ - `not_in_nav` pages are hidden pages.
59
+
60
+ Reference: https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/
61
+
62
+ ## Content conversion
63
+
64
+ | MkDocs / Material / pymdownx | Mintlify |
65
+ | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
66
+ | `!!! type "Title"` (body indented 4) | (`mint migrate --topic conversion`, Admonitions) |
67
+ | `??? type "Title"` / `???+` | `<Accordion>` / `<Accordion defaultOpen>` |
68
+ | `=== "Label"` runs (`===+` selects a tab, `===!` starts a new set) | `<Tabs>` / `<Tab>`; `<CodeGroup>` when every tab is one code block |
69
+ | `/// admonition`, `/// details`, `/// tab` blocks | same targets as `!!!`, `???`, `===` |
70
+ | fence `title="x"`, `hl_lines="2 4-5"`, `linenums="1"` | fence title, `highlight={2,4-5}`, `lines` |
71
+ | inline `` `#!python code` `` | plain inline code |
72
+ | code annotations (`# (1)!` + a numbered list) | the list as prose below the block; report |
73
+ | `--8<--` snippets (paths resolve from `base_path`, not the page; `file:3:10` ranges, `file:name` sections) | code: (`mint migrate --topic conversion`, Code imports); prose: (`mint migrate --topic conversion`, Reusable content) |
74
+ | include-markdown `{% include "x.md" %}` | (`mint migrate --topic conversion`, Reusable content) |
75
+ | `{ #id }` on a heading | (`mint migrate --topic conversion`, Heading IDs) |
76
+ | other attribute lists (`{ .md-button }`, `{ width=... }`) | delete; buttons become links or `<Card>` |
77
+ | `<div class="grid cards" markdown>` | `<Columns>` of `<Card>` |
78
+ | `++ctrl+c++`, `==x==`, `^^x^^` | `<kbd>`, `<mark>`, `<ins>` |
79
+ | `:material-x:`, `:octicons-x:`, `:fontawesome-x:` | `<Icon>`, or delete |
80
+ | arithmatex `\( \)`, `\[ \]` | `$ $`, `$$ $$` |
81
+ | abbreviations `*[TERM]: ...`, `[TOC]` | delete |
82
+ | `![](x.png#only-light)` / `#only-dark` | light/dark image pair |
83
+ | macros `{{ }}` / `{% %}` | (`mint migrate --topic conversion`, Template tags) |
84
+ | `hide: [toc]` / `hide: [navigation]` / `hide: [footer]` | `mode: "wide"` / `mode: "center"` / `hideFooterPagination` |
85
+ | `status: deprecated` / `status: new` | `deprecated` / `tag` |
86
+ | `tags`, `search.exclude` | `keywords`, `searchable: false` |
87
+
88
+ Folder `.meta.yml` files (meta plugin) set frontmatter for every page in the folder.
89
+
90
+ References: https://squidfunk.github.io/mkdocs-material/reference/ and https://facelessuser.github.io/pymdown-extensions/
91
+
92
+ ## Assets
93
+
94
+ - Referenced non-Markdown files under `docs_dir` keep their paths.
95
+ - Files at the `docs_dir` root served by URL (`CNAME`, verification files): report.
96
+
97
+ ## URLs and redirects
98
+
99
+ - `use_directory_urls: true` (default): `a/b.md` → `/a/b/`, `a/index.md` → `/a/`.
100
+ - `use_directory_urls: false`: `a/b.md` → `/a/b.html` (`mint migrate --topic navigation`, Redirects).
101
+ - `README.md` serves its folder when there is no `index.md` (`mint migrate --topic conversion`, Files).
102
+ - `redirects` plugin `redirect_maps` (`old.md: new.md`): one redirect per entry, both sides as URLs.
103
+ - mike serves versions at `/<version>/` and aliases such as `/latest/`. Redirect `/<alias>/:slug*` to the migrated version.
104
+
105
+ ## Known gaps
106
+
107
+ - mkdocstrings, mkdocs-click, gen-files and Jupyter output.
108
+ - macros logic (`mint migrate --topic conversion`, Template tags).
109
+ - Blog plugin, tag index pages, RSS.
110
+ - i18n plugins; mike versions other than the migrated one.
111
+ - Code annotations, admonition colors, inline admonitions, cross-page linked tabs.
112
+ - `hooks`, `theme.custom_dir` overrides, plugins without a mapping.
113
+ - Heading anchors (`mint migrate --topic conversion`, Heading IDs).