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

Unable to redefine the ordered list counter using {:start="4"} #750

Closed
mairas opened this issue Jan 13, 2022 · 5 comments · Fixed by #856
Closed

Unable to redefine the ordered list counter using {:start="4"} #750

mairas opened this issue Jan 13, 2022 · 5 comments · Fixed by #856
Labels

Comments

@mairas
Copy link

mairas commented Jan 13, 2022

Describe the bug

I want to start an ordered list with a number other than 1. Normally, you'd add the html5 start element with {:start="4"}. However, the custom ol CSS counter definitions in Just the Docs override this, and the list always starts with 1.

To Reproduce
Steps to reproduce the behavior:

This source:

1. Do this 
2. And that
3. And even this.

If you want to share your work, follow these three additional steps:

{:start="4"}
4. Also do this.
5. And even more.
6. Does this ever end?

Expected behavior

The second list should start with number 4.

Screenshots

Screenshot 2022-01-13 at 11 54 32

Desktop (please complete the following information):

  • OS: MacOS 12.1
  • Browser: Chrome
  • Version: 97.0.4692.71 (Official Build) (arm64)
@mairas mairas added the bug label Jan 13, 2022
@bentookey-yotta
Copy link

We make extensive use of this in our product's Help site, often breaking up ordered lists with screenshots.
CNR issue with a different Jekyll theme. Therefore, it would be great if this issue could be expedited please!

@pdmosses
Copy link
Contributor

pdmosses commented Jun 1, 2022

This theme uses CSS counters to override the browser's default styling of ol elements in _sass/content.scss. This should be regarded as a feature, rather than a bug, I think...

It appears that one can resume an interrupted list as follows:

Source:

1. Do this
2. And that
3. And even this.

If you want to share your work, follow these three additional steps:

{:style="counter-reset:none"}
4. Also do this.
5. And even more.
6. Does this ever end?

Result:

image

The required block IAL looks a bit ugly, but it avoids the need to use a specific number with the start attribute: inserting a new list item doesn't require renumbering.

pdmosses added a commit to pdmosses/just-the-docs that referenced this issue Jun 3, 2022
Close just-the-docs#750

The theme uses CSS counters for ordered lists.
So to continue the numbering of an ordered list after a break,
use `style="counter-reset:none"` instead of `start="42"`.
Add the example from just-the-docs#750 to `docs/index-test.md` to test.
pdmosses added a commit to pdmosses/just-the-docs that referenced this issue Jun 3, 2022
Close just-the-docs#750

The theme uses CSS counters for ordered lists.
To start the numbering of an ordered list with 42,
use `{:style="counter-reset:step-counter 41"}` instead of `start="42"`.

Add the example from just-the-docs#750 to `docs/index-test.md` to test.
@pdmosses
Copy link
Contributor

pdmosses commented Jun 3, 2022

@mairas thanks for reporting the issue with the start attribute.

PR #856 adds tests that show how to use CSS styling to start at a given value, as well as to continue an interrupted list (as wanted by @bentookey-yotta). If that is adequate, please close this issue.

Using CSS Counters has further examples. However, it doesn't seem possible to reverse the direction of counting without customising the CSS used by this theme.

@bentookey-yotta
Copy link

@pdmosses Thanks so much for explaining this, it's solved a major issue with our Help!
With this solution, I agree this issue can probably be closed.

@pdmosses
Copy link
Contributor

pdmosses commented Jun 6, 2022

@bentookey-yotta good to hear that you're happy with the solution that I found. I'm not familiar with the CSS used by this theme, nor with CSS counters, and I was puzzled to see that the specific attributes provided by HTML for manipulating the numbering in ordered lists don't work. AFAIK, the only documentation for the theme is what we see on the theme website, together with the occasional comment in the code…

Let's leave this issue open for now: PR #856 should close it automatically when it gets merged.

When all the more pressing issues have been addressed by the theme maintainers, it would be good to investigate whether the theme could and should use the automatically incremented list item counters instead of custom counters.

mattxwang pushed a commit to pdmosses/just-the-docs that referenced this issue Jul 4, 2022
Close just-the-docs#750

The theme uses CSS counters for ordered lists.
So to continue the numbering of an ordered list after a break,
use `style="counter-reset:none"` instead of `start="42"`.
Add the example from just-the-docs#750 to `docs/index-test.md` to test.
mattxwang pushed a commit to pdmosses/just-the-docs that referenced this issue Jul 4, 2022
Close just-the-docs#750

The theme uses CSS counters for ordered lists.
To start the numbering of an ordered list with 42,
use `{:style="counter-reset:step-counter 41"}` instead of `start="42"`.

Add the example from just-the-docs#750 to `docs/index-test.md` to test.
mattxwang pushed a commit that referenced this issue Jul 4, 2022
* Show how to break an ol

Close #750

The theme uses CSS counters for ordered lists.
So to continue the numbering of an ordered list after a break,
use `style="counter-reset:none"` instead of `start="42"`.
Add the example from #750 to `docs/index-test.md` to test.

* Show how to start from 42

Close #750

The theme uses CSS counters for ordered lists.
To start the numbering of an ordered list with 42,
use `{:style="counter-reset:step-counter 41"}` instead of `start="42"`.

Add the example from #750 to `docs/index-test.md` to test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants