Skip to content

Conversation

caribpa
Copy link

@caribpa caribpa commented May 11, 2022

Hi there!

This PR adds the option to automatically generate id attributes for the HTML headings by setting the :generate_heading_id option to true.

I am aware that #68 tries to do a similar thing, but it uses a <span> inside the heading instead of adding the id attribute to the heading itself, like this PR achieves.

The ids of subheadings are generated based on the ids of those above it, trying to preserve uniqueness.

In a nutshell, this:

* Hello
** World

Gets converted into:

<h1 id="hello">Hello</h1>
<h2 id="hello--world">World</h2>

This PR also adds the -i flag to the org-ruby tool to enable this behavior.

Let me know what you think 😁

@sangwoo-joh
Copy link

Thank you so much. Even though this commit has not been merged into the master branch yet, I personally use this feature gratefully.

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

Successfully merging this pull request may close these issues.

2 participants