Giter Site home page Giter Site logo

try0 / mkdocs-toc-md Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 773 KB

mkdocs-toc-md is an mkdocs plugin that generates a toc (table of contents) as markdown. Writes toc to index.md. 目次を生成します。

Home Page: https://try0.github.io/mkdocs-toc-md/sample/site/mkdocs-toc-md.html

License: MIT License

Python 98.20% Jinja 1.80%
mkdocs mkdocs-plugin documentation generator python markdown toc toc-generator

mkdocs-toc-md's People

Contributors

try0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mkdocs-toc-md's Issues

TypeError: can only concatenate str (not "NoneType") to str

Traceback (most recent call last):
  File "/opt/homebrew/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/mkdocs/__main__.py", line 286, in build_command
    build.build(cfg, dirty=not clean)
  File "/opt/homebrew/lib/python3.11/site-packages/mkdocs/commands/build.py", line 354, in build
    config.plugins.on_post_build(config=config)
  File "/opt/homebrew/lib/python3.11/site-packages/mkdocs/plugins.py", line 542, in on_post_build
    return self.run_event('post_build', config=config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/mkdocs/plugins.py", line 509, in run_event
    result = method(**kwargs)
             ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/mkdocs_toc_md/plugin.py", line 137, in on_post_build
    self.output(config, self.nav, "", "")
  File "/opt/homebrew/lib/python3.11/site-packages/mkdocs_toc_md/plugin.py", line 252, in output
    self.create_toc_items(toc_headers, nav_item, config, lang, nav_item_depth)
  File "/opt/homebrew/lib/python3.11/site-packages/mkdocs_toc_md/plugin.py", line 152, in create_toc_items
    self.create_toc_items(toc_items, child_item, config, lang, nav_item_depth)
  File "/opt/homebrew/lib/python3.11/site-packages/mkdocs_toc_md/plugin.py", line 152, in create_toc_items
    self.create_toc_items(toc_items, child_item, config, lang, nav_item_depth)
  File "/opt/homebrew/lib/python3.11/site-packages/mkdocs_toc_md/plugin.py", line 213, in create_toc_items
    toc_header.url = page.file.src_path + '#' + elm.get('id')
                     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

Prepare for use with mkdocs-static-i18n

First of all, thanks for making this project.. exactly what i was looking for.

What i am about to post is not really an issue but a feature request.

While using mkdocs-static-i18n plugin, one ends with a structure like (assuming pt and en as site languages):

├── docs
│   ├── Home
│   │   ├── index.pt.md
│   │   ├── index.en.md
│   ├── index.pt.md
│   ├── index.en.md
│   ├── mkdocs.yml
  

So, 2 indexes must be created. One that includes only *.en.md files for en version and another that includes *.pt.md for portuguese version home page.

I already see that you have a feature to erxclude/include filex by pattern/regex.
It would be great that we could combine that and instruct your plugin to create 2 separata index..md to create a home page per language.

Kind Regards!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.