Giter Site home page Giter Site logo

JekyllTag: toc about jekyll-toc HOT 6 OPEN

toshimaru avatar toshimaru commented on May 28, 2024
JekyllTag: toc

from jekyll-toc.

Comments (6)

XhmikosR avatar XhmikosR commented on May 28, 2024 1

Thanks for the PR, but being we only use Jekyll for v4 I think it'd be wiser to just leave it as is. On master we switch to Hugo, I just thought this was a regression that's why I commented :)

from jekyll-toc.

toshimaru avatar toshimaru commented on May 28, 2024

issue reported by @XhmikosR.
#82 (comment)

Quote:

@toshimaru this breaks a few things, or one of the other 0.12.0 changes.

If you try our v4-dev branch from https://github.com/twbs/bootstrap.git, and switch to jekyll-toc 0.12.0, you see that even with {% toc %} we get no ToC. Also, bd-example isn't skipped anymore, at least for the alerts page I see Well Done in ToC, only this entry.

from jekyll-toc.

toshimaru avatar toshimaru commented on May 28, 2024

It happens when page content returns wrong HTML(partially markdown content).

> context.registers[:page]['content']
=> "## Examples\n\nAlerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight **required** contextual classes (e.g., `.alert-success`). For inline dismissal, use the [alerts jQuery plugin](#dismissing).\n\n{% capture example %}\n{% for color in site.data.theme-colors %}\n<div class=\"alert alert-{{ color.name }}\" role=\"alert\">\n  A simple {{ color.name }} alert—check it out!\n</div>{% endfor %}\n{% endcapture %}\n{% include example.html content=example %}\n\n{% include callout-warning-color-assistive-technologies.md %}\n\n### Link color\n\nUse the `.alert-link` utility class to quickly provide matching colored links within any alert.\n\n{% capture example %}\n{% for color in site.data.theme-colors %}\n<div class=\"alert alert-{{ color.name }}\" role=\"alert\">\n  A simple {{ color.name }}
...

not sure why it happens.

Right behavior

Retirning HTML.

 context.registers[:page]['content']
=> "<style type=\"text/css\">\n@-webkit-keyframes anim {\n    0%   { opacity: 0; }\n    100% { opacity: 1; }\n}\n@keyframes anim {\n    0%   { opacity: 0; }\n    100% { opacity: 1; }\n}\n.post-image  {\n  -ms-animation: anim 2s infinite;\n  -webkit-animation: anim 2s infinite;\n  animation: anim 2s infinite;\n}\n</style>\n\n<p><a href=\"http://www.adventar.org/calendars/57\">CSS Property Advent Calendar 2013</a>の11日目の記事としてCSSアニメーションのプロパティを紹介をします。</p>\n\n<h2 id=\"なぜcssアニメーションなのか\">なぜCSSアニメーションなのか?</h2>
...

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 28, 2024

I think it's a matter of order. With 0.12.0 you are accessing content before it's been processed by Jekyll, thus the example shortcode hasn't run by the time jekyll-toc runs.

from jekyll-toc.

toshimaru avatar toshimaru commented on May 28, 2024

Yes, it seems so. will look into further why the order changes by a content.

from jekyll-toc.

toshimaru avatar toshimaru commented on May 28, 2024

Created PR: twbs/bootstrap#28598

from jekyll-toc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.