Migrate from sphinx-build to mkdocs
Preflight
-
Use init to create
docs
directory and copy over nonrst
files (such as images and sample data). -
To effectively migrate content the sphinx-build rst docs are scanned to collect information about the anchors, headings and downloads.
-
The following is produced during preflight scans:
Troubleshooting:
-
You can run these scans independently:
-
To troubleshoot an individual file, the resulting
index
can be sent to standard out:
Navigation
-
To generate out navigation tree:
2. The output is printed to standard out and may be appended to mkdocs.yml
file.
Content Migration
Format conversion from sphinx-build reStructuredText files to mkdocs Markdown content.
-
To bulk convert all content from
rst
tomd
: -
Review this content you may find individual files to fix.
Some formatting is easier to fix in the
rst
files before conversion:- Indention of nested lists in
rst
content is often incorrect, resulting in restarted numbering or block quotes. - Random
{.title-ref}
snippets is a general indication to simplify the rst and re-translate. - Anchors or headings with trailing whitespace throwing off the heading scan, resulting in broken references
- Indention of nested lists in
Troubleshooting:
-
Convert a single file:
-
Bulk convert files in a folder:
Known limitations
Some things are not supported by pandoc, which will produce WARNING:
messages:
-
Substitutions used for inline images
-
Underlines: replace with bold or italic
WARNING: broken reference 'getting_involved' link:getting_involved-broken.rst