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

TOC not working with Rmd files #33

Open
truonghm opened this issue Oct 14, 2019 · 2 comments
Open

TOC not working with Rmd files #33

truonghm opened this issue Oct 14, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@truonghm
Copy link

truonghm commented Oct 14, 2019

Hi,

Thank you for creating this theme. It's simple and works well to my needs. However, I'm having an issue with TOC and Rmd files. I don't have any expriences in web development, so bear with me while I try to explain this:

I'm using Rmd files to compile new posts, but the posts are not displaying the floating TOC correctly: only TOC title are displayed (my post: https://truonghm.github.io/).

I have done my own researches and look at theme source files, and here are my findings:

  1. TOC being included is determined in the file _default/single.html

  2. The HTML output of normal Markdown file has its headings in the following format:

<h3 id="this-is-a-heading">This is a heading</h3>
  1. While the HTML output of R Markdown file has its headings in a different format:
<div id="this-is-a-heading" class="section level3 unnumbered">
<h3>This is a heading</h3>

And as such it looks like the TOC engine doesn't recognize headings from Rmd files to build TOC.

I'm thinking of 2 solutions to this problem:

  1. Change the TOC engine (I haven't figured out its location yet) so that it also recognize a different heading pattern from Rmd

  2. Include some code in the Rmd files so that the headings are produced correctly

I don't have much knowledge regarding HTML/CSS/JS, so it would be a great if you can provide some help.

Thank you again for building the theme!

Edit: This is also the first time I'm submitting an issue on GitHub, and I think the "bug" label does not apply correctly here... Is there any way I can edit this?

@truonghm truonghm added the bug Something isn't working label Oct 14, 2019
@qqpann
Copy link
Owner

qqpann commented Nov 30, 2019

Hello @truonghm ,
Thanks for opening an issue.

I have very few knowledge about rmd files.
Could you provide some simple example of rmd in your use case?

@qqpann
Copy link
Owner

qqpann commented May 2, 2020

Thanks for your edit, @truonghm .
It seems GitHub doesn't send notifications for edits, so I didn't notice, sorry :P

The Rmd post encountered this issue is here, right?
I'll leave the link here for me to debug later, if it doesn't bother you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants