oprypin / mkdocs-section-index

MkDocs plugin to allow clickable sections that lead to an index page
https://oprypin.github.io/mkdocs-section-index
MIT License
74 stars 7 forks source link

Detect mkdocs-nature as supported theme #19

Closed pawamoy closed 9 months ago

pawamoy commented 10 months ago

MkDocs-Nature seems to support section-index natively. Example: https://pawamoy.github.io/markdown/sitemap.html, built from https://github.com/pawamoy/markdown/tree/api-docs. It would be nice if it was detected as a supported theme, to get rid of the warning.

Possible solution (tested, seems to work fine) in rewrites.py:

        if path.endswith("/mkdocs/templates/sitemap.xml"):
            src = _transform_mkdocs_sitemap_template(src)
        elif path.endswith("/nature/base.html"):
            self.found_supported_theme = True
            return src, filename, uptodate
        else:
            ...

Let me know if I should open a PR :slightly_smiling_face:

A way to disable the warning would be fine too.

oprypin commented 10 months ago

:hushed: how did it happen that it supports that?

oprypin commented 10 months ago

Great stuff! :+1: That's the way to go when writing a theme

We'll list it for sure

oprypin commented 9 months ago

Release in a day probably