Commit Graph

2081 Commits

Author SHA1 Message Date
Oleh Prypin
3363c615de Update docs - "best-of-mkdocs" became "catalog" 2023-06-07 00:39:01 +02:00
Oleh Prypin
395daa05fb Merge remote-tracking branch 'origin/master' into getdeps 2023-06-04 23:24:58 +02:00
Timothée Mazzucotelli
73c640f73e Hide instance-attribute labels in docs (#3238) 2023-06-04 18:43:18 +02:00
Oleh Prypin
32d8c3a986 Expand config.extra_javascript to support type, async, defer
The top-level template object `extra_javascript` gets soft-deprecated because it still reports only a list of plain strings.

Themes need to take action and pick up the new config keys from `config.extra_javascript` instead.
2023-06-04 00:37:41 +02:00
Oleh Prypin
cc63a4bedf Include *.mjs files into javascript_files() 2023-06-04 00:37:41 +02:00
Oleh Prypin
0f793b9984 Make TemplateContext typed, move utils.filters to utils.templates 2023-06-04 00:37:41 +02:00
Oleh Prypin
73e503990e Make it possible to create a subclass of SubConfig[T]
`SubConfig[SomeType]()` is now the preferred way to express `SubConfig(SomeType)`
but more importantly, it is now possible to subclass `SubConfig[SomeType]` for post-processing of the value.
2023-06-04 00:37:41 +02:00
Oleh Prypin
8315da2248 More concise error message in SubConfig 2023-06-04 00:37:41 +02:00
Oleh Prypin
1db8e884fa Strip trailing _ from config members, to bypass Python reserved words
Example of adding an `async` boolean option that can be read through `config['async']` or `config.async_`:

    class ExampleConfig(Config):
        async_ = Type(bool, default=False)
2023-06-04 00:37:41 +02:00
Oleh Prypin
fce89f71a9 Fix propagating warnings from sub-items of ListOfItems 2023-06-04 00:37:41 +02:00
Oleh Prypin
c4db02b586 Stop using defer for most scripts, move them to the end of body 2023-06-04 00:37:35 +02:00
Oleh Prypin
e254d4b1bc Consistently use tojson for pasting strings to JavaScript 2023-06-03 21:12:11 +02:00
Oleh Prypin
b4c02e53ac Update highlight.js to version 11.8.0 2023-06-03 15:52:22 +02:00
Oleh Prypin
41c6ee2de7 Enforce that imports are under if TYPE_CHECKING if possible (#3236) 2023-06-03 15:51:18 +02:00
Oleh Prypin
1363c7c390 Upgrade PyPy in CI 2023-06-03 15:36:39 +02:00
Oleh Prypin
d4d483c779 Print the local URL of pages that are "built only for the preview"
And refactor `LiveReloadServer` to not start listening in the constructor
2023-06-03 15:07:35 +02:00
Oleh Prypin
5af8bd3053 Infer titles of pages based on full Markdown parsing (#3191)
Properly parse Markdown and report the first H1 tag rather than naively looking for `# Stuff` at the start of the doc.

This satisfies feature requests such as supporting setext-style headers and fixes attr-list suffixes that failed to be ignored.

Co-authored-by: Hendrik Polczynski <hendrikpolczyn@gmail.com>
Co-authored-by: Darrick Herwehe <darrick@exitcodeone.com>
2023-05-29 21:59:31 +02:00
Oleh Prypin
89f15d9c69 Add tests for the build process - files, exclusions, plugins 2023-05-29 11:11:54 +02:00
Oleh Prypin
a3f0d4be50 Move logging DuplicateFilter to utils, enable it only in __main__ 2023-05-29 01:04:29 +02:00
Oleh Prypin
9fdcb435d6 Refactor plugin tests 2023-05-29 01:04:29 +02:00
Oleh Prypin
930ae26a55 New flag mkdocs serve --clean - simulate a pure mkdocs build and then serve
Also rename `--dirtyreload` flag to `--dirty` (keep the old name working)
2023-05-29 01:04:29 +02:00
Oleh Prypin
f37ce51da1 Serve excluded files in mkdocs serve + new not_in_nav config
* Docs that match any of the `not_in_nav` patterns will not produce warnings about never being included into the nav.

* Files that are excluded by `exclude_docs` will now be preserved in the `Files` collection and will even be rendered but only in `mkdocs serve` mode - such files will have a `DRAFT` notice prepended to the content.
2023-05-29 01:04:29 +02:00
Oleh Prypin
67e0e4e052 New exclude_docs config: gitignore-like patterns of files to exclude
These files will not be picked up into the `Files` collection and as such, also the final built site.

Also adds the ability to *un*-ignore the files that MkDocs forcibly ignores.
2023-05-28 23:10:25 +02:00
Oleh Prypin
e08c1089d8 Revert "Cache the value of documentation_pages"
This reverts commit 4e0429e8f5.
2023-05-28 23:08:28 +02:00
Oleh Prypin
8ecdfb2510 Clarify that Private config can be accessed, add a type to mdx_configs (#3229) 2023-05-26 18:54:32 +02:00
Oleh Prypin
562d5e14c1 Un-pin upper version of Python-Markdown (#3222)
Reverts commit dd7986ff7b
2023-05-18 18:44:44 +02:00
Oleh Prypin
62e312478e Modernize type annotations using pyupgrade (#3219)
* https://peps.python.org/pep-0563/ - Postponed Evaluation of Annotations
* https://peps.python.org/pep-0585/ - Type Hinting Generics In Standard Collections
* https://peps.python.org/pep-0604/ - Allow writing union types as `X | Y`
2023-05-14 22:49:34 +02:00
Oleh Prypin
3eb834ebd1 Remove deprecated localization commands (#3218) 2023-05-14 22:40:51 +02:00
Oleh Prypin
566a5bdda8 Allow paths traversing above the root - in nav and extra_ (#3010)
+ Refactor and expand tests for normalize_url
2023-05-09 20:56:54 +02:00
Oleh Prypin
5c9e4dcfad Merge pull request #3209 from mkdocs/desturi
Allow to set a different `dest_uri` when creating a `File`
2023-05-08 22:14:57 +02:00
Oleh Prypin
4e0429e8f5 Cache the value of documentation_pages 2023-05-07 17:29:03 +02:00
Oleh Prypin
d5af6426c5 Allow to set a different dest_uri when creating a File 2023-05-07 17:29:03 +02:00
Zac Knitter
2a232bf153 Update customizing-your-theme.md (#3215)
Fixed typo
2023-05-07 10:20:05 +02:00
Oleh Prypin
b776ad8820 Deprecate mkdocs.utils.warning_filter (#3008) 2023-05-04 21:59:58 +02:00
Kyle McNally
3c3670d92c Upgrade readthedocs theme to v1.2.0 (#3058)
* New styles for breadcrumbs and kbd tag
* Fix formatting of: definition lists, citations, table cells with multiple paragraphs,
2023-05-04 21:59:14 +02:00
Oleh Prypin
3d1b0113c2 Release 1.4.3 (#3208) 1.4.3 2023-05-02 23:16:34 +02:00
Oleh Prypin
4ac1484de3 Link to Best-of-MkDocs instead of Plugins wiki in docs (#3207)
https://github.com/mkdocs/best-of-mkdocs
2023-05-02 22:42:16 +02:00
Oleh Prypin
36205e30dd New get-deps command: infer PyPI depedencies from mkdocs.yml
The user story is that the following command should let you "just build" any MkDocs site:

    pip install $(mkdocs get-deps) && mkdocs build

This cross-references 2 files:

* mkdocs.yml - `theme`, `plugins`, `markdown_extensions`
* projects.yaml - a registry of all popular MkDocs-related projects and which entry points they provide - downloaded on the fly

-and prints the names of Python packages from PyPI that need to be installed to build the current MkDocs project
2023-05-01 19:02:22 +02:00
Julien Bidoret
ea1c6c468d Highlight.js style declaration in readthedocs theme (#3199)
Co-authored-by: Oleh Prypin <oleh@pryp.in>
2023-04-28 16:44:17 +02:00
Daniel Mundra
97440caf63 Add search input field labels using aria-label (#3046)
* Adding aria-label to search input on the search.html page
* Adding aria-label to the search input field for the search box
2023-04-28 16:28:02 +02:00
Micah Jerome Ellison
f3f6631d2a Fix accessibility issue with top-level breadcrumb in ReadTheDocs theme (#3129)
Change top-level breadcrumb link's inappropriate alt tag to aria-label for accessibility

Co-authored-by: Oleh Prypin <oleh@pryp.in>
2023-04-28 16:25:15 +02:00
Oleh Prypin
876995cdf3 Generalize tr_TR translations to just tr, explain how to decide this (#3195) 2023-04-27 19:16:19 +02:00
Oleh Prypin
052e023477 Revert functional part of previous commit - not all hosts have https 2023-04-27 19:14:13 +02:00
Ultrabug
e6189fde03 update links and messages to https (#3192)
* docs(guides): update links to use https with newer urls

* docs(gh_deploy): update user CNAME message to use https

---------

Co-authored-by: Oleh Prypin <oleh@pryp.in>
2023-04-24 11:44:49 +02:00
kiraware
1f1bfad763 Add Indonesian translations of themes (#3154) 2023-04-22 12:31:14 +02:00
Oleh Prypin
f5a9a7b38a Add hooks to sys.modules because some Python features rely on this (#3193) 2023-04-22 12:25:36 +02:00
Oleh Prypin
324f486adc Docs: fix broken links to pocoo.org 2023-04-21 22:24:36 +02:00
pcgaustad
30e9b6aaf4 Mention in the documentation that a fork of the repository is necessary for translating the included templates (#3026)
Co-authored-by: Ultrabug <ultrabug@users.noreply.github.com>
2023-04-21 22:19:49 +02:00
Muescha
635dfc1a33 Docs: fix twitter link in the footer (#3094) 2023-04-21 22:15:26 +02:00
Oleh Prypin
7d32815367 Apply the same to mkdocs theme 2023-04-21 22:04:49 +02:00