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

Create unique IDs for definition terms #355

Closed
gvwilson opened this Issue Jul 16, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@gvwilson

gvwilson commented Jul 16, 2016

It's common to use a definition list for a glossary, in which case it is helpful to be able to link directly from a term's use to its definition:

<p>
  The <a href="#fnord">fnordification</a> of blazwhup is...
</p>
...
<dl>
  <dt id="fnord">fnord</dt>
  <dd>...definition...</dd>
</dl>

Creating the link is easy in Kramdown-flavored Markdown:

The [fnordification](#fnord) of blazwhup is...

but there's no easy way to create the id for the dt. It would be very helpful if Kramdown auto-generated IDs, and better yet if it was possible to provide a prefix for the whole dl so that if there are several dl's in a single page, the IDs for the dts in that dl will have prefixed (unique) IDs.

@gettalong gettalong self-assigned this Aug 7, 2016

@gettalong

This comment has been minimized.

Owner

gettalong commented Aug 7, 2016

@gvwilson This feature will be in the next release.

Actually, there are two changes to definition lists:

  1. It will now be possible to assign attributes using an IAL to definition terms like it is possible already for definitions themselves.
  2. Additionally, one can assign the reference name auto_ids to a definition (similar to how footnotes and the TOC work). Definition lists having such a reference name will automatically generate an ID using the same algorithm as for header IDs (but without the additional stuff for headers and without double ID checking). And using a name like auto_ids-prefix one can assign a prefix to be used for the auto IDs.
@gvwilson

This comment has been minimized.

gvwilson commented Aug 7, 2016

@gettalong

This comment has been minimized.

Owner

gettalong commented Aug 7, 2016

Yes, next release will be end of next week.

@gvwilson

This comment has been minimized.

gvwilson commented Aug 7, 2016

@gettalong

This comment has been minimized.

Owner

gettalong commented Aug 8, 2016

@gvwilson This is a question for @benbalter but I think it will not be long after the kramdown release. For reference, Github pages was updated to kramdown 1.11.1 about a month after the kramdown release.

@gvwilson

This comment has been minimized.

gvwilson commented Aug 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment