300 Commits

Author SHA1 Message Date
Jim Porter
d34062eaf5 Update to lunr.js 2.3.8; resolves #1989 2020-02-21 19:38:17 -05:00
Jim Porter
a7c349cffa Update to lunr-languages v1.4.0; resolves #1729
This renames the Dutch language code to `nl`, the Japanese code to `ja`, and
adds support for Arabic (`ar`) and Vietnamese (`vi`).
2020-02-21 19:08:35 -05:00
Jim Porter
37e645d623 Use toc_tokens to generate the TOC
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.
2020-02-17 17:27:12 -05:00
Waylan Limberg
44f3ae212d Ensure nested dot files in themes are ignored.
Also, document how all files within themes are treated by MkDocs.
Fixes #1981.
2020-02-12 18:35:14 -05:00
Maximilian Albert
bf0698a94a Fix link to virtualenv user guide 2020-02-11 14:23:44 -05:00
Jim Porter
058837f68e Improve support for tall nav headers in the mkdocs theme (#1969)
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
2020-01-30 09:34:04 -05:00
Waylan Limberg
61105ce56d Update min Markdown version to 3.0. 2019-12-23 15:54:26 -05:00
Waylan Limberg
2491c1433a Update min dependency to Jinja 2.10.1.
Jinja 2.10.1 patched a security valnerability. See the release notes here:
https://github.com/pallets/jinja/blob/master/CHANGES.rst#version-2101

Closes #1780.
2019-12-20 15:01:02 -05:00
Alec Wertheimer
8662df01de Note mkdocs theme filename changes in release notes.
Ref #1897.
2019-12-20 14:27:20 -05:00
Jim Porter
f70a48ee20 Add --use-directory-urls/--no-directory-urls to command line options
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.
2019-12-20 13:33:31 -05:00
Waylan Limberg
1b8473a652 Add support for Python 3.8. 2019-12-20 09:21:35 -05:00
Waylan Limberg
f601e0ae62 Drop Python 3.4 support. 2019-12-20 09:21:35 -05:00
Waylan Limberg
c9032bd6bf Drop Python 2.7.
* 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.
2019-12-20 08:44:07 -05:00
Jim Porter
15e31f7e68 Add support for customizing navigation bar styles in the mkdocs theme 2019-12-16 15:55:09 -05:00
Waylan Limberg
2172c9f999 Select asyncio event loop on Windows for PY3.8+
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.
2019-12-12 10:19:46 -05:00
Waylan Limberg
0cd86735c8 Nested index is not homepage (#1921)
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.
2019-12-07 22:10:27 -05:00
Iain King
98823e09b9 Provide sensible error message when git not found (#1797) 2019-11-27 16:00:10 -05:00
Lars
f44428c93c Ensure theme files do not override docs_dir files on Windows (#1878)
Fixes #1876.
2019-11-27 09:00:35 -05:00
Alper
60451b7122 Properly identify deployment version (#1880)
Fixes #1879.
2019-10-11 20:30:39 -04:00
Waylan Limberg
efdb5cf7f0 Properly build ValidationError message for custom_dir.
Fixes #1849
2019-09-02 16:17:26 -04:00
Heini Fagerlund
eb5f3f84e5 contributing.md: fix typos, add link (#1774) 2019-03-25 17:43:44 -04:00
Waylan Limberg
d101522aa1 Exclude Markdown files and READMEs from theme.
Account for capitalization differences and all supported Markdown extensions. Fixes #1766.
2019-03-13 14:14:53 -04:00
brandongc
31b3f68abc skip external links in nav in sitemap (#1748)
Fixes #1742.
2019-02-14 17:50:31 -05:00
Waylan Limberg
5c642decbd Account for encoded URLs. (#1673)
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.
2018-11-03 17:07:40 -04:00
Waylan Limberg
f8ac3c7ee0 Ensure theme files do not override docs_dir files (#1672)
Fixes #1671.
2018-11-02 16:20:01 -04:00
Santos Gallegos
00d7383018 Add canonical tag to readthedocs theme (#1669)
Close #1667
2018-10-30 15:36:14 -04:00
Waylan Limberg
c882f7a0b3 Do not normalize URL fragments
Fixes #1655
2018-10-12 22:24:08 -04:00
Yeray Diaz Diaz
259c2b102b Use lunr.py for prebuilding indices (#1607) 2018-09-29 09:07:53 -04:00
Waylan Limberg
54a6e9efbc Update to bootswatch 4.1.3. (#1597)
Fixes #1563.
2018-09-27 14:51:11 -04:00
Waylan Limberg
873b970f7f Update readthedocs theme with upstream (#1594)
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.
2018-09-27 13:19:17 -04:00
Waylan Limberg
8a9a60989c Bump version to 1.1.dev 2018-09-27 11:04:59 -04:00
Jon Dufresne
fc53f1932e Prefer https:// URLs where available 2018-09-18 11:21:13 -04:00
Waylan Limberg
592e0852fe Bump version to 1.0.4. 2018-09-07 12:02:41 -04:00
Waylan Limberg
6a57799769 Bump version to 1.0.3. 2018-08-29 14:21:44 -04:00
Waylan Limberg
954b4cb0da Dump version to 1.0.2 2018-08-22 11:55:27 -04:00
Waylan Limberg
da3a252cde Bump version to 1.0.1. 2018-08-13 13:40:33 -04:00
Waylan Limberg
8bd00d5f91 markdownlint cleanup 2018-08-03 10:26:40 -04:00
Waylan Limberg
1f41f33eae Upped version 1.0 Final! 2018-08-03 10:26:40 -04:00
coliff
b4b49a1f52 HTTPS Links 2018-07-19 11:53:56 -04:00
Waylan Limberg
21449eeea8 Don't conflict with accessibility shortcuts.
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
2018-07-13 17:40:31 -04:00
Waylan Limberg
b89d309c5f User friendly YAML parse errors.
This provides a clearer error for users who have an invalid config file. 
Partially addresses #1543.
2018-07-12 16:17:24 -04:00
Waylan Limberg
7c0d0b7624 Add official support for PY37. (#1545)
* Use Python 3.7-dev in Travis until they add official support for PY37.
* PY37 requires PyYAML 3.13+.
2018-07-12 15:24:19 -04:00
Waylan Limberg
c99ea4e250 Missing theme config file raises an error.
Previously a warning was raised and the build proceeded.
2018-07-11 14:54:58 -04:00
Waylan Limberg
ad867796eb theme_dir config fully Deprecated.
An error is now raised if the option is defined.
2018-07-11 14:54:58 -04:00
Waylan Limberg
d0c67b849c Empty extra_css and extra_javascript settings no longer raise a warning.
This fully deprecates autopopulating those settings.
2018-07-11 14:54:58 -04:00
Waylan Limberg
da92f72ec8 Add support for YAML meta data. (#1542)
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.
2018-07-11 13:18:20 -04:00
Waylan Limberg
2f34aec1eb Up version to 1.0.dev
And update release notes to include 0.17.5.
2018-07-06 11:47:11 -04:00
Waylan Limberg
2e9de0a297 Add a highlightjs config setting (#1533)
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.
2018-07-05 13:47:16 -04:00
Waylan Limberg
de576b03bd Close search modal when result is selected.
Fixes #1527.
2018-07-04 17:59:54 -04:00
Waylan Limberg
a1b26ebabe Update documenation. 2018-07-03 15:26:28 -04:00