cedar-policy / cedar-docs

Documentation for Cedar policy language
https://docs.cedarpolicy.com
Apache License 2.0
24 stars 23 forks source link

Change heading anchors to kramdown style ids #52

Closed cjohnson19 closed 1 year ago

cjohnson19 commented 1 year ago

Description of changes:

The anchor links which kramdown generates in the table of contents are based on the heading's HTML content and add an id to the header itself. Since it uses the HTML content, this duplicated the anchor into the toc. Links in the docs which referred to these anchors would then go to the table of contents instead of the heading itself.

For example, the headings as they are now generate in the table of contents to look like:

<li>
  <a href="#features-of-cedar" id="markdown-toc-features-of-cedar">Features of Cedar</a>
  <a name="feature-overview"></a>
</li>

While the heading is:

<h2 id="features-of-cedar">
<!-- Content omitted -->
Features of Cedar<a name="feature-overview"></a>
</h2>

This change specifies the anchors manually to prevent kramdown creating new ones -- preventing the double destination problem.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

AMZ-brandon commented 1 year ago

Hi Chase! Thanks for the contribution, and apologies for the delay. I'm evaluating your changes in my test environment and will come back shortly.

cjohnson19 commented 1 year ago

Hi Chase! Thanks for the contribution, and apologies for the delay. I'm evaluating your changes in my test environment and will come back shortly.

No problem at all! Take your time and let me know if you have any questions / concerns I could address. Thanks for fixing those merge conflicts.

AMZ-brandon commented 1 year ago

I'm satisfied that this is a better system for implementing the anchors. Thanks again for the contribution!