Commit Graph

1992 Commits

Author SHA1 Message Date
Oleh Prypin
8aafea1742 Fix overzealous validation of !relative tag (#3466)
If a Markdown extension immediately resolves the path inside its initialization (rather than just storing it for later as I was hoping) then it was failing the initial validation run that MkDocs does without populating an actual page yet.
2023-11-14 18:35:30 +01:00
Oleh Prypin
dc45916aa1 Allow adding event handlers at multiple priorities (#3448)
-within one plugin.
2023-11-08 18:33:38 +01:00
Oleh Prypin
0a4f3240d1 Use projects' own type annotations, stubs no longer needed 2023-11-02 00:02:29 +01:00
Vedran Miletić
0bf4963090 Quote pip arguments containing square brackets (#3456)
This is strictly necessary when using non-bash shells (e.g. tcsh).
2023-11-01 17:20:14 +01:00
Oleh Prypin
9455b079d8 Stop suppressing OSError indiscriminately during build (#3445)
This was aimed at user-facing "file not found" errors from "serve" but it can catch errors from plugins as well, and it only makes the errors very confusing.
2023-10-31 09:49:12 +01:00
Oleh Prypin
8909ab3f6d Reduce logs for invalid links if referring page is excluded (#3449)
* If source page and destination page is excluded, cap log level to DEBUG
* If source page is excluded, cap log level to INFO

Co-authored-by: Chris Mayfield <mayfiecs@jmu.edu>
2023-10-30 02:04:50 +01:00
Oleh Prypin
7ab01c24ff Add an enabled setting for all plugins (#3395)
For every plugin, the user can set `enabled: false` (or something based on an environment variable) and it will not kick in at all.

If the plugin has its own `enabled` config, there's no change for it in that case.
2023-10-30 01:58:27 +01:00
Oleh Prypin
f3d5c8dc8d Refactor File tests 2023-10-30 00:56:24 +01:00
Oleh Prypin
3a69c9a6dd Merge pull request #3443 from mkdocs/innav
Apply planned changes to `File.page` and `not_in_nav`
2023-10-30 00:56:09 +01:00
Oleh Prypin
ae93314b9a In verbose log, report each plugin's events individually (#3444) 2023-10-29 18:40:36 +01:00
Oleh Prypin
994ffff114 Clean up unused args in tests 2023-10-29 12:13:56 +01:00
Oleh Prypin
f31caca339 mypy: Stop ignoring missing imports 2023-10-29 10:49:15 +01:00
Oleh Prypin
d107e6d32c When nav config is not specified, apply file inclusion
to decide whether a file in included when generating the implicit nav.

Fixes #3336
2023-10-28 17:40:15 +02:00
Oleh Prypin
a94a014e01 Error when setting File.page to a type other than Page
As per the prior plan https://github.com/mkdocs/mkdocs/pull/3381#issuecomment-1712750515
2023-10-28 17:38:42 +02:00
Oleh Prypin
b5250bf9e2 Stop config validation after the first error (#3437)
If one config option completely fails validation, that means its value remains "raw" from YAML, which can cause unpredictable errors when validating other options that might look at the value. Instead just decide one error is enough.
2023-10-25 19:41:00 +02:00
sumebrius
49d02e48ed Add fallback git link for non-provider repos (#3435) 2023-10-25 19:40:42 +02:00
Oleh Prypin
3e0949a332 Merge pull request #3430 from mkdocs/ruffdocs
Apply more rules from ruff, esp. for docstrings
2023-10-20 15:31:30 +02:00
Oleh Prypin
3c9d0765ea Merge pull request #3429 from mkdocs/py37
Drop Python 3.7, officially support Python 3.12
2023-10-20 15:30:40 +02:00
Oleh Prypin
125f36f943 Enable more ruff rules 2023-10-16 22:42:10 +02:00
Oleh Prypin
4710d73999 Apply rules to docstrings 2023-10-16 22:41:10 +02:00
Oleh Prypin
0d8d1f2b4d Use features new to Python 3.8, apply positional-only args
(the latter constitutes a breaking change for MkDocs, but nobody should be relying on these as named args)
2023-10-16 22:39:14 +02:00
Oleh Prypin
e2a9576b24 Drop Python 3.7, officially support Python 3.12 2023-10-16 22:39:14 +02:00
Oleh Prypin
828f4685f2 Fix unittest invocation on Windows, don't apply coverage by default
-Tests actually weren't being run on Windows!
2023-10-16 22:32:28 +02:00
Oleh Prypin
cc76672d55 Workaround: babel depends on setuptools without declaring it
https://github.com/python-babel/babel/issues/1031
2023-10-16 22:32:28 +02:00
Oleh Prypin
ad73366e52 Fix tests on Windows 2023-10-16 22:32:28 +02:00
Oleh Prypin
b3992222b1 Move forward with some deprecations (#3425) 2023-10-16 22:32:08 +02:00
Oleh Prypin
44e6536060 Update CI to be consistent with deploy-release.yml 2023-10-14 13:35:26 +02:00
Oleh Prypin
79ae55e0cb Fix typo 2023-10-14 12:45:02 +02:00
Martin Donath
a6fef567bf Improve editing experience when using --livereload (#3391)
The livereload server connection is cancelled when the tab becomes inactive.
Once a tab becomes active, the livereload connection is immediately established again.
2023-10-14 12:27:16 +02:00
Oleh Prypin
00b648f088 Release 1.5.3 (#3392) 1.5.3 2023-09-18 23:23:33 +02:00
Oleh Prypin
63b50450fb Change PyPI deploy to rely on "trusted publishers" (#3400) 2023-09-18 18:13:47 +02:00
Oleh Prypin
abb133fbb1 Fix new lint warnings 2023-09-18 17:52:05 +02:00
Martin Donath
8c79426844 Abort livereload request before navigation (#3390) 2023-09-14 20:41:53 +02:00
Peter Dave Hello
f94ab3f62d Add zh_TW locale for built-in themes (#3370) 2023-09-13 18:21:59 +02:00
Oleh Prypin
0d6fc286fa Merge pull request #3383 from mkdocs/breadcrumbs
Fix breadcrumb display in readthedocs theme
2023-09-13 18:21:00 +02:00
Oleh Prypin
4bd896c8f2 Fix linkified breadcrumb items in readthedocs theme
A doc can never have a `link` attribute so this branch never kicked in.

Actually even now, this branch will still not kick in, only mkdocs-section-index makes this state possible.
2023-09-11 00:03:04 +02:00
Oleh Prypin
c070dd0202 Fix broken styling of breadcrumbs in readthedocs theme
Commit 3c3670d92c left it half way between the old and new style
2023-09-11 00:03:04 +02:00
Oleh Prypin
347c3a91dd Apply automatic fixes from ruff, show diff in CI 2023-09-11 00:02:51 +02:00
Oleh Prypin
759e1e3bae Keep the prior behavior of overwriting File.page (#3381)
unless the page value is a *strict* subclass of Page
2023-09-10 13:05:28 +02:00
Martin Donath
3db7b8c9c2 Allow plugins to provide their own Page (#3367)
Co-authored-by: Oleh Prypin <oleh@pryp.in>
2023-09-07 22:17:35 +02:00
Oleh Prypin
b0915b4697 Switch to "ruff" linter, enable many of its rules (#3368)
Co-authored-by: Ultrabug <ultrabug@ultrabug.net>
2023-09-04 10:02:38 +02:00
Oleh Prypin
94e9f17cd7 Prevent a stacktrace for theme: foo when theme is not installed (#3351)
This happens because the `theme` option fails validation (being not installed) but then validation of `plugins` option fatally fails because that option is invalid. Maybe in the future it would be better to change validation so it stops after the first error, because there can be countless such combinations of interactions.
2023-08-26 18:33:50 +02:00
Ultrabug
9cc8f24981 Add new supported languages by updating lunr-languages to 1.12.0
Bump from 1.4.0 to 1.12.0

This adds support for:

- hi
- hy
- kn
- ko
- sa
- ta
- te
- zh
2023-08-18 15:51:45 +02:00
Martin Donath
c8bd1aff53 Merge pull request #3340 from mkdocs/feature/page-subclassing
Improve debug output for subclasses of navigation elements
2023-08-18 15:37:33 +02:00
squidfunk
b83dc350ce Improve debug output for subclasses of navigation elements 2023-08-17 11:55:59 +02:00
Oleh Prypin
79f17b4b71 Release 1.5.2 (#3330) 1.5.2 2023-08-02 16:51:14 +02:00
Oleh Prypin
91e37aea5e Change extra_javascript items to usually be strings again (#3324)
In 1.5.0 `extra_javascript` was changed to become a `list[ExtraScriptValue]`, but strings could sneak in anyway, although MkDocs would never put them there anymore.

Let's change it to officially be `list[ExtraScriptValue | str]` but typically these items will be strings once again, unless specified as a dictionary in the config in the first place. This will guard plugins that aren't updated yet from a breakages unless users actually use `mjs` files.
2023-08-02 12:11:53 +02:00
Ultrabug
4944c9fe35 Drop obsolete readthedocs config, we switched to gh-pages (#3326) 2023-08-02 12:06:30 +02:00
Oleh Prypin
63052bc1be Correct detection of dropping anchorlink from page title (#3325) 2023-08-02 11:45:35 +02:00
Oleh Prypin
fcb2da399f Restore functionality of --no-livereload (#3320)
and nearby refactor
2023-08-01 18:57:57 +02:00