iainc / Markdown-Annotations

Markdown Annotations embed authorship in text while preserving its readability and portability.
https://ia.net
98 stars 1 forks source link

YAML front matter #5

Open kemayo opened 7 months ago

kemayo commented 7 months ago

There's already a fairly common metadata system for markdown files, and it's YAML front-matter. Adding a second block of metadata at the end of the document seems less ideal, compared to just incorporating it into the existing common usage.

I'd speculate that the spec chose for annotations to be appended to the end because it means that when editing the annotated text you wouldn't get stuck in a recursive loop of changing the annotation-data changing the offsets that need to be recorded within the annotation-data. Fortunately there's a simple solution to this: specify that all character-ranges are given relative to the end of the front-matter.

kemayo commented 7 months ago

The drawback to specifying that character ranges are relative to the front-matter's end would, of course, be that it'd not be possible to annotate the content within the front-matter. That's a trade-off that doesn't seem too bad to me.