Force GitHub pages to render numerical lists sequentially instead of restarting?

121 Views Asked by At

I noticed that when GitHub pages with mkdocs have text or images in between numbers it ignores the numbering in the source document and instead restarts numbering. See here for an example of this.

Is there a way to force mkdocs to render the numbers in the original document instead of inventing its own?

2

There are 2 best solutions below

0
On

If you add them all as 1. space and text, then sub item as image with a tab, it should work. As an example:

1. Option 1
    imgage or next text
1. Option 2

You can check this documentation built using mkdocs as an example.

0
On

As Zoran mentioned above that was part of it. Things I figured out:

  1. Code must be double tabbed - you cannot use ```
  2. Indented lists must also be double tabbed - I wasn't able to get a single tab to work
  3. Images do not have to be tabbed - they can be in line with the above text
  4. There should not be an empty line when an image follows a numbered list item BUT FOR CODE there must.

I still haven't completely figured out. mkdoc's behavior is not as predictable as regular markdown