Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow defining class(es) for list items #5

Closed
m5o opened this issue Jan 16, 2018 · 8 comments
Closed

Allow defining class(es) for list items #5

m5o opened this issue Jan 16, 2018 · 8 comments
Labels
enhancement New feature or request

Comments

@m5o
Copy link

m5o commented Jan 16, 2018

Hey @allejo 👋

The popular twbs/bootstrap repo is currently using a custom plugin for generating the toc.
With your help, we could replace the old custom toc with your jekyll-toc which has out-of-the-box support for github-pages.
I wanted to ask, if you want to help make jekyll-toc ready to be replaced in bootstrap.

I've made a branch in my fork an played a bit:
https://github.com/m5o/bootstrap/tree/jekyll-toc

TOC Usage

{% include toc.html html=content class="section-nav" h_min=1 h_max=4 %}

Expected TOC

<!-- from: https://getbootstrap.com/docs/4.0/components/alerts/ -->
<ul class="section-nav">
  <li class="toc-entry toc-h2"><a href="#examples">Examples</a>
    <ul>
      <li class="toc-entry toc-h3"><a href="#link-color">Link color</a></li>
      <li class="toc-entry toc-h3"><a href="#additional-content">Additional content</a>
        <ul>
          <li class="toc-entry toc-h4"><a href="#well-done">Well done!</a></li>
        </ul>
      </li>
      <li class="toc-entry toc-h3"><a href="#dismissing">Dismissing</a></li>
    </ul>
  </li>
  <li class="toc-entry toc-h2"><a href="#javascript-behavior">JavaScript behavior</a>
    <ul>
      <li class="toc-entry toc-h3"><a href="#triggers">Triggers</a></li>
      <li class="toc-entry toc-h3"><a href="#methods">Methods</a></li>
      <li class="toc-entry toc-h3"><a href="#events">Events</a></li>
    </ul>
  </li>
</ul>

Actual TOC

<ul class="section-nav">
  <li><a href="#examples">Examples</a>
    <ul>
      <li><a href="#link-color">Link color</a></li>
      <li><a href="#additional-content">Additional content</a></li>
      <li><a href="#dismissing">Dismissing</a></li>
    </ul>
  </li>
  <li><a href="#javascript-behavior">JavaScript behavior</a>
    <ul>
      <li><a href="#triggers">Triggers</a></li>
      <li><a href="#methods">Methods</a></li>
      <li><a href="#events">Events</a></li>
    </ul>
  </li>
</ul>

ToDos

  • the li have custom classes including the level toc-entry hX
  • spotted jekyll-toc includes the headline ("Conveying meaning to assistive technologies") of the callout box
@allejo
Copy link
Owner

allejo commented Jan 16, 2018

Hi there 👋

The feature you're asking for should be doable.

For what it's worth, using this project on the Bootstrap website has been tried in the past and it was decided not to continue with this solution: see #3. Not sure if requirements on that matter have changed or not.

@m5o
Copy link
Author

m5o commented Jan 16, 2018

Time has passed, progress was made. Together with @XhmikosR we nuked some custom plugins lately. Only two open task ahead

@XhmikosR
Copy link
Contributor

I'm not sure we can do this @m5o. I have already tried it and it ended up being a lot messier.

It's OK to keep one or two plugins. The problem is with the custom plugins in the repo; those slow down things the most.

@m5o
Copy link
Author

m5o commented Jan 16, 2018

@XhmikosR It would be really valuable, because it will be allow usage of github-pages support out-of-the-box. This is a huge thing.

@XhmikosR
Copy link
Contributor

There is a balance between every thing. And here, personally, it just is more complex than it has to be.

We don't really care to make the docs build on GitHub pages. It's an extra step we have learned to live with.

But, if we can get rid of the custom plugins (not gems) then at least the build should speed up. Either way this is outside of this repo's scope :)

@m5o
Copy link
Author

m5o commented Jan 16, 2018

We don't really care to make the docs build on GitHub pages. It's an extra step we have learned to live with.

It could get 57.000+ forks the possibility to rollout a docs page. This will benefit the bootstrap environment a lot.

@XhmikosR
Copy link
Contributor

I don't see any benefit there. Also, our gh-pages branch includes older docs versions. We just can't use GitHub pages.

@allejo allejo closed this as completed in 5ae68e1 Jan 16, 2018
@allejo
Copy link
Owner

allejo commented Jan 16, 2018

I could see this feature request being useful to others, so here's how to use it.

@allejo allejo added the enhancement New feature or request label Jan 16, 2018
@allejo allejo changed the title make jekyll-toc working with twbs/bootstrap Allow defining class(es) for list items Jan 16, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants