naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.1k stars 326 forks source link

Dynamic Glossary collation #3370

Open dbolack-ab opened 7 months ago

dbolack-ab commented 7 months ago

Your idea:

Dynamic Glossary collation follows the pattern set up in Rich Indexes and definition lists.

Arbitrarily placed markdown is placed in the brew text and then collated and ordered by a snippet which outputs any number of glossary lists.

Markdown Format: The markdown takes one of two shapes, each as a single line entry.

  1. #Glossary Term :: Glossary Definition - This creates a term/definition pair and places it on the default glossary list Glossary
  2. #GlossaryList Glossary Term :: Glossary Definition - This creates a term/definition pair and places it on the user-created glossary list GlossaryList

Markdown details: In both cases, the markdown is consumed on parsing.

Snippet Details: The snippet runs its own parsing of the markdown from the brew and places it in the designated Glossary List. Duplicate terms will have their Definitions collected for shared output.
Each list will be ordered by term. Output for each list will have the list name as an H2 header, followed by the list rendered as a PanDoc style

list followed by a \page

ericscheid commented 7 months ago

Looks good.

I assume that the presence of the double-colon :: is what distinguishes this syntax from the index-marking syntax of #3369?

Slight suggestion might be to use single column to terminate the glossary-list-name, like this #Glossary List Name: Term :: Glossary Definition

dbolack-ab commented 7 months ago

I assume that the presence of the double-colon :: is what distinguishes this syntax from the index-marking syntax of #3369?

Correct.

Slight suggestion might be to use single column to terminate the glossary-list-name, like this #Glossary List Name: Term :: Glossary Definition

This is a good idea, though I think I want to want and see how the discussion shakes out on putting the list name at the end in 3369 and use the same pattern in both places.