Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Material for MkDocs 9 – Beta #4714

Closed
34 tasks done
squidfunk opened this issue Dec 7, 2022 · 39 comments · Fixed by #4628
Closed
34 tasks done

🚀 Material for MkDocs 9 – Beta #4714

squidfunk opened this issue Dec 7, 2022 · 39 comments · Fixed by #4628
Labels
announcement Issue announces news or new features

Comments

@squidfunk
Copy link
Owner

squidfunk commented Dec 7, 2022

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

Removals

Fixes

  • Fixed Korean language code (kr ko) in 5aebaaa
  • 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 944180d
  • Fixed prev/next page keyboard navigation when footer is not present in 763423d
  • Fixed overflowing navigation tabs not being scrollable in 9fb3610
  • 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.

@squidfunk squidfunk pinned this issue Dec 7, 2022
@squidfunk
Copy link
Owner Author

squidfunk commented Dec 7, 2022

The Python release does not work due to a problem with our new build system, hatch. @ofek, could you please take a look? Otherwise I need to revert to setup.py, again... For the time being, the release needs to be installed via git.

Edit: nope, even installing from git didn't work for me. I'm throwing out hatch again until this is resolved...

@squidfunk squidfunk linked a pull request Dec 7, 2022 that will close this issue
25 tasks
@squidfunk squidfunk added the announcement Issue announces news or new features label Dec 7, 2022
@ofek
Copy link
Sponsor Collaborator

ofek commented Dec 7, 2022

What commit made CI suddenly fail?

@squidfunk
Copy link
Owner Author

As you can see here, the version determination logic failed again. Probably due to the beta version modifier.

@ofek
Copy link
Sponsor Collaborator

ofek commented Dec 7, 2022

@agoose77

@agoose77
Copy link

agoose77 commented Dec 8, 2022

@squidfunk the schema (well, REGEX) that hatch-nodejs-version follows for package.json is major.minor.patch-pre.?ident.... This is taken from the semver specification

Are you able to change your package.json version to be 9.0.0-b0?

@squidfunk
Copy link
Owner Author

squidfunk commented Dec 8, 2022

No, there's no dash, it's just 9.0.0b1, since it wouldn't be compatible with PEP 440. Or does hatch-nodejs-version convert it to a PEP-compatible format? It would however mean that we would have a dash at some points of our application, and no dash in others.

@agoose77
Copy link

agoose77 commented Dec 8, 2022

@squidfunk but this is used for package.json, right? hatch-nodejs-version converts between semver and PEP440 representations. Also, note that 9.0.0b1 isn't valid for package.json, whereas 9.0.0-b1 is valid for PEP440.

@squidfunk
Copy link
Owner Author

squidfunk commented Dec 8, 2022

Yes, it is used in package.json. Hmm. I've used the same approach I did as for all other beta releases before, but I guess we could maybe use the versioning package.json expects. Unfortunately, I'm not an expert in hatch. @ofek has introduced it to this repository and I just wanted to make a beta release. I'll consult you guys next time I try to diverge from normal semantic versioning identifiers 😬

@squidfunk
Copy link
Owner Author

squidfunk commented Dec 8, 2022

Also, note that 9.0.0b1 isn't valid for package.json, whereas 9.0.0-b1 is valid for PEP440.

From the PEP 440 spec, it wasn't apparent to me that it is valid. Nevermind, here it is. With that lesson learned, I'll swap out setuptools for hatch next time I work on this repository again. Thanks for your time, guys!

@agoose77
Copy link

agoose77 commented Dec 8, 2022

Ha, all this stuff is a little bit fiddly. I'm not an expert, but I try to follow the standards where given, so that's informing my position. To add some context; I develop hatch-nodejs-version, which fits into the plugin ecosystem that @ofek's hatch has build.

It might be possible to add an option to preserve the dash if we needed, but I'd prefer not to as it adds more complexity, where currently the code is quite simple (and therefore understandable).

From the PEP 440 spec, it wasn't apparent to me that it is valid.

I note that you found the pre-release-separator section, but I agree. The PEP is surprisingly cryptic here. I noticed that section only after checking the regex.

@marc2k3
Copy link

marc2k3 commented Dec 8, 2022

I'm having a issue with the latest git build as instructed to use in another issue...

