cabo / kramdown-rfc

An XML2RFC (RFC799x) backend for Thomas Leitner's kramdown markdown parser
MIT License
195 stars 83 forks source link

Index synonyms #168

Closed MikeBishop closed 2 years ago

MikeBishop commented 2 years ago

Is there a way to have multiple terms index/abbreviate to the same entry? I'm thinking of things like "control stream" and "control streams" which really shouldn't be separate entries (or even subitems, really) but are distinct streams.

cabo commented 2 years ago

Do you have an example document?

cabo commented 2 years ago

Oh, and did you see https://mailarchive.ietf.org/arch/msg/rfc-markdown/PklAZRoS2NchUzKSOLupZ9IJwWg?

This is a bit tedious, but might do the job.

MikeBishop commented 2 years ago

I did not see that discussion; it looks more like a solution to #167, where I could suppress the link generation within the definition.

For an example, check the HTTP/3 index (built from https://github.com/quicwg/base-drafts/blob/h3qp_auth48/rfc9114.md) where "control stream" and "control streams" get separate index entries. I'd like to be able to make "control stream" be the index entry, even if the text happens to use the plural in some cases. Same with push stream(s), request stream(s), etc.

cabo commented 2 years ago

You can do that with this change:

-*[control streams]: #control-streams
+*[control streams]: #control-streams (((control stream)))

A bit redundant, but I don't see how kramdown-rfc could guess this.

MikeBishop commented 2 years ago

No, I wouldn't expect it to be guessed; just the ability to do it. Thank you!