Repository navigation
Proposal 0022: inline formatting in notes - #159
Conversation
|
I like this and agree with it as written. One thing I would add while the note model is open: comments should be preserved in the recipe model, since today cooklang-rs drops them before the model and a recipe that is parsed, scaled and written back loses every comment the author wrote. |
|
Good point. Comments are dropped everywhere, not only in notes: a full line, the end of a step, a section line, inside component braces and in the YAML frontmatter. So any parse-and-write round trip loses them. I've opened cooklang/cooklang-rs#168 to keep them in the parsed recipe, so Cooklang-to-Cooklang output preserves them. It has a reproduction, the places where the parser drops comments, and the open questions: opt-in or on by default, the canonical tests, the bindings, and how comments inside notes fit with the runs this proposal introduces. |
Summary
>notes: emphasis (*text*,_text_), strong emphasis (**text**,__text__) and links ([text](destination)). Emphasis and links follow the CommonMark 0.31.2 rules; everything else Markdown defines (lists, headings, code, images, HTML) stays plain text.type: textruns with optionalstrong,emphasisandlinkproperties; joining thevalueof every run gives the plain text.http,https,mailto, and paths inside the recipe collection), and how a path to a.cookfile opens that recipe.Motivation
The
>marker was borrowed from Markdown and people expect a little more of it to work. Today**Make ahead:**shows its asterisks, and a note cannot give a link readable text or point to another recipe. Letting each application run its own Markdown library would give different results per app and interpret far more than intended (a note starting with*becomes a list).Addresses discussion #138 for notes, and the notes half of #82. Links in steps stay with #111 (0013), which should reuse the same syntax and
linkproperty if it goes ahead.Things worth a reviewer's attention
*and_. The cases that change their reading unintentionally (several footnote marks in one paragraph, a name wrapped in underscores, multiplication written as2*250 g) are listed under "Backward compatibility", each with its escape.--inside a destination and link text starting with-are read as comments, as they are today; the proposal documents the escapes.noteskey to test results.Rendered proposal