pip install https://github.com/squidfunk/mkdocs-material/archive/feature/material-v9.zip

Trying to use a custom toc permalink character breaks...

image

site_name: test
strict: true
theme:
  name: material
markdown_extensions:
  - toc:
      permalink: "#"
## one

## two

Python 3.11.1
Windows 10 22H2
Firefox 107.0.1

@ofek
Copy link
Sponsor Collaborator

ofek commented Dec 8, 2022

maybe use the versioning package.json expects

Yes that is the fix

@bigpick
Copy link

bigpick commented Dec 8, 2022

Trying to use a custom toc permalink character breaks...

I see this as well, even just reverting to

  - toc:
      permalink: true

Still ends up rendering a {'permalink': True}:

@squidfunk
Copy link
Owner Author

squidfunk commented Dec 8, 2022

Still ends up rendering a {'permalink': True}

Fixed in 3e9b72c! This was a search + replace error.

@squidfunk
Copy link
Owner Author

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

@shanthisagar-dhanya-kumar-db-zz

After upgrading to 9.0.0b3 am getting "tags" plugin not installed. Anyone noticed?

@squidfunk
Copy link
Owner Author

@shanthisagar-dhanya-kumar-db I'm not seeing this problem, the built-in tags plugin works fine. Could you please try and create a minimal reproduction? You could then attach it here as a zip and I'll have a look.

@squidfunk
Copy link
Owner Author

squidfunk commented Dec 11, 2022

The latest commits fix highlighting of tags and improve the URL when using search sharing. Furthermore, now, the full range of Lunr.js query syntax is supported! I've reordered how the search query is preprocessed and ensured that only search terms (not modifiers) are sent through the transformation and tokenization pipeline. This lays the foundation for more interesting features to come.

pip install mkdocs-material==9.0.0b4

When releasing the stable version, I'll expand in a blog article on the new capabilities and how it works.

@guusw
Copy link

guusw commented Dec 13, 2022

The global n/p nagivation keys seemed to have stopped working in this version, compared to the git master version.
However f// to search still seems to work

@squidfunk
Copy link
Owner Author

Did you re-enable the footer navigation (see OP)? The n/p keys otherwise have no idea what the previous or next page is.

@kcgthb
Copy link
Contributor

kcgthb commented Dec 14, 2022

As mentioned in #4755, the new version fails to build the site if the feedback URL uses nameless placeholders:

ERROR    -  Error building page 'docs/index.md': Replacement index 0 out of range for positional args tuple
Traceback (most recent call last):
[...]
    {% include "partials/feedback.html" %}
  File "/home/kilian/.local/lib/python3.10/site-packages/material/partials/feedback.html", line 35, in top-level template code
    {{ rating.note.format(url = url, title = title) }}
IndexError: Replacement index 0 out of range for positional args tuple

Using the new format is now mandatory.

@squidfunk
Copy link
Owner Author

Thanks @kcgthb, I updated the OP.

@squidfunk
Copy link
Owner Author

@guusw the next/previous page navigation should now work regardless of whether the footer is present or not. I've moved it into the head in 763423d, which makes more sense anyway.

@Valastiri
Copy link

Valastiri commented Dec 15, 2022

Hello! I wanted to inquire if this could be a possible bug/issue with the new search plugin. In our production build mkdocs-material==8.5.10 pages primarily containing markdown tables would render only a small snippet in the search preview.

In testing, 9.0.0b4 the search preview returns a rather large wall of text (often taking priority over other pages). One of our devs performing some tests noticed the issue linked in the comment below where it can best be seen:

For reference I've tested it by searching locally and on our vercel preview.

A small working around is to enable search.boost on certain pages. Which is what I've done currently with the search query in the comment above to bring the discontinuity page higher in the results.

I've personally tested this with a stripped-down version of our production config (no plugins, features beyond search).

mkdocs-material==9.0.0b4
mkdocs==1.4.2
python==3.10.8

Any insight if this is as intended and if utilizing search.boost is the way to go? Please let me know if I can provide anymore resources.

Project Staging Link for the above PR.

@squidfunk
Copy link
Owner Author

squidfunk commented Dec 15, 2022

@Valastiri thanks for reporting. This is not a bug. Search previews might now be larger, as they are cut at paragraphs and lists, and are not truncated anymore. If truncation is wished, one can do so by using CSS (see below), but some users might not like that. More compact search summaries are an improvement that is on the roadmap and tracked in #4278.

