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

block IALs do not work with GitHub Flavored Markdown #1159

Closed
adoyle-h opened this issue Feb 8, 2023 · 3 comments
Closed

block IALs do not work with GitHub Flavored Markdown #1159

adoyle-h opened this issue Feb 8, 2023 · 3 comments
Labels

Comments

@adoyle-h
Copy link

adoyle-h commented Feb 8, 2023

Describe the bug

{:toc} and {: .no_toc } not work when change the markdown processor from Kramdown to GFM.

To Reproduce
Steps to reproduce the behavior:

  1. Add markdown: GFM in _config.yml file.
  2. build just-the-docs
  3. It shows {:toc} and {: .no_toc } as text in page.

Expected behavior

Generate a Table of Contents in page.

Screenshots

CleanShot 2023-02-09 at 02 29 15@2x

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: chrome 109.0.5414.119
  • Version: actions/jekyll-build-pages@v1
@adoyle-h adoyle-h added the bug label Feb 8, 2023
@mattxwang
Copy link
Member

Hi @adoyle-h, thanks for submitting this issue. {:toc} is not a feature in GFM, it's a kramdown-specific tag1. In addition, the general idea of block IALs - the {: .no_toc } one, for example - is also a kramdown-specific feature, and is not a part of the standard markdown syntax (or GFM). To use many of the features in Just the Docs, you have to use kramdown as your markdown parser (or, something else that inspires from Marufuku, etc.).

So, with that in mind, this is not something that Just the Docs can't really help you do directly. However, you may gain some benefits from looking in to Jekyll plugins that do this for you, or using other command-line tools that automatically generate TOCs.

Hope this made sense / helps; let me know if you have any other questions!

(also, if I could ask, is there a specific reason you want to use GFM instead of kramdown?)

Footnotes

  1. My understanding of this is from skimming the GFM spec and searching for toc.

@mattxwang mattxwang changed the title {:toc} and {: .no_toc } not work when "markdown: GFM" block IALs do not work with GitHub Flavored Markdown Feb 8, 2023
@adoyle-h
Copy link
Author

adoyle-h commented Feb 9, 2023

@mattxwang Thanks for your detailed response. I get it now.

The reason for using GFM instead of kramdown is that kramdown has not supported Automatic URL Linking
since 2016. It is still a opening issue in kramdown/parser-gfm.
And I have not found any Jekyll plugin can make Automatic URL Linking.

@mattxwang
Copy link
Member

Gotcha, thanks for the quick response. I don't have a stellar suggestion for you, though you could always use a tool like Rinku; this is probably a good candidate for a gem, since a quick Google seems to indicate that no Jekyll plugin exists yet (but, it should be pretty simple - just a wrapper for Rinku in Jekyll).

Honestly, I may eventually just make this in a weekend, but I'd encourage you to develop the plugin yourself! In the meantime, I will close this issue given that it's more related to GFM rather than kramdown.

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

No branches or pull requests

2 participants