How to start ordered list from number other then 1 in Jekyll?
Asked Answered
S

3

8

I have Markdown file that look like this:

1. First

Some text and other stuff

2. Second

Othe stuff

But after render it's generated as:

1. First

Some text and other stuff

1. Second

Othe stuff

Is there a solution to make second ordered list start from 2?

Sessler answered 4/2, 2018 at 19:53 Comment(0)
S
12

jekyll is using Kramdown as Markdown parser that support setting custom attributes (see docs). And html5 support start attribute that change start number of ordered list see MDN.

The markdown file need to look like this:

1. First

Some text and other stuff

{:start="2"}
2. Second

Othe stuff
Sessler answered 4/2, 2018 at 19:53 Comment(0)
E
4

Another way in this case is to simply indent the Some text and other stuff paragraph with 4 spaces. Then 2. Second will know to continue the numbering.

Episcopalism answered 11/9, 2018 at 15:21 Comment(1)
Indentation not always work, for instance if you want to put a code block below the item.Sessler
B
-1

You can use the following syntax:

1\.

2\.

3\.
Basilio answered 21/9, 2022 at 17:28 Comment(1)
This will create text, not a list. The question is about the ordered list.Sessler

© 2022 - 2024 — McMap. All rights reserved.