This patch improves the consistency of TOC levels, so now the level is always
equal to the N in the `<hN>` tag. It also allows users of the MkDocs theme to
set the navigation depth to show in the TOC panel (defaulting to 2).
Resolves#1910 and resolves#770.
This adds a new JS function called `applyTopPadding` that updates the top
padding of a few elements in the document to account for the height change
when the nav header is more than one row. Resolves#716
Standardize the list of build in arguments that can be passed to
commands that build docs (build, serve, and gh-deploy). All three
can now use --config-file, --strict, --theme, --theme-dir, and the new
--use-directory-urls/--no-directory-urls. Fixes#1401.
* Disable Linkchecker Test.
* Switch to unittest.mock in standard lib.
* Apply `pyupgrade --py3-plus`.
* Note: Using `builtins.open` mocks all calls to `open`, including test setup
(such as in `load_config`). Whereas, `path.to.namespace.open` only mocks
`open` in that namepsace. This all worked differently when we used `io.open`
as that wasn't a builtin to begin with.
* Add a helpful error msg for PY2 users who use non-standard install methods.
Closes#1926.
As of Python 3.8, the default event loop on Windows is `proactor`,
however Tornado requires the old default "selector" event loop.
As Tornado has decided to leave this to users to set, MkDocs needs
to set it. See https://github.com/tornadoweb/tornado/issues/2608.
Fixes#1885.
A user could place a nested (in the file structure) index page on the root level of the nav.
That file should not return `True` for `page.is_homepage`. Fixes#1919.
Encode URLs of all internal documents (to account for spaces in
filenames, etc). Then unencode Markdown links to internal pages before
confirming existence, etc. Fixes#1670.
Fixes#588 and fixes#1374.
# Some implementation notes:
## `include_homepage_in_sidebar` setting
Note that the homepage is always linked from the site_name above the
search box. Therefore it does not need to also be in the nav tree.
In the upstream Sphinx theme, this is controlled when defining the
toctree. However, Sphinx has a separate setting for identifying the
"homepage". In MkDocs the homepage is identified as the first item in
the `nav`. Therefore, without this setting you can't exclude the
homepage from the sidebar like you can in Sphinx. With this setting we
get feature parity.
## Nested sections
This output is a little weird as the section title is a link that does
nothing when you click it. You need to click the `+` to expand the
submenu. But that is what the upstream theme requires to work.
In both built-in themes, the default next/prev shortcut keys were
changed from arrows to n/p as the arrows conflict with common browser
accessibility extensions.
In the mkdocs theme, users can now configure the shortcuts to whatever
they want. Note that these config options are theme specific. The
readthedocs theme does not get these options as they are not available
on the parent theme.
Fixes#1502
If the frontmatter is surrounded by YAML deliminators, then it is parsed
as YAML. Otherwise it is parsed as MultiMarkdown meta-data and each
value is returned as a joined string.
Closes#1471.
The built-in themes now include support for enabling/disabling
highlight.js. They also use a CDN to load the files. As the CDN only
includes 23 languages, a second setting to support more languages
is included.
If a user wishes to use a different tool for highlighting, they can
"disable" highlight.js and then use extra_css and/or extra_javasript
to add support for their tool of choice.