If you want the previous behavior, you can add the following additional CSS which will clamp search after 3 lines:

.md-search-result .md-typeset {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

Compact search previews are very hard to support for all languages that we support in Material for MkDocs (50+ languages). However, with the new tokenization approach, they finally became possible. See the paragraph on accurate highlighting why this is hard. I will soon start working on this new feature.

@Valastiri
Copy link

@Valastiri thanks for reporting. This is not a bug. Search previews might now be larger, as they are cut at paragraphs and lists, and are not truncated anymore. If truncation is wished, one can do so by using CSS, but some users might not like that. More compact search summaries are an improvement that is on the roadmap and tracked in #4278.

Thanks! Good to know. Appreciate the response and all the work on Material thus far :). Love the platform/theme.

@lyz-code
Copy link

Hi @squidfunk, I'm the developer of mkdocs-newsletter and as some users above the next and previous buttons disappeared from my site breaking the tests. I'm using 763423d to build this site.

I've read the comments in this issue and the related ones but found no clear steps to re-enable them, can you help me?

Thanks for maintaining this project so well, it's awesome, both docs, quality, release process...

@squidfunk
Copy link
Owner Author

squidfunk commented Dec 16, 2022

Please read the original post, the one at the top. It clearly explains what to do. Excerpt:

  • 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

Some users wished to disable the footer for a long time, which is why it is now opt-in.

Thanks for maintaining this project so well, it's awesome, both docs, quality, release process...

Thanks! Trying my best to stay atop of things. This wouldn't be possible without our awesome sponsors ❤️

@lyz-code
Copy link

Oh sorry, I didn't understood what OP meant. That fixed the issue

@squidfunk
Copy link
Owner Author

squidfunk commented Dec 18, 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.

@jrappen
Copy link

jrappen commented Dec 19, 2022

@facelessuser GitHub action workflow output gave me this with mkdocs-material==9.0.0b4:

2022-12-19T21:39:33.6720468Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.6722291Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.6723168Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.6725013Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.6725578Z     warnings.warn(
2022-12-19T21:39:33.6725785Z 
2022-12-19T21:39:33.7063129Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.7064833Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.7065893Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.7074498Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.7075742Z     warnings.warn(
2022-12-19T21:39:33.7076394Z 
2022-12-19T21:39:33.7167402Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.7170035Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.7176540Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.7177970Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.7268187Z     warnings.warn(
2022-12-19T21:39:33.7268910Z 
2022-12-19T21:39:33.7323760Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.7333417Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.7334445Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.7335588Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.7336248Z     warnings.warn(
2022-12-19T21:39:33.7336455Z 
2022-12-19T21:39:33.7428904Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.7430916Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.7431807Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.7433072Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.7433776Z     warnings.warn(
2022-12-19T21:39:33.7434666Z 
2022-12-19T21:39:33.7547516Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.7549071Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.7549958Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.7551405Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.7573608Z     warnings.warn(
2022-12-19T21:39:33.7593211Z 
2022-12-19T21:39:33.7669290Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.7670691Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.7671794Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.7675337Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.7676080Z     warnings.warn(
2022-12-19T21:39:33.7676478Z 
2022-12-19T21:39:33.7821353Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.7822823Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.7835002Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.7836795Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.7837542Z     warnings.warn(
2022-12-19T21:39:33.7838728Z 
2022-12-19T21:39:33.8014139Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.8015562Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.8016563Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.8018027Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.8018743Z     warnings.warn(
2022-12-19T21:39:33.8019163Z 
2022-12-19T21:39:33.8125417Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.8126879Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.8128029Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.8129370Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.8130113Z     warnings.warn(
2022-12-19T21:39:33.8130572Z 
2022-12-19T21:39:33.8458085Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.8666386Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.8738359Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.8739652Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.8740322Z     warnings.warn(
2022-12-19T21:39:33.8740757Z 
2022-12-19T21:39:33.8904739Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.8906049Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.8906854Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.8908616Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.8909093Z     warnings.warn(
2022-12-19T21:39:33.8909261Z 
2022-12-19T21:39:33.9359932Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.9361299Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.9362082Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.9363241Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.9363906Z     warnings.warn(
2022-12-19T21:39:33.9364405Z 
2022-12-19T21:39:33.9673569Z INFO     -  DeprecationWarning: 'uslugify' is deprecated. 'uslugify' is deprecated in favor of the configurable 'slugify' function. See documentation for more info.
2022-12-19T21:39:33.9675647Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/markdown/extensions/toc.py", line 285, in run
2022-12-19T21:39:33.9676895Z     el.attrib["id"] = unique(self.slugify(innertext, self.sep), used_ids)
2022-12-19T21:39:33.9681029Z   File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pymdownx/util.py", line 315, in _deprecated_func
2022-12-19T21:39:33.9681959Z     warnings.warn(
2022-12-19T21:39:33.9682465Z 

@facelessuser
Copy link
Contributor

@jrappen uslugify is deprecated as it says. Now you can just use slugify with the options to control the slug options. See here for configuring it in MkDocs YAML configs: https://facelessuser.github.io/pymdown-extensions/faq/#function-references-in-yaml.

@EDIflyer
Copy link
Contributor

I'm not sure if related to this beta or not (I'm running 9.0.0b4) but I've found when following the instructions at https://squidfunk.github.io/mkdocs-material/reference/data-tables/#sortable-tables and added the tablesort.js code to docs/javacripts/tablesort.js and the two lines to mkdocs.yml too. I can't see any errors in the logs, however it just doesn't seem to do anything (table still displays OK, just no sort icon as shown on the demo page)

@squidfunk
Copy link
Owner Author

squidfunk commented Dec 28, 2022

I just tested Tablesort locally on the feature/material-v9 branch, and everything works as expected, i.e. the icons show up and I can sort tables. It's hard to know what went wrong in your specific use case without a reproducible example. I can look into it, if you provide such a minimal reproducible example and attach it here as a zip.

@EDIflyer
Copy link
Contributor

EDIflyer commented Dec 28, 2022

Thanks @squidfunk - I'm pleased to say it turns out that "me being an idiot" was actually the issue 😂 - I had lots of folders open and only just realised when going back in today that javascripts was mistakenly set as a top-level directory rather than as a sub-directory 🤦‍♂️. Sorry for wasting your time, it now works perfectly 🥳

@squidfunk
Copy link
Owner Author

Thank you all for testing the beta! 9.0.0 will be released today.

@squidfunk squidfunk unpinned this issue Jan 2, 2023
@johnthagen
Copy link
Contributor

@squidfunk isn't the hero we deserve, but the one we need. ❤️

@HighLandner
Copy link

@squidfunk, updated from 8.5.11 to 9.0.0 and this error appears.
There are several .md pages in dir guide and it fails with such error. Only deletion of page that is out of index solves the issue. Also this appears with all 9+ versions

ERROR - Error building page 'guide/start.md': list index out of range
Traceback (most recent call last):
File "/usr/local/bin/mkdocs", line 8, in
sys.exit(cli())
^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mkdocs/main.py", line 234, in serve_command
serve.serve(dev_addr=dev_addr, livereload=livereload, watch=watch, **kwargs)
File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 83, in serve
builder(config)
File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 76, in builder
build(config, live_server=live_server, dirty=dirty)
File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/build.py", line 329, in build
_build_page(file.page, config, doc_files, nav, env, dirty)
File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/build.py", line 226, in _build_page
context = config.plugins.run_event(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mkdocs/plugins.py", line 520, in run_event
result = method(item, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/material/plugins/search/plugin.py", line 90, in on_page_context
self.search_index.add_entry_from_context(page)
File "/usr/local/lib/python3.11/site-packages/material/plugins/search/plugin.py", line 143, in add_entry_from_context
parser.feed(page.content)
File "/usr/local/lib/python3.11/html/parser.py", line 110, in feed
self.goahead(0)
File "/usr/local/lib/python3.11/html/parser.py", line 172, in goahead
k = self.parse_endtag(i)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/html/parser.py", line 413, in parse_endtag
self.handle_endtag(elem)
File "/usr/local/lib/python3.11/site-packages/material/plugins/search/plugin.py", line 417, in handle_endtag
elif data[-1].isspace() and data[-2] == f"<{tag}>":
~~~~^^^^
IndexError: list index out of range

@squidfunk
Copy link
Owner Author

@highlander Possibly related: #4824. If this is not the cause, please create a separate bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
announcement Issue announces news or new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.