209 Commits

Author SHA1 Message Date
Waylan Limberg
80feaf03a4 Deprecate google_analytics config option.
A new replacement option (theme.analytics.gtag) was added to the built-in themes. Multiple different services could be offered under theme.analytics. At this time only support for gtag exists, but more could be added in the future.

Fixes #2252.
2021-06-02 11:02:01 -04:00
Waylan Limberg
57b5ccd7d6 Add support for Configuration Inheritance
* Support dict only markdown_extensions config
* Support dict only plugin config
* Remove explicit conversion to Unicode as PY2 is no longer supported.
* Refactor yaml_load so that is can recursively call itself.

Fixes #2218.
2021-06-01 14:50:00 -04:00
Waylan Limberg
d54419d54b Document deploying to local files 2021-05-18 13:13:05 -04:00
Waylan Limberg
5fc92b96e7 Documentation improvements
Clean up and improve the documentation following some recent changes.
Specificaly, ensure we consistantly document *two* required settings.
2021-05-18 13:13:05 -04:00
Waylan Limberg
b89ec5792e Ensure site_url and use_directory_urls do not conflict.
The site_url config option is now required. If it is set to an empty
string, then use_directory_urls will be forced to false. Each will
issue a warning if not properly set. In a future release we may
raise an error instead.

Fixes #2189.
2021-05-17 09:44:28 -04:00
Waylan Limberg
e2a3480735 Remove hard dependency on lunr.py (#2402)
Begin deprecation of 'python' option of 'plugins.search.prebuild_index'.
2021-05-13 15:20:35 -04:00
Álvaro Mondéjar
a8ec4b64a3 Add 'es' themes translations
Document that, when a new translation is added for a theme, the documentation about the theme must be updated.
2021-05-07 09:57:19 -04:00
Ultrabug
e1b77ab66e Support theme localization
A framework for translating themes as been added, which includes:

1. Use of Jinja's `i18n` plugin for translating phrases in templates (not page content).
2. A French translation of the built-in themes (contributions in other languages are welcome).
3. A new `theme.locale` option to define the locale/language of the site.
4. The search plugin uses the value of `theme.locale` as its default 'lang'.
5. Third party themes may chose to use the framework (use is optional).
6. A documented workflow for translating MkDocs built-in themes.
7. Custom tooling for use by translators and theme devs.

The dependencies are not installed by default and are not needed to use MkDocs without translations. However, for anyone who wants to make use of the features, `pip install mkdocs[i18n]` will install all necessary dependencies.

Relates to #211.
2021-05-06 14:30:21 -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
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
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
SaintMalik
bd73399f55 Fix broken url in docs
## Summary

Easy navigation and easy reading for others
2020-12-17 13:18:43 -05:00
PoojaChandak
eba0bc51e1 Update configuration.md
Observed a few changes. Suggesting the same.
2020-10-27 14:31:04 -04:00
Chris McCafferty
22537dabac Fix a typo 2020-10-27 14:29:41 -04:00
Justin M
b440c4b923 Fixing broken internal anchor link 2020-10-27 14:27:28 -04:00
Tim Vink
b97b658f7b Fix typo 2020-10-27 14:26:35 -04:00
Peter Bajurny
aba9dbffcf Fix relative link to Index Pages in Writing Your Docs help page
The link links to `index_pages` with an underscore but the page as currently rendered has that link as `index-pages` with a hyphen.
2020-10-27 14:22:54 -04:00
Tim Vink
2d9d565712 Add link to Jinja environment class
Helpful for plugin developers
2020-10-27 14:22:00 -04:00
Waylan Limberg
a4eb4eb42b Fix markdownlint test (#2095)
Travis only gives us Node.js version 8 so we must use an older
version of markdownlint. To declare a newer node.js version we
lose the ability to have Python as the lang and install tox.
If/when the default node version gets updated, remove the
version restriction on markdownlint.
2020-05-07 00:07:38 -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
Ofek Lev
afa18ae2c0 Fix typo 2020-04-12 17:40:37 -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
albandewilde
2b92209d12 Correct the block name of the search box in the doc
As mentionned here: https://github.com/mkdocs/mkdocs/issues/1142#issuecomment-282899537
I just correct the name in the documentation
2020-03-09 16:13:01 -04: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
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
d07f5288da Fix typo 2020-02-11 14:23:24 -05:00
Adam Twardoch
262c2b70f3 Links to the MkDocs Plugins wiki page, themes and plugins 2019-12-30 09:30:08 -05:00
Waylan Limberg
d8f8e5be3c Cleanup MarkdownLint issue in docs. 2019-12-20 09:55:19 -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
8c8f7bb672 Document that dot files are ignored. (#1925)
Also added a few additional clarifications about how MkDocs handles files in the docs_dir.

Fixes #1924.
2019-12-11 15:55:14 -05:00
Dan Untenzu
f200a60060 Docs: Fix YAML syntax in examples
* Fix indentation
* Quote strings
2019-08-13 09:15:22 -04:00
Dan Untenzu
625e423b76 Docs: Clarify page title generation 2019-08-13 09:12:31 -04:00
Dan
b967d0184d Docs: Clarify supported header style
Only atx-style headers are supported for page titles,
not Setext styles.

Fixes #1837
2019-08-13 09:08:16 -04:00
Florimond Manca
a84b5a27df Fix broken readthedocs links 2019-06-23 18:58:11 -04:00
Waylan Limberg
9ae04213b9 Clarify mkdocs_theme.yml is ignored by theme.custom_dir
This only updates the documentation to better reflect actual behavior.
The config for `theme.custom_dir` is defined in the `theme` config
option of `mkdocs.yml`. Therefore, any `mkdocs_theme.yml` file within
a custom_dir is ignored.
2019-06-17 18:58:50 -04:00
devakker
32d2ed3bee Add warning to docs about usage of absolute paths in links.
Fixes #1757.
2019-03-07 09:52:08 -05:00
Terry Zhao
bebf3791aa docs(plugins.md): outdated docs (#1685) 2018-11-21 23:38:03 -05:00
Terry Zhao
1897177ab0 docs(plugins.md): fix typo
plugins.md:357

"The `post_template` event .." -> "The `post_page` event .."
2018-11-21 15:43:31 -05:00
Yeray Diaz Diaz
259c2b102b Use lunr.py for prebuilding indices (#1607) 2018-09-29 09:07:53 -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
Zrss
3642c4e03e Document --dev-addr instead of --dev_addr (#1638)
Fixes #1637.
2018-09-25 09:51:05 -04:00
Waylan Limberg
e37d1c9b06 Example now matches actual usage.
As pointed out in #1633 the example of overriding a template block used an undefined block name. The example has been updated to use an actual block name.
2018-09-20 13:09:25 -04:00
Jon Dufresne
fc53f1932e Prefer https:// URLs where available 2018-09-18 11:21:13 -04:00
Waylan Limberg
1739e708f5 Fix typo 2018-08-27 13:08:20 -04:00
Waylan Limberg
f13bf0148a Remove reference to now deprecated template vars (#1610)
Fixes #1608.
2018-08-27 11:00:51 -04:00
c-bb
c16ea3ae77 writing-your-docs.md: fix typo 2018-08-24 10:52:52 -04:00