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

tags_extra_files throws an exception #4114

Closed
5 tasks done
SaltyAimbOtter opened this issue Jul 11, 2022 · 7 comments
Closed
5 tasks done

tags_extra_files throws an exception #4114

SaltyAimbOtter opened this issue Jul 11, 2022 · 7 comments
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open

Comments

@SaltyAimbOtter
Copy link
Contributor

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

The new tags_extra_files feature seems to not work at all. An exception is thrown whenever this feature is used. The "old" tags_file still works, though.

Expected behaviour

Tag indexes are rendered on two pages.

Actual behaviour

This stacktrace is thrown.

Steps to reproduce

  1. git clone https://github.com/SaltyAimbOtter/material-mkdocs-tags-bug.git
  2. mkdocs serve

Package versions

  • Python: 3.10.0
  • MkDocs: 1.3.0
  • Material: 8.3.9+insiders.4.20.1

Configuration

site_name: My Docs
theme:
  name: material

plugins:
  - tags:
      tags_extra_files:
        index.md:
          - docs2
        anotherTagsIndex.md:
          - docs1

extra:
  tags:
    docs1: docs1
    docs2: docs2


markdown_extensions:
  - meta

System information

  • Operating system: Windows 10
  • Browser: Firefox 102
@squidfunk
Copy link
Owner

squidfunk commented Jul 12, 2022

Thanks for reporting. The tags_extra_files setting relies on tags_file being present, meaning, it will not work without a tags_file. The reason is the resolution of links. I'll check whether we can make it work without a tags_file, or emit a warning when tags_file is not defined.

In the meantime, try this:

plugins:
  - tags:
      tags_file: index.md
      tags_extra_files:
        index.md:
          - docs2
        anotherTagsIndex.md:
          - docs1

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Jul 12, 2022
@squidfunk
Copy link
Owner

Fixed in squidfunk/mkdocs-material-insiders@c8551a261.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Jul 12, 2022
@SaltyAimbOtter
Copy link
Contributor Author

Hey Martin,

sorry for the delay. I briefly tested your fix with my demo repo and it worked. However, it did not in my actual project.
Now I finally got around to dig deeper.

It seems like navigatation sections don't work with several tags indexes. All tags are shown on each index subset, no matter what is configured.
I adjusted my example repository so you can easily test.

@squidfunk
Copy link
Owner

Thanks, I'll look into it again as soon as I find some time.

@squidfunk
Copy link
Owner

I'm not able to reproduce what you described. Works perfectly for me:

screenshot-localhost-8000-Tutorials-tagsIndex-1658057289439

screenshot-localhost-8000-Documentation-anotherTagsIndex-1658057299197

@squidfunk
Copy link
Owner

Released as part of 8.3.9+insiders-4.21.0.

@SaltyAimbOtter
Copy link
Contributor Author

Interesting, multiple members from our team can reproduce it.
We will have another look when the vacation period is over.

Thank you for your help so far!
Enjoy your vacation! 🌞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants