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

Support starting numbered lists with arbitrary number #211

Closed
winniehell opened this issue Jan 20, 2015 · 10 comments

Comments

@winniehell
Copy link
Contributor

commented Jan 20, 2015

Allow numbered lists to have a defined offset like in CommonMark.

Current output:

$ kramdown --output kramdown <<< '5.  five
6.  six'

1.  five
2.  six

Expected:

$ kramdown --output kramdown <<< '5.  five
6.  six'

5.  five
6.  six

Especially useful in quotes:

$ kramdown --output kramdown <<< '> 42.  Question

What is it?'

should really be

> 42.  Question

What is it?

@gettalong gettalong self-assigned this Jan 21, 2015

@gettalong gettalong added this to the 2.0.0 milestone Jan 21, 2015

@gettalong

This comment has been minimized.

Copy link
Owner

commented Jan 21, 2015

Thanks for the issue. However, since this will change the output and probably break some documents, this can't be done in the 1.x release and has to wait for the 2.x release.

@winniehell

This comment has been minimized.

Copy link
Contributor Author

commented Jan 21, 2015

@gettalong 2.x would be great 👍

@Phrogz

This comment has been minimized.

Copy link

commented Aug 3, 2015

👍 +1 particularly for inline quoted responses. When someone writes:

Some questions:

1. How big are your shoes?
2. Can a bullet ricochet off an armadillo?

And I respond with a quoting system that prefixes the input with >, and inject my responses:

> 1. how big are your shoes

Normal sized

> 2. Can a bullet ricochet off an armadillo?

[Apparently, yes.](http://www.bbc.com/news/world-us-canada-33748027)

The result is undesirable:


  1. how big are your shoes

Normal sized

  1. Can a bullet ricochet off an armadillo?

Apparently, yes.


My workaround hack is to wrap the quoted list items in backticks to preserve the typed value. :( Sadly, other users do not know (or want to know) such hacks.

@e9t

This comment has been minimized.

Copy link

commented Aug 17, 2015

👍

@chimericdream

This comment has been minimized.

Copy link

commented Oct 26, 2016

Another option that I just found is to use an IAL declaration before the list. I was looking for this exact feature and was sad (at first) to learn that it isn't supported. However, the following works as desired:

{:start="3"}
1. test
1. test
1. test

Output:

3. test
4. test
5. test

Tested with this online Kramdown editor: https://kramdown.herokuapp.com/

This doesn't solve the problem for the average user who doesn't know much markdown, but it's a workaround for people using Kramdown in cases like Jekyll sites and whatnot.

@winniehell

This comment has been minimized.

Copy link
Contributor Author

commented Oct 27, 2016

@chimericdream That is awesome, thank you very much! 👍

However for quoting multiple list entries, this is a lot of overhead:

> {:start="42"}     
> 42. Question

Nobody knows!

> {:start="2016"}
> 2016. Current Year        

YOLO
@chimericdream

This comment has been minimized.

Copy link

commented Oct 27, 2016

However for quoting multiple list entries, this is a lot of overhead:

@winniehell I completely agree. I think it'd be awesome to have this baked into Kramdown core so that the list starts at the number of the first bullet. But for bloggers and power users, it's good to know that there is a fairly straightforward workaround until Kramdown 2.0 is final.

@gettalong

This comment has been minimized.

Copy link
Owner

commented Nov 5, 2016

Closed because feature request issues are now tracked through a dedicated project - see https://github.com/gettalong/kramdown/projects/1

@gettalong gettalong closed this Nov 5, 2016

@gettalong

This comment has been minimized.

Copy link
Owner

commented Dec 12, 2018

@cup There is nothing to fix here. It currently works as designed and this issue talks about changing the design which would be a breaking change.

@cup

This comment has been minimized.

Copy link

commented Dec 12, 2018

For anyone using GitHub Pages, you can simply add this to _config.yml:

markdown: CommonMarkGhPages

you dont even have to declare the plugin in _config.yml as its activated by
default:

http://github.com/github/pages-gem/blob/fb5c3f2/lib/github-pages/plugins.rb#L9

reference:

http://github.com/github/jekyll-commonmark-ghpages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.