Commit Graph

2081 Commits

Author SHA1 Message Date
Tom Christie
4bf62f8b98 Apply suggestions from code review 2024-04-26 09:27:11 +01:00
Tom Christie
d295dd4a9c Merge branch 'master' into simplify-navbar 2024-04-25 17:47:27 +01:00
Tom Christie
24ae829d59 Merge pull request #3682 from mkdocs/resolve-ci
Resolve CI
2024-04-25 17:40:03 +01:00
Tom Christie
1d729f0971 Clean 2024-04-25 17:37:28 +01:00
Tom Christie
292bc68b94 Update docs for 'next_prev' block. 2024-04-25 17:31:47 +01:00
Tom Christie
c508301a13 Resolve CI 2024-04-25 17:23:33 +01:00
Tom Christie
acdcdb6d18 Include 'next_prev' block 2024-04-25 17:16:33 +01:00
Tom Christie
01394aa255 Simplify navbar 2024-04-25 09:41:46 +01:00
Tom Christie
fcb4f6419c Merge pull request #3629 from mkdocs/drop-changefreq
Drop `changefreq` from `sitemap.xml`.
2024-04-22 17:09:57 +01:00
Oleh Prypin
0998fec7eb Release 1.6.0 (#3631) 1.6.0 2024-04-20 19:49:39 +02:00
Oleh Prypin
bce85bf2a6 Fix for showing repository icon even when a file has no edit_uri (#3657)
This needed to be updated when upgrading the mkdocs theme to newer Bootstrap but got missed.

Right now it shows up as a missing glyph.
2024-04-20 19:48:23 +02:00
Oleh Prypin
0ac05daaa1 Re-generate localization files (#3634) 2024-04-20 17:55:45 +02:00
Martin Donath
6244500bbc Remove jQuery from mkdocs theme (#3649) 2024-04-20 07:41:18 +07:00
Oleh Prypin
f85d429af6 Prevent a flash of white color when dark mode is enabled (#3647)
This is done by moving the code that's responsible for color mode into a separate file that's loaded early.

Bonus: this file is included only for non-default dark mode settings.
2024-04-18 21:02:35 +02:00
Oleh Prypin
e39cce220a Fix style of modal close button (#3651)
It became unstyled since the upgrade of Bootstrap
2024-04-18 00:38:01 +02:00
Devon Stewart
652813da4b Prevent a crash if stdin is not defined (#3609) 2024-04-17 21:15:27 +02:00
Oleh Prypin
59a295f5f9 Merge pull request #3493 from waylan/2248
Update mkdocs theme to bootstrap 5.3 and add support for dark mode.
2024-04-12 21:38:53 +02:00
Oleh Prypin
6f5e7484eb Merge pull request #3625 from mkdocs/themepo
Re-generate localization files, update a new word
2024-04-10 22:00:30 +02:00
Tom Christie
ddb588ac7e Drop changefreq from sitemap.xml.
Closes #3516.

(Should this pull request also update the [release notes](https://github.com/mkdocs/mkdocs/blob/master/docs/about/release-notes.md) or are we waiting until we push a release before we collate those?)
2024-04-10 18:15:11 +01:00
Oleh Prypin
1451fb3f2c Babel setuptools frontend is still used in the install hook 2024-04-09 16:38:35 +02:00
Oleh Prypin
f9aaa04a21 Translate the word "theme" added to the readthedocs theme 2024-04-09 16:20:59 +02:00
Oleh Prypin
70384792e6 Re-generate localization files 2024-04-09 16:14:53 +02:00
Oleh Prypin
fc153b27fc Babel no longer needs an install workaround 2024-04-09 16:03:10 +02:00
Oleh Prypin
f8e5ff1e76 Revert "Create FUNDING.yml (#3295)"
This reverts commit bfb52a30ac.
2024-04-09 16:03:09 +02:00
s-rakowski
20bad19110 Add Polish translation for built-in themes (#3613)
Also add translatable word in the ReadTheDocs theme
2024-04-09 16:02:48 +02:00
Oleh Prypin
a793da267b Add the hook file's directory to sys.path (#3568)
Also clean sys.path after the hook is done, for some semblance of isolation
2024-03-16 16:05:17 +01:00
Waylan Limberg
a836155549 Add support for a 'dark mode' to mkdocs theme
Also add an optional toggle button for it.

Three new config options have been added:

1. 'color_mode' which can be set to one of 'light', 'dark', or 'auto'.
   Default is 'light' for backward compatability. The 'auto' color mode
   will check the system settings and automaticaly switch to light or
   dark mode on page load or when the system's color mode changes.
2. 'hljs_style_dark': the Highlight.js theme to use in 'dark_mode'.
   Default is 'github-dark' which matches the light mode default of
   'github'. The preexisting config option 'hljs_style' is used for
   'light' mode.
3. 'user_color_mode_toggle':
   Allow users to select their prefered color mode (light, dark, auto) from
   within the browser and save their preference for future page loads. The
   new config option 'user_color_mode_toggle' (default: 'False') can be
   enabled to display a toggle menu in the nav bar. The default value of the
   toggle menu on first load is the value set to 'color_mode'.

MkDocs' own documentation is now configured with 'color_mode: auto'.

Co-authored-by: Oleh Prypin <oleh@pryp.in>
2024-03-16 15:16:48 +01:00
Waylan Limberg
694a6028f6 Update FontAwesome to version 6
The font files have been moved from 'mkdocs/themes/mkdocs/fonts/' to
'mkdocs/themes/mkdocs/webfonts'. The 'brands', 'regular', and 'solid'
collections (all free collections) have been included as has the
'v4-font-face' shim for backward compatability.
2024-03-16 15:16:36 +01:00
Waylan Limberg
351b87939d Update mkdocs theme to Bootstrap/Bootswatch 5.3.2
Javascript has been updated to Bootstrap version 5.3.2 and CSS has been
updated to the the Bootswatch Cerulean theme version 5.3.2. Adding support
for a dark mode to the mkdocs theme is now possible.

All local colors (in base.css, extra.css, etc.) are now defined using
Bootstrap variables so that any future color modes (such as dark mode)
will be consistent.

Admonition styles have also been fully fleshed out with all colors being
Bootstrap colors (via variables) rather than our own custom colors.

Note that while Bootstrap version 5 dropped a dependency on jQuery, the
mkdocs theme is still making use of jQuery at this time. However, future
changes could remove the need for this dependency.

Co-authored-by: Oleh Prypin <oleh@pryp.in>
2024-03-16 15:16:34 +01:00
Oleh Prypin
53ff03aad2 Consistently use ```text in Markdown 2024-03-16 14:49:04 +01:00
Oleh Prypin
94544bdc6b Drop CSSLint as it's an abandoned project 2024-03-16 14:43:27 +01:00
Oleh Prypin
4ad084eb6e Merge pull request #3578 from mkdocs/toc2
Full-featured text extraction from the first H1 heading
2024-03-08 21:11:26 +01:00
Oleh Prypin
d62eae64fe When getting the title, extract alt content of img tags 2024-02-24 13:31:40 +01:00
Oleh Prypin
672eba5b9f Follow Python-Markdown approach for getting the title from the first H1
This partly reverts changes in commit e755aaed7e as some of that functionality will be deprecated.
Several more edge cases are taken into account now.

Co-authored-by: Waylan Limberg <waylan.limberg@icloud.com>
2024-02-24 12:33:48 +01:00
Oleh Prypin
e755aaed7e Strip all HTML when getting the title from the first H1 tag (#3564)
Not stripping it was a bug, and also inconsistent with how ToC titles are extracted.
2024-02-08 19:17:16 +01:00
Oleh Prypin
d6fcc56a3e Set up automatic fixes for PRs using pre-commit-ci-lite (#3561)
If a pull request has applicable Ruff fixes or needs re-formatting with Black/isort, these will be automatically pushed to the pull request via https://pre-commit.ci/lite.html

Versions of these formatter tools are already pinned since commit c9cf11b941, so unexpected unrelated changes from just updating these tools will not happen.

Note that the actual pre-commit tool is not used, and there are no plans for that.
2024-01-29 22:31:12 +01:00
Oleh Prypin
953839f1e3 Switch to an explicit markdownlint config
Based on https://github.com/DavidAnson/markdownlint/blob/v0.33.0/schema/.markdownlint.yaml
2024-01-29 22:14:24 +01:00
Oleh Prypin
369dcc0aa1 Apply new markdownlint rule table-pipe-style 2024-01-29 21:56:36 +01:00
Oleh Prypin
2426e7c897 CI: Bump action versions 2024-01-27 12:09:05 +01:00
Oleh Prypin
c9cf11b941 Pin versions of black, isort, ruff 2024-01-26 21:13:01 +01:00
Oleh Prypin
5dc51b7b21 Merge pull request #3451 from mkdocs/genfile
Rework Files to support generated files
2024-01-26 21:01:51 +01:00
Andre_601
7186f4ce9c Remove mention of site_url being required option (#3525) 2023-12-23 13:59:57 +01:00
Oleh Prypin
b3f278ae73 Split out the anchor-collecting processor at an earlier priority (#3520)
If it matches the priority of the 'toc' processor, it's more likely to be correct
2023-12-17 17:01:14 +01:00
Oleh Prypin
15bd2d5ea0 Exclude tests from the wheel distribution (#3522) 2023-12-17 17:00:48 +01:00
Oleh Prypin
ee2a7ab45c Ensure nav is sorted regardless of the order inside Files
This means plugins don't have to carefully find the sort order to put files in.
2023-12-16 00:57:27 +01:00
Oleh Prypin
bf3e76c4c8 Rework Files internal collection as dict instead of list 2023-12-16 00:56:16 +01:00
Oleh Prypin
666d764a3f Add File.generated factory method for files
-it populates `generated_by` automatically as well, based on the currently running plugin event.
2023-12-16 00:56:02 +01:00
Oleh Prypin
680e3f66d4 Allow File content to be based on an in-memory string
Add a new field `content_bytes`/`content_string` to read the content regardless of whether it's backed by the new style or still by `abs_src_path` (which is now not always present)
2023-12-16 00:53:45 +01:00
Oleh Prypin
f22f474ecc Support overriding edit_uri on a File 2023-12-15 23:54:01 +01:00
Oleh Prypin
80ffca5082 Refactor set_edit_url 2023-12-15 23:47:55 +01:00