question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

šŸš€ Material for MkDocs 9 – Beta

See original GitHub issue

With the help of our awesome sponsors, I’m happy to announce that the ā€˜Carolina Reaper’ funding goal has been reached, which means that the brand new search is finding its way into the community edition!

Since this is a pretty major change, we’re releasing the new search as part of a new major version, so we can also drop and refactor some things that are overdue. This issue will track the progress on the road from the beta to the final release of v9.

If you experience any problems, for now, please report them as a comment in this issue.

Installation

pip install mkdocs-material==9.0.0b4

Note – This is a beta release, so please test thoroughly before deploying to production. Final release date will be January 2, 2023.

Additions and improvements

  • Rewrite of search plugin with support for rich previews
  • Added support for tokenizer lookahead
  • Added support for better search highlighting
  • Added support for excluding content from search
  • Added support for configurable search pipeline
  • Added support for offline search via offline plugin
  • Added support for multiple instances of built-in tags plugin in 17186b49478e4ea17b1ede882c61439d8d4d8d1b
  • Added support for removing copy-to-clipboard button in 128e26742
  • Added support for removing footer navigation in 8fdd1ad52
  • Added support for button to view the source of a page in 28d64a289
  • Improved readability of query string for search sharing in ee149649
  • Improved stability of search plugin when using --dirtyreload
  • Improved ā€œmore on this pageā€ by making it sticky and stable when scrolling
  • Updated Norwegian translations (via #4647)
  • Updated to MkDocs 1.4.2 in 17186b49478e4ea17b1ede882c61439d8d4d8d1b

Removals

Fixes

  • Fixed Korean language code (kr ko) in 5aebaaa71
  • Fixed detection of composition events in search interface
  • Fixed search plugin not using title set via front matter
  • Fixed search highlighting of tags in 24a3be8
  • Fixed search sharing URL using post transformed string (with wildcards etc.)
  • Fixed inability to query specific fields (e.g. tags:foo or title:bar)
  • Fixed inability to exclude search terms (e.g. -foo or -title:bar)
  • Fixed inability to use fuzzy modifier (e.g. foo~1 or title:bar~2)
  • Fixed inability to boost specific terms (e.g. foo^2 or title:bar^4)
  • Fixed inability to use leading wildcards (e.g. *foo or *title:bar)
  • Fixed theme-color meta tag getting out-of-sync in https://github.com/squidfunk/mkdocs-material/commit/944180d572ac6aab03f12e8c444f92f6c3bd0f33
  • Fixed prev/next page keyboard navigation when footer is not present in 763423d30
  • Fixed overflowing navigation tabs not being scrollable in 9fb36102
  • Omit code block line numbers from search

Upgrading

Changes to mkdocs.yml

  • Enable copy-to-clipboard button: the copy-to-clipboard buttons are now opt-in. If you wish to enable them for all code blocks, add the following lines to mkdocs.yml:

    theme:
      features:
        - content.code.copy
    

    You can also choose to enable them for specific code blocks, by adding a .copy class to the code block, like so:

    ``` { .py .copy }
    ...
    ```
    

    Similarily, if you enabled the button globally, but want to disable it for a specific code block use .no-copy:

    ``` { .py .no-copy }
    ...
    ```
    
  • Enable edit and view source button: a ā€œview sourceā€ button can be shown next to the ā€œedit this pageā€ button, both of which must now be explicitly enabled. The repo_url must also be given. Add the following lines to mkdocs.yml:

    repo_url: ...
    theme:
      features:
        - content.action.edit
        - content.action.view
    
  • Enable navigation footer: the previous and next buttons in the footer are now opt-in. If you wish to keep them for your documentation, add the following lines to mkdocs.yml:

    theme:
      features:
        - navigation.footer
    
  • Use Korean language: the Korean language code was kr, which is not correct. It was corrected to ko:

    theme:
      language: ko
    
  • Use Norwegian languages: the Norwegian language code was no, was no renamed to nb.

    theme:
      language: nb # or nn
    
  • Feedback widget URLs: the old, nameless placeholders were removed (after being deprecated for several months). If Make sure to switch to the new named placeholders {title} and {url}:

    https://github.com/.../issues/new/?title=[Feedback]+{title}+-+{url}
    

There should be no other changes to mkdocs.yml necessary. If you discover that you need to change other lines to make v9 work, please comment below, so we can add it to the list.

Changes to documents

  • Alternate admonition qualifiers: to keep the size of the CSS down, we removed support for alternate admonition qualifiers. Please use the standard admonition qualifiers that are mentioned in our documentation.

Changes to customizations

If you’ve customized Material for MkDocs with theme overrides, and added your own partials, you need to adjust for some changes, as the translations keys got updated. Keys that end with .title have been stripped off the suffix, so footer.title now becomes footer. The reason is that those are mostly generic translations of components that may not only be used in title attributes. See the partial diff.

Closing thoughts

Version 9 is a pretty big release, which includes a completely rewritten search implementation. I’m super happy to finally give it into the hands of all users, so we can improve it even more. Before issuing the final release, I’ll take the opportunity to refactor some edges that need a little polishing and incorporate your feedback.

Issue Analytics

  • State:open
  • Created 9 months ago
  • Reactions:17
  • Comments:32 (17 by maintainers)

github_iconTop GitHub Comments

7reactions
squidfunkcommented, Dec 21, 2022

Thanks for everybody testing the beta so far! Since it’s impossible to predict what will break down the line, I don’t think it’s a good idea to push this out before Christmas or even NYE. People are busy getting presents, and, in Germany, meeting in the evening to drink some Glühwein, so it’s probably not a good idea to impose such a major change upon them right now. We’ll move v9 out of beta at the beginning of next year.

If you already want to try it, no problem, just install the beta (see OP) and see if you run into any problems. You can already fix them on a separate branch, and then later, when v9 is out, just remove the b release modifier and you’re done.

Final release date will be January 2, 2023.

6reactions
squidfunkcommented, Dec 8, 2022

I just released the latest fixes as part of 9.0.0b3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Material for MkDocs - GitHub Pages
Built-in search. Material for MkDocs makes your documentation instantly searchable with zero effort: say goodbye to costly third-party crawler-based solutionsĀ ...
Read more >
Martin Donath (@squidfunk) / Twitter
Independent full-stack engineer Ā· Creator of Material for MkDocs, one of the best Open Source solutions for writing documentation Ā· Working on.
Read more >
mkdocs-material - Wheelodex
material /.icons/fontawesome/solid/arrow-down-1-9.svg, sha256=iVuBGxarzAt7cTc5S9ID08TwvP3rGZKaaoMrooLuRZI, 1172.
Read more >
squidfunk/mkdocs-material - [REPO]@Telematika
It's just Markdown … — write your technical documentation in Markdown – no need to know HTML, JavaScript or CSS. Material for MkDocs...
Read more >
squidfunk/mkdocs-material - Gitter
@squidfunk RTD is working on improved integration with Material for MkDocs. ... Material for MkDocs is meant as a sane default. ... Did...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found