Git Product home page Git Product logo

Comments (4)

frnmst avatar frnmst commented on June 7, 2024

Did you try running it like this?

md_toc github -l6 file.md

If you did you should have seen this exception raised: md_toc.exceptions.TocDoesNotRenderAsCoherentList

If you run md-toc like this however

md_toc github file.md

it uses the default maximum header level of 3 (-l3) and the second line is not even parsed fully.

Like this it works as you expect it to:

md_toc --no-list-coherence github -l6 file.md

- [Known Issues](#known-issues)
  - [Compatibility](#compatibility)

from md-toc.

harlankoehn avatar harlankoehn commented on June 7, 2024

I'm using the Python API. I'm trying out the keep_header_level argument. It works as expected when I pass in 1, 2, or 3, but as soon as I pass in 4, 5, or 6, it fails with no error. I get no TOC generated at all.

toc = md_toc.build_toc(filename='build-toc.md', parser='gitlab', keep_header_levels=4)

from md-toc.

harlankoehn avatar harlankoehn commented on June 7, 2024

ok, we get what we expect when we use this:

toc = md_toc.build_toc(filename='build-toc.md', parser='gitlab', no_list_coherence=True, keep_header_levels=4)

Just FYI, the documentation page shows the no_list_coherence argument in the function signature but the description for this argument is missing.

from md-toc.

frnmst avatar frnmst commented on June 7, 2024

Thanks. Haven't notice that. It's fixed now.

from md-toc.

Related Issues (20)

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.