Commit Graph

231 Commits

Author SHA1 Message Date
Waylan Limberg
cc45748e72 Revert "Add --wait flag to serve command."
This reverts commit f73f221f1f.

It seems that the `wait` flag does not interupt the file watcher,
but simply delays builds. Therefore, a plugin which writes to the
`docs_dir` will still result in an infinite loop. That being the
case, the `wait` flag is not useful to us. See #2285.
2021-04-08 13:56:32 -04:00
Waylan Limberg
1beaf22245 Restore styling of tables in the readthedocs theme
Rather than including this is the JS form the upstream theme, the JS
has been included in a separate file `theme_extra.js` so that is is not
lost in a future update copied form upstream. Fixes #2028.
2021-04-07 20:22:08 -04:00
Waylan Limberg
21b3d1d431 Ensure each instance of Config is unique
Replace the global variable `mkdocs.config.DEFAULT_SCHEMA` with
the function `mkdocs.config.defaults.get_schema()`. An instance is no
longer created on import (eliminating circular imports under certain
circumstances) and each call to `get_schema()` builds a new instance
of each object. Fixes #2289.
2021-04-05 18:48:59 -04:00
Waylan Limberg
a118183f5e Refactor docs (#2344)
The homepage has been redesigned. The "Installation" and "Getting Started" sections were moved to their own respective pages. Then, the homepage was restyled so that the list of features appear as a grid of cards.

The developer specific pages were moved to a new section: `dev-guide`. Any old URLs redirect to the new ones.
2021-04-04 16:14:29 -04:00
Masanori Matsumoto
aa20a9d086 Fix support for ja or jp in search. (#2178)
Add tinyseg.js included with lunr-languages v1.4.0. Fixes `MODULE_NOT_FOUND` error when lang is `ja` or `jp`.
2021-03-24 19:38:33 -04:00
Ginger Old
dd903d3092 Upgrade highlightjs to 10.5.0 for better code highlighting
Closes #2312.
2021-02-28 17:01:13 -05:00
Mick Orbik
4faa18d095 Added configuration for search indexing strategy (#2309)
Allows a user to supply a `indexing` configuration to the search
plugin which controls what to include in the search index (full,
sections, titles)
2021-02-21 15:05:14 -05:00
Ultrabug
b1f5dae055 files structure: move src_paths as a dynamic property, add remove
Plugins wishing to manipulate the Files structure have an append
method but can't dynamically work on src_paths since it's computed
once on Files instanciation

This commits allows plugins to manipulate Files trough append and
remove of file objects while not having to care about the src_paths
since it's now a dynamically computed property
2021-02-16 15:16:22 -05:00
Timothée Mazzucotelli
3c9358bb6a Add plugin error exception and event
Related to #2082.
2020-12-23 19:23:31 -05:00
Waylan Limberg
f4de3c7387 Support Environment Variables in config file
Environment variables can be assigned as values in the configuration
file using the !ENV tag. Resolves #1954.

The behavior is defined in the third-party package pyyaml_env_tag:
https://github.com/waylan/pyyaml-env-tag
2020-12-23 13:02:21 -05:00
Waylan Limberg
c7d86d4989 Support PY39 and drop PY35 (#2260)
PyYAML 3.13 fails to install on PY3.9 on MacOS. The next public release was 5.1.
2020-12-21 16:31:38 -05:00
Waylan Limberg
5c2b4f1353 Update ghp_import dependency to 1.0
Replace vendored (and modified) copy of ghp_import with dependency on
upstream library. As of version 1.0+ ghp_import includes a Python API.

MkDocs can now benefit from recent bug fixes and new features, including the following:

* A `.nojekyll` file is automatically included when deploying to GitHub Pages.
* The `--shell` flag is now available, which reportedly works better on Windows.
* Git author and committer environment variables should be respected.

Resolves #2170 and resolves #1383.
2020-12-21 14:02:02 -05:00
Tim Vink
3e8b3481ff Remove sidebar when printing (#2193) 2020-12-07 14:28:15 -05:00
Waylan Limberg
f73f221f1f Add --wait flag to serve command.
Fixes #2061.
2020-11-06 10:27:11 -05:00
Waylan Limberg
0080e189db Release-notes cleanup 2020-11-04 09:12:32 -05:00
Waylan Limberg
96d1e230fa Exclude theme from watched files by default.
Add a --watch-theme option which theme devs can enable if needed.
Most users never modify the theme files and watchers are resource hogs.
Fixes #2092.
2020-11-03 14:19:29 -05:00
Lukas Geiter
00b62aa144 Fix _get_by_type for Section 2020-10-28 11:00:21 -04:00
Waylan Limberg
ff0b726056 Bump version to 1.1.2. 2020-05-14 11:07:56 -04:00
Waylan Limberg
58d70c2f87 Normalize IP addresses and change error to warning
All IP addresses passed to `dev_addr` are now normalized.
`127.000.000.001` is normalized to `127.0.0.1`.

With apologies to docker container users, the address `0.0.0.0`
no longer raises an error but a warning instead. Apparently,
docker containers need to use that address, even in dev environments.

Closes #2108.
2020-05-14 10:51:01 -04:00
Waylan Limberg
85b3befb6a Bump version to 1.1.1. 2020-05-12 11:43:50 -04:00
Ofek Lev
fa5aa4a26e Make compressed sitemap deterministic (#2100) 2020-05-12 10:05:39 -04:00
Oleh Prypin
1ad6a91e3f Use README.md as index.html when use_directory_urls is false 2020-04-26 18:34:05 -04:00
Waylan Limberg
3bada392d2 Ignore links which start with a backslash.
Fixes #1680.
2020-04-19 17:52:19 -04:00
Waylan Limberg
7b68f7b828 Pass builder to on_serve event.
Every call to `server.watch` requires `builder` to be passed in. If
users are to add their own watched files, then they need access to
`builder`. Fixes #1952.
2020-04-19 16:15:29 -04:00
Waylan Limberg
7428679a1c Set dependency to lunr[languages]==0.5.8.
Lunr.py version 0.5.8 maintains compatability with Lunr.js 2.3.8, but
restricts its dependnecy to nltk>=3.2.5,<3.5, which avoids installation
issues on some Docker images. Fixes #2062.
2020-04-18 16:30:29 -04:00
wodny
63b3eb5a1f Fix readthedocs code colors
Fixes #2027.
2020-03-24 14:18:40 -04:00
Jim Conner
2505a907f4 Add minimum search length configuration parameter.
Allow users to set their own minimum search term length.  Fixes #2014.
2020-03-16 14:35:06 -04:00
Waylan Limberg
653ba22230 Clean up dev_addr validation and disallow 0.0.0.0
MkDocs has never supported using the included server for production.
However, some users have been using it that way. This would prevent that.

We also actually validate IP addresses now.
2020-03-11 22:45:49 -04:00
Tsuyoshi Hombashi
74713147ec Fix a minimum dependency description
Markdown package require 3.2.1 at mkdocs 1.1
2020-02-26 12:49:24 -05:00
Waylan Limberg
eddeeab066 Bump version to 1.1 2020-02-22 19:10:35 -05:00
Jim Porter
13337eba9f Nested dropdowns *are* supported in the mkdocs theme
Despite Bootswatch not supporting nested dropdowns, the theme-specific CSS for
the mkdocs theme does add support for it, so we can remove the warning from
the release notes.
2020-02-21 19:40:00 -05:00
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