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

Sub UL classes #40

Closed
kylekirkby opened this issue Jun 12, 2020 · 6 comments · Fixed by #43
Closed

Sub UL classes #40

kylekirkby opened this issue Jun 12, 2020 · 6 comments · Fixed by #43
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed pinned

Comments

@kylekirkby
Copy link

Hi @allejo,

Is there a parameter I can use to inject classes into the sub-level ul tags?

BR,

Kyle

@kylekirkby kylekirkby added the question Support on how to use this project label Jun 12, 2020
@allejo
Copy link
Owner

allejo commented Jun 14, 2020

There currently is not a parameter that would allow you to do this. You would have to use CSS at the moment.

/* a third sublevel of items */
.my_toc ul ul {}

But this feature should be doable and can be added.

@allejo allejo added enhancement New feature or request help wanted Extra attention is needed and removed question Support on how to use this project labels Jun 14, 2020
@kylekirkby
Copy link
Author

Thanks for your reply @allejo,

I've pivoted and gone with slate for the documentation but it would be still good to be able to add classes to sub ul's :) I might be able to take a look at this at some point but I'm pretty busy on other projects atm.

BR,

Kyle

@stale
Copy link

stale bot commented Jul 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 3, 2020
@allejo allejo added pinned and removed wontfix This will not be worked on labels Jul 3, 2020
@redtide
Copy link

redtide commented Jul 21, 2020

This would be useful also to me; I'm working on a documentation website where I would like to have the TOC as a left sidebar widget, which requires the sub ul tags using a "submenu" class.

@allejo
Copy link
Owner

allejo commented Jul 29, 2020

This just serves as a note/explanation. But basically, in order to achieve this feature, we're going to need to add the "submenu" classes to the end of each list. These are the two situations of when they're going to need to be added.

  • When we decrease the level of indentation
  • When finish generating the entire TOC, we're going to need to "close" up our remaining lists with classes
- {:.item-1} [Heading 1](#heading-1)
    - {:.item-2} [Heading 2.1](#heading-21)
        - {:.item-3} [Heading 3.1](#heading-31)
        - {:.item-3} [Heading 3.2](#heading-32)
        {:.submenu-2}
    - {:.item-2} [Heading 2.2](#heading-21)
        - {:.item-3} [Heading 3.3](#heading-33)
        - {:.item-3} [Heading 3.4](#heading-34)
        {:.submenu-2}
    {:.submenu-1}
<ul>
  <li class="item-1"><a href="#heading-1">Heading 1</a>
    <ul class="submenu-1">
      <li class="item-2"><a href="#heading-21">Heading 2.1</a>
        <ul class="submenu-2">
          <li class="item-3"><a href="#heading-31">Heading 3.1</a></li>
          <li class="item-3"><a href="#heading-32">Heading 3.2</a></li>
        </ul>
      </li>
      <li class="item-2"><a href="#heading-21">Heading 2.2</a>
        <ul class="submenu-2">
          <li class="item-3"><a href="#heading-33">Heading 3.3</a></li>
          <li class="item-3"><a href="#heading-34">Heading 3.4</a></li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

@allejo
Copy link
Owner

allejo commented Jul 30, 2020

I've created PR #43, if you could take a look and see if that works for you/leave feedback, that'd be great 😄

@allejo allejo self-assigned this Jul 30, 2020
@allejo allejo closed this as completed in #43 Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed pinned
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants