chore(docs): migrate admonition titles and heading IDs to MDX syntax - #4628
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue URL: internal
What is the current behavior?
We use two proprietary Docusaurus syntaxes that are being phased out:
:::warning My Title. 43 occurrences across 38 files.{#my-id}. 2 occurrences.Neither is standard. Docusaurus calls both "proprietary Docusaurus syntax, leading to ecosystem incompatibilities" and recommends migrating:
Both only work today because of the MDX v1 compatibility shims in
mdx-loader. On every build,preprocessContent()rewrites our files in memory before MDX ever parses them:admonitionTitleToDirectiveLabel()converts:::warning My Titleto:::warning[My Title], andescapeMarkdownHeadingIds()escapes{#my-id}to\{#my-id}so MDX does not try to evaluate it as an expression.Those shims are the
markdown.mdx1Compatoptions, which Docusaurus v4 disables by default viafuture.v4.mdx1CompatDisabledByDefault.Separately,
troubleshooting/runtime.mdhas a malformed admonition where the closing:::sits mid-sentence:That renders as a note ending in "via", followed by an orphaned "the Ionic CLI." paragraph outside it. It dates back to at least v5.
What is the new behavior?
Both syntaxes are migrated to the standard forms, so the files no longer depend on the compat shims.
:::type My Titlebecomes:::type[My Title], the Markdown Directive syntax{#my-id}becomes{/* #my-id */}, a native MDX commentThe malformed note is also repaired so the sentence stays intact inside the admonition.
40 files changed, +45/-45. Scope is limited to the live docs trees,
docs/andversioned_docs/version-v7. The archived v5 and v6 trees are deliberately untouched, since they are absent fromversions.jsonand are served from standalone deployments rather than built from this repo.Does this introduce a breaking change?
Other information
This is part of a series preparing the docs for the
.mdto.mdxmigration.How to test
Review the modified pages below and confirm each admonition still renders with its title and correct styling.
Two specific things to check on the runtime page:
https://ionic-docs-git-fw-6456-pt2-ionic1.vercel.app/docs/troubleshooting/runtime#accessing-this
Current (v8)
v7