ncase / nutshell

Make expandable explanations!
https://ncase.me/nutshell/
Creative Commons Zero v1.0 Universal
518 stars 32 forks source link

Parse tags other than headings and `<p>`, e.g. definition lists #12

Open melat0nin opened 2 years ago

melat0nin commented 2 years ago

I'm thinking specifically of definition lists, i.e. <dt>s and their associated <dd>s. Using Nutshell to refer to definitions of terms that are presented in a semantically correct way seems very much to fit with the ethos of the project!

For example, in the following code on the target page:

<dl>
<dt id="myfirstterm">My term</dt>
<dd>My term's definition lorem ipsum dolor sit amet consectetur adipiscing elit</dd>
</dl>

it would be great if this code could retrieve the definition in a Nutshell:

...when we talk about [:my term](/terminology/#myfirstterm), what matters is...
michaeltlombardi commented 2 years ago

I just came across this need as well - I could rework my content to use headers but I do think being able to reference definitions is a coherent usage of Nutshell.