iainc / Markdown-Annotations

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

Gracefully hide annotation blocks in comments #1

Open DivineDominion opened 7 months ago

DivineDominion commented 7 months ago

Hey,

not sure if you want to discuss this, but since it's on GitHub and Issues are allowed, here you go :)

The block layout of your example

---
Annotations: 0,95 SHA-256 1132bf5e376a605f5beed4b204456114  
@Human: 0,20 33,4 45,6 62,4  
&AI: 20,13 37,8 51,11 66,29  
...

reminded me of local variable settings in editors like Emacs.

There, the local settings or metadata blocks compose more gracefully with the content (historically: source code) by using comments.

I think using HTML/Markdown comments for these annotation purposes would compose better without breaking text rendition of all other Markdown tools that don't use the Markdown-Annotations "extension" to the syntax.

  1. No breaking changes.
    • Every tool that supports comments in Markdown can deal with the annotation blocks.
    • Strategically, that could help with adoption.
      • In theory, at least, because in practice, this annotation feature soft-locks users in: Tools that don't support this won't update the character ranges, so editing in a potato text editor will render the perfectly fine annotations from before useless.
      • But if users remain in iA Writer 7 for writing, their exporters will benefit from not having to understand a new syntax. Users can still use tools like Marked or Pandoc to export to HTML, PDF, ... without having to remove the block manually, first.
  2. Convention over re-invention.
    • Using existing syntax plus a convention for special features instead of inventing new syntax elements altogether makes adoption easier for app developers.
    • It's difficult work to change an existing Markdown parser syntax: no matter if it's tree-sitter based, or a CommonMark spec compatible one, a parser generator like Bison/Yacc/..., or some ancient home-cooked C parser, introducing changes to the weird grammar of one's Markdown dialect of choice opens a large can of worms and potential bugs.
      • People working on parsers don't mind as much. But the casual iOS app maker relying on open source libs does.
    • It's quite easy to keep the parser unchanged and add a post-processing step to check all comment blocks in the document for annotations. This code can live inside the app space, outside the parser.

Here's a re-interpretation of your syntax proposal that doesn't require a Markdown syntax/parser extension at all:

Example:

<!-- Document Settings:
Annotations: 0,95 SHA-256 1132bf5e376a605f5beed4b204456114  
@Human: 0,20 33,4 45,6 62,4  
&AI: 20,13 37,8 51,11 66,29  
-->

Alternatives considered

YAML frontmatter

Obvious contender for metadata in general.

dkgrieshammer commented 7 months ago

The Idea itself is very good (as always). I wonder if not a .git that tracks authorship by nature would be an option; this is usable in quite a lot of editors already and allows tracking of various sources;

deletosh commented 7 months ago

THIS.

The plain-text writing word are already converging on standards and extending off it: HTML and YAML for metadata.

I suspect the focus of devs should be on implement/adopting the annotation core innovation here not re-inventing wheels.

If this follows this core proposal, I already see how it will gain instant adoption in tools like Obsidian (that already has this standard, not it's implementation) and several others thought capture apps.