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

Allow non-nested lists #70

Closed
metin-sk opened this issue Jul 16, 2023 · 3 comments
Closed

Allow non-nested lists #70

metin-sk opened this issue Jul 16, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@metin-sk
Copy link

Is it possible to get a non-nested list? Nested lists like this one create problems when writing CSS (especially using :nth-of-type())

<ul>
    <li>
        <a href="#heading-1" class="anchor_class">Heading 1</a>
        <ul>
            <li>
                <a href="#heading-21" class="anchor_class">Heading 2.1</a>
            </li>
            <li>
                <a href="#heading-22" class="anchor_class">Heading 2.2</a>
            </li>
        </ul>
    </li>
</ul>

It would be great if it was possible to get lists like this one:

<ul>
    <li>
        <a href="#heading-1" class="anchor_class">Heading 1</a>
    </li>
    <li>
        <a href="#heading-21" class="anchor_class">Heading 2.1</a>
    </li>
    <li>
        <a href="#heading-22" class="anchor_class">Heading 2.2</a>
    </li>
</ul>

If it is already possible, how could I use that? If it is not, please add a feature for this. I'm sorry for my English, I try my best :)

@metin-sk metin-sk added the enhancement New feature or request label Jul 16, 2023
@allejo
Copy link
Owner

allejo commented Jul 18, 2023

It is currently not possible to achieve this but also, shouldn't be hard to implement.

I am curious as to why you need everything only at one level? Is it just because the CSS is hard to write?

@metin-sk
Copy link
Author

If you try to use this CSS code for each these HTML examples, you will see the difference:

ul li:nth-of-type(2) {
  color: red;
}

@allejo allejo closed this as completed in 2ab431a Nov 17, 2023
@allejo
Copy link
Owner

allejo commented Nov 17, 2023

I've added a new flat_toc parameter that you can use to opt-in to having a single-level table of contents; tagged in v1.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants