Git Product home page Git Product logo

Comments (10)

frnmst avatar frnmst commented on May 28, 2024

This is not implemented but it should be fairly easy to do

from md-toc.

frnmst avatar frnmst commented on May 28, 2024

I have a couple of questions:

  • what would you call this option?
  • should the user choose the (starting) number?

See https://spec.commonmark.org/0.28/#start-number

from md-toc.

Skylion007 avatar Skylion007 commented on May 28, 2024
  1. The user should be able to choose a starting number since it works on Github. 1 is by the far the most common though.
  2. constant_number_lists? auto_ordered_lists? vc_friendly_ordered_lists? constant_ordered_lists?

I am not sure what the common_mark terminology is for this feature, but it seems like the ordered lists all disregard everything after the first number and renumber themselves anyway when rendered?

from md-toc.

frnmst avatar frnmst commented on May 28, 2024

Ok, I'd go with constant_ordered_lists.

According to https://spec.commonmark.org/0.28/#start-number yes: only the first number is considered.

from md-toc.

frnmst avatar frnmst commented on May 28, 2024

There is a problem with nested lists:

1. asd
   99. o
   10. we
   117. abc
1. asd
8309. sd

renders this:

  1. asd
    99. o
    10. we
    117. abc
  2. asd
  3. sd

~

while

1. asd
   1. o
   2. we
   3. abc
1. asd
8309. sd

renders:

  1. asd
    1. o
    2. we
    3. abc
  2. asd
  3. sd

I have also tried this in the commonmark interactive page: https://spec.commonmark.org/dingus/ . In that case the start integer number of the nested list must start from 1 to avoid unexpected results.

from md-toc.

Skylion007 avatar Skylion007 commented on May 28, 2024

from md-toc.

frnmst avatar frnmst commented on May 28, 2024

Yes I know. Using 1 without the ability to change it is the only way

from md-toc.

frnmst avatar frnmst commented on May 28, 2024

You can test the new feature in the dev branch (commit 31e80c3). The option is called
--constant-ordered-list or -c if you run:

md_toc github -h
md_toc redcarpet -h

from md-toc.

frnmst avatar frnmst commented on May 28, 2024

Feature now available in version 7.1.0

from md-toc.

frnmst avatar frnmst commented on May 28, 2024

Closing. Feel free to reopen.

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.