@mintlify/cli 4.1.27 → 4.1.29

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.
@@ -5,6 +5,7 @@ A docs site the team built themselves: a Next.js, Gatsby, Astro, Remix or Svelte
5
5
  ## Detect
6
6
 
7
7
  - No other source guide matches. A framework dependency alone is not enough: `next` can be Nextra or Fumadocs, `astro` can be Starlight, `nuxt` can be Docus or Nuxt Content. Check those guides' Detect sections first.
8
+ - `.dita`/`.ditamap` files or a DITA-OT build mean DITA (`mint migrate --from dita`).
8
9
  - Content lives in `.md`/`.mdx` files, JSON or YAML data, a headless CMS, pages written as components, or plain `.html` files.
9
10
 
10
11
  ## Get the source
@@ -0,0 +1,143 @@
1
+ # DITA
2
+
3
+ XML topics (`.dita`) assembled into deliverables by maps (`.ditamap`, `.bookmap`) and published with DITA Open Toolkit (DITA-OT) or an engine built on it. One source usually produces several deliverables (HTML, PDF, per-product or per-audience variants) through profiling, so start by choosing which deliverable to reproduce.
4
+
5
+ ## Detect
6
+
7
+ - Files: `.dita`, `.ditamap`, `.bookmap`, `.ditaval`. DOCTYPEs start `-//OASIS//DTD DITA` (also `DITA 2.0`, and `LIGHTWEIGHT DITA` for XDITA); DITA 2.0 files may have no DOCTYPE, only `<?xml-model href="urn:oasis:names:tc:dita:rng:...">`. Roots: `concept`, `task`, `reference`, `topic`, `glossentry`, `troubleshooting`, `map`, `bookmap`, `subjectScheme`.
8
+ - Build config: DITA-OT project files (`<project xmlns="https://www.dita-ot.org/project">`, or `.json`/`.yaml`), `.properties` files, Ant `build.xml` or Gradle (`dita-ot-gradle`) calling DITA-OT, Oxygen `.xpr` projects and publishing templates.
9
+ - Mixed repos: `.md` files referenced from maps with `format="markdown"` or `format="mdita"` are DITA topics, not a separate Markdown site.
10
+ - CCMS exports (Heretto, IXIASOFT, Astoria and similar) are zips of the same files, sometimes with generated file names. Oxygen Content Fusion is a review tool, not a content store.
11
+ - Live site: DITA-OT HTML5 pages have `<meta name="generator" content="DITA-OT">` (site wrappers often remove it) and classes `topictitle1`, `shortdesc`, `tasklabel`, `ulchildlink`, `related-links`.
12
+ - DocBook (`-//OASIS//DTD DocBook`) is not DITA: follow `mint migrate --from custom`.
13
+
14
+ ## Get the source
15
+
16
+ ### From the repo
17
+
18
+ - Find every deliverable before converting: project file `<deliverable>` / `<context>` (input map plus `<ditaval>`; `dita deliverables --project=<file>` lists them), `.properties` (`args.filter`), Ant or Gradle targets, CI workflows. A deliverable is a root map, its DITAVAL files, a transtype and parameters. Ask the user which deliverables to migrate; that fixes the map and the filters. Oxygen's user guide, for example, builds about 20 product variants from one bookmap.
19
+ - Maps that point at files missing from the repo usually generate them at build time (the DITA-OT docs generate their parameter topics with Gradle). Run the repo's build step first, or mark those pages `blocked`.
20
+ - Resolve the source with DITA-OT, using the version and plugins the build pins (`dita --version`, `dita plugins`):
21
+
22
+ ```bash
23
+ dita --input=<root map> --format=dita --filter=<deliverable>.ditaval \
24
+ --normalize-strip-keyref=no --output=<outside both projects>
25
+ ```
26
+
27
+ `--format=dita` writes normalized DITA: maprefs merged into one map, keys resolved within their scopes, `conref`/`conkeyref`/`conrefend` and conref push applied, `coderef` inlined, `normalize-space` applied, profiling and branch filtering (`ditavalref`) applied, chunks merged, and reltable and hierarchy links added to each topic's `related-links`. `--normalize-strip-keyref=no` keeps `keyref` on resolved elements and the `keydef`s in the map, so variables stay recognizable (Reuse and keys). Pass `--filter` once per DITAVAL file, in the build's order. Repeat per deliverable.
28
+
29
+ - Convert from the normalized output with an XML parser, never regex. Read the raw source only for what normalization erases: which blocks were reused, and which conditions were filtered.
30
+ - Do not convert from `--format=markdown_github` (or `markdown`, `markdown_gitbook`): it turns notes into bold labels, leaks inline markup into code blocks as backticks, drops code languages to raw `outputclass` values and emits choice tables as raw HTML.
31
+ - Build the old site once (`--format=html5` with the deliverable's filters and parameters) for the URL list and the labels DITA-OT generates (`mint migrate --topic discovery`, From the repo).
32
+
33
+ ### From an export
34
+
35
+ A CCMS export is the repo route on a zip. Ask for the publication's root map with all dependencies (keys, conref sources, images), plus the DITAVAL and publishing settings used for the live output; some CCMSs keep filters and variables in the CCMS, not in files. Then normalize as above.
36
+
37
+ ### From the live site
38
+
39
+ Fallback only. Rendered HTML is already filtered and resolved, but reuse is expanded and semantics are flattened. Mirror each page's `article` content and map DITA-OT classes: `p.shortdesc`, `div.note.note_<type>`, `ol.steps` / `li.step` / `span.cmd`, `section.prereq` and siblings, `nav.related-links`. Take navigation from the rendered TOC (`nav.toc`, or the `toc` page DITA-OT generates when `html5.toc.generate` is on).
40
+
41
+ ## Config → docs.json
42
+
43
+ | DITA | docs.json |
44
+ | ------------------------------------------------------------------- | --------------------------------------------------------------------------- |
45
+ | Root map `<title>`, bookmap `<mainbooktitle>` | `name` |
46
+ | Chosen deliverable (map + DITAVAL) | the project |
47
+ | Other deliverables of the same source | ask: separate projects, `navigation.products`, or not migrated |
48
+ | One deliverable per release | `navigation.versions`, only for versions the user migrates |
49
+ | `keydef` holding only plain text in `topicmeta/keywords/keyword` | `variables` entry (Reuse and keys) |
50
+ | Maps per `xml:lang` | `navigation.languages`, only if migrated |
51
+ | `args.hdr`, `args.ftr`, `args.hdf`, `args.css`, `args.cssroot` | drop; take `logo`, `favicon` and `colors.primary` from the old site; report |
52
+ | `nav-toc`, `args.rellinks`, `args.gen.task.lbl` | no setting; they decide what conversion emits (below) |
53
+ | `mapref type="subjectScheme"` | drop |
54
+ | PDF themes and parameters, `deliveryTarget="pdf"`, other transtypes | drop and report |
55
+
56
+ ## Navigation
57
+
58
+ The normalized map is the navigation data: one tree, `keyref`s resolved to `href`, every `navtitle` filled (the map's own when `locktitle="yes"`, otherwise the topic's `titlealts/navtitle` or title), filtered branches gone.
59
+
60
+ - `topicref` with children → nested group whose `root` is that topic, labelled by its `navtitle`. A `navtitle` that differs from the topic title is also the page's `sidebarTitle`.
61
+ - `topichead` → group without a root page. `topicgroup` → no label; its children join the parent level.
62
+ - Bookmap `part`, `chapter`, `appendix` → top-level groups in order; `preface` and `notices` are pages; `booklists` (`toc`, `indexlist`, `glossarylist` and similar) are generated: drop.
63
+ - Not pages: `keydef`, `reltable`, `processing-role="resource-only"` refs and topics only reached through them (`conref` sources): exclude them in the manifest.
64
+ - `toc="no"` topics are still published: put them in a `"hidden": true` group (`mint migrate --topic navigation`, Structure rules).
65
+ - `chunk="to-content"`: normalization merges the children into the parent's file as nested topics, and the map then points at `file.dita#topicid`. Make one page; `#` entries are not pages.
66
+ - Branch filtering: a topic referenced twice under different `ditavalref`s becomes separate files named with `dvrResourcePrefix`/`dvrResourceSuffix` (`first-build-using-dita-command.dita`, `build-using-dita-command.dita`). Each is its own page.
67
+ - `scope="external"` topicref → page whose frontmatter is `title` + `url`, at that position.
68
+ - `collection-type`, `linking` and `@type` only shape generated links; drop.
69
+
70
+ ## Content conversion
71
+
72
+ List every element name and `outputclass` value in the normalized files before writing rules (`mint migrate --topic conversion`). Specialized elements keep their own names after normalization: look up each one's base type in the `class` default of its DTD or RNG and map it like that type.
73
+
74
+ **Page.** `title` → `title`. `shortdesc` (or `abstract`) is the first body paragraph: DITA-OT renders it as the lead paragraph, not a subtitle. Use it as `description` only if the old site styled it as one, and never both. `prolog` → drop.
75
+
76
+ **Task sections.** `prereq`, `context`, `steps`, `result`, `postreq`, `example` get `##` headings "Before you begin", "About this task", "Procedure", "Results", "What to do next", "Example" only when the build sets `args.gen.task.lbl=YES` (DITA-OT generates these labels); otherwise no heading.
77
+
78
+ | DITA | Mintlify |
79
+ | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
80
+ | `steps` / `step` | `<Steps>` / `<Step>`; `cmd` → `title` only when every `cmd` in the block is plain text, else the step's first paragraph |
81
+ | `info`, `stepxmp`, `stepresult`, `tutorialinfo` | paragraphs inside the step |
82
+ | `substeps`; `steps-unordered`, `choices` | nested ordered list; bullet list |
83
+ | `importance="optional"` on `step`, `li` | `**Optional:**` before the text, as DITA-OT prints it |
84
+ | `choicetable` | table; headers from `chhead`, else `Option` / `Description` as DITA-OT renders |
85
+ | `note` `note`, `other` | `<Note>`; `othertype` → bold first line |
86
+ | `note` `tip`, `fastpath` | `<Tip>` |
87
+ | `note` `important`, `remember`, `restriction`, `notice` | `<Info>` |
88
+ | `note` `attention`, `caution`, `warning`, `trouble` | `<Warning>` |
89
+ | `note` `danger` | `<Danger>` |
90
+ | `codeblock` | fence; language from `outputclass` `language-X` or `syntax-X` (`bourne` → `bash`); inner markup (`varname` italics) → plain text, report |
91
+ | `codeblock` `show-line-numbers`, `show-whitespace` | drop (PDF-only in DITA-OT) |
92
+ | `pre`, `screen`, `msgblock` | fence without a language |
93
+ | `codeph`, `cmdname`, `filepath`, `parmname`, `option`, `userinput`, `systemoutput`, `apiname`, `msgph` | inline code |
94
+ | `xmlelement`, `xmlatt` | `` `<name>` ``, `` `@name` `` |
95
+ | `varname`, `term`, `cite`, `i`; `b`, `uicontrol`; `menucascade` | italic; bold; `**A > B**` |
96
+ | `tm` | text plus ™, ® or ℠ by `tmtype` |
97
+ | `section`, `example` with `title` | heading one level below the page; nested topics likewise |
98
+ | `sectiondiv`, `bodydiv`, `div`, `p` holding lists or code | unwrap; blocks in reading order |
99
+ | `dl`, `parml` | `dt`/`pt` as a bold line, `dd`/`pd` as the paragraph below |
100
+ | `simpletable`, `properties`, `table` | markdown table; HTML table (MDX-safe) when a cell holds code, lists or notes, or spans (`namest`, `morerows`) |
101
+ | `fig` with only `image` | `<Frame caption>` from `title`; alt from `alt`, else the title |
102
+ | `fig` with other content | bold title line, then the content; drop "Figure N." numbering |
103
+ | `fn` | footnote (`[^1]`) |
104
+ | `lines`, `lq` | hard line breaks; blockquote |
105
+ | `troubleshooting` `condition`, `cause`, `remedy` | sections under their titles |
106
+ | `glossentry` | page: `glossterm` → `title`, `glossdef` → body |
107
+ | `indexterm`, `draft-comment`, `required-cleanup`, `data` | drop |
108
+ | `foreign`, `unknown`, `object` | report |
109
+
110
+ **Related links.** Normalized topics carry `related-links` from the source, reltables and the map hierarchy. Reproduce what the HTML5 build showed: `role="child"` links → one `<Card>` per child (title, `href`, the child's `shortdesc`) in `<Columns cols={2}>` at the end of the parent page; `role="parent"` links only if `args.rellinks` kept them; other links grouped under bold "Related concepts", "Related tasks", "Related reference" and "Related information" (external) labels, as DITA-OT groups them. Drop `sibling`, `next` and `previous` unless the old site showed them.
111
+
112
+ **Reuse and keys.** Never resolve keys by hand: precedence depends on map order, key scopes and filtering, and keydefs can themselves be profiled (Oxygen defines `product` once per product value).
113
+
114
+ - `keyword`, `ph` or `text` with a `keyref` whose keydef holds only plain text → `{{name}}` (`mint migrate --topic conversion`, Template tags); it is substituted in prose and code blocks. Use letters and digits only (`tool.ant.version` → `toolAntVersion`): `mint validate` fails to parse a hyphenated `{{a-b}}` in prose. Report the renames.
115
+ - Block-level `conref`/`conkeyref` targets (`p`, `note`, `ul`, `table`, `section` and similar) referenced from two or more places in the whole source → one snippet per target at `snippets/<source file>/<id>.mdx`, rendered from the normalized source topic. Normalization inlines every copy: record each reference's topic and position in the raw source, then replace the inlined block at that position with the snippet only when its converted MDX, links included, equals the snippet's. Never match by text alone: blocks with the same text can link to different pages. Where filtering or key scopes made a copy differ, keep it inline.
116
+ - Single-use conrefs, inline targets (`ph`, `filepath`, `keyword`), `conrefend` ranges and conref push (`conaction`) stay inlined.
117
+
118
+ **Conditional content.** Mintlify has no profiling. Normalization already removed what the DITAVAL excludes; list per deliverable which `audience`, `platform`, `product`, `otherprops`, `props`, `deliveryTarget` and `rev` values were filtered and report them. `passthrough` attributes survive and DITA-OT HTML5 emits them as `data-<att>`; if the old site's scripts toggle content by them, `<Tabs>` by value is the nearest equivalent, otherwise keep all of it. A table whose rows differ only by a toggled value (a choice table per `platform`) → one `<Tab>` per value holding that value's rows; a table that mixes toggled and shared rows stays one table and goes in the report. `flag` actions and `revprop` change bars → drop and report.
119
+
120
+ **Links.** Topic `href` → root-absolute path without the extension. A `#topicid/elementid` fragment keeps its anchor only when the target is a titled `section` or `example`: pin that heading as `{#topicid__elementid}`, the id DITA-OT HTML5 gives it; other targets link to the page. An empty `xref` takes the target's title. `scope="external"` stays as is; `scope="peer"` and topics outside the migrated deliverable stay absolute to the old site and go in the report. A peer `href` is relative to the map that declares it, and normalized topics carry it unchanged: resolve it against that map's old URL, not the topic's (`api/index.html` in the root map → `/dev/api/index.html`, not `/dev/reference/api/index.html`).
121
+
122
+ ## Assets
123
+
124
+ Normalization copies images referenced from topics. Copy them to the same paths under the project root and point to them root-absolute. Keyed images (`image keyref`) are resolved to `href` by then. Files linked with `format="pdf"`, `zip` and similar go to a downloads folder. Drop `width`, `height`, `scale` and `placement`.
125
+
126
+ ## URLs and redirects
127
+
128
+ - DITA-OT HTML5 writes each topic to its source path with `.html` (`topics/logging.dita` → `topics/logging.html`). `copy-to`, branch-filter prefixes and chunking change file names: take the old URL list from the HTML5 build, then check it against the live site. The build also emits an unfiltered copy of each branch-filtered topic that the live site may not publish.
129
+ - Keep source paths without the extension and add one `.html` redirect per page (`mint migrate --topic navigation`, Redirects). Version prefixes (`/dev/`, `/4.4/`) are a base path.
130
+ - Chunked children redirect to the merged page, with an anchor when their heading is pinned.
131
+ - CCMS and WebHelp publishing use their own URL schemes: take the list from the live sitemap.
132
+
133
+ ## Known gaps
134
+
135
+ - Profiling: one deliverable per migration, no reader-side filtering, flagging or revision bars.
136
+ - Markup inside code blocks: `varname` placeholders and other highlighting become plain text.
137
+ - PDF and other outputs from the same source, and content only they show (`deliveryTarget="pdf"`).
138
+ - Specializations and custom DITA-OT plugins: content survives as its base type; custom rendering does not.
139
+ - Relationship tables: static related-link lists per page that no longer update from one table.
140
+ - Subject schemes and controlled values, index terms, generated glossary, index and TOC lists.
141
+ - Reuse beyond snippets: inline conrefs, `conrefend` ranges, conref push and key scopes become static copies.
142
+ - Topics generated at build time when the build cannot be run.
143
+ - CCMS workflow, review, metadata, translation memory and localization pipelines.
@@ -5,6 +5,7 @@ One or more PDF files the customer provides locally: manuals, guides, exported s
5
5
  ## Detect
6
6
 
7
7
  - The customer points you at `.pdf` files, or the current directory holds them.
8
+ - PDFs published from DITA (DITA-OT, a CCMS): ask for the DITA source and follow `mint migrate --from dita` instead.
8
9
  - Check each file before choosing a method:
9
10
  - `pdfinfo file.pdf` for page count and producer.
10
11
  - `pdffonts file.pdf`: no fonts listed means scanned pages (images only).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.1.27",
3
+ "version": "4.1.29",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -51,19 +51,19 @@
51
51
  "sharp": "0.33.5"
52
52
  },
53
53
  "optionalDependencies": {
54
- "@mintlify/package-builder": "0.0.151",
54
+ "@mintlify/package-builder": "0.0.153",
55
55
  "fsevents": "2.3.3",
56
56
  "keytar": "7.9.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@inquirer/prompts": "7.9.0",
60
- "@mintlify/common": "1.0.1362",
61
- "@mintlify/editor": "0.0.641",
62
- "@mintlify/link-rot": "3.0.1611",
60
+ "@mintlify/common": "1.0.1364",
61
+ "@mintlify/editor": "0.0.643",
62
+ "@mintlify/link-rot": "3.0.1613",
63
63
  "@mintlify/models": "0.0.393",
64
- "@mintlify/og": "0.0.161",
65
- "@mintlify/prebuild": "1.0.1540",
66
- "@mintlify/previewing": "4.0.1628",
64
+ "@mintlify/og": "0.0.163",
65
+ "@mintlify/prebuild": "1.0.1542",
66
+ "@mintlify/previewing": "4.0.1630",
67
67
  "@mintlify/ts-config": "2.0.2",
68
68
  "@mintlify/validation": "0.1.971",
69
69
  "@tsconfig/recommended": "1.0.2",
@@ -113,5 +113,5 @@
113
113
  "yargs": "17.7.1",
114
114
  "zod": "4.3.6"
115
115
  },
116
- "gitHead": "0402f6282df5462e010e77847d8b06953a7063a6"
116
+ "gitHead": "94b8d8496439d9bec815f464ca867a76c98447cb"
117
117
  }