-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for formatting markup in templates, as inspired by Markdown #79
Comments
We should use the commonmark spec for Markdown, https://commonmark.org/ There is a reference implementation in JS, https://github.com/commonmark/commonmark.js We also don't currently have any presentation mechanism inside Cicero, so to make this useful we should add a shim to cicero-cli for the markdown renderer. Perhaps something like, |
To further elaborate on this proposal, here is a possible extension to the Template Specification to allow for semantic formatting inside a template grammar. Note the switch to GFM from commonmark, this is because GFM includes an extension for tables. Other than for variables, formatting follows the GitHub Flavored Markdown Spec. The meaning of Sections, Definitions & References is similar to those used in the Markdown rendering of a Common Form document. Markdown provides a good compromise between expressiveness and legibility of the grammar. Markdown is also widely used by developers and has a rich set of tools for editing and conversion to HTML & PDF for example.
SectionsSections in a template define the structure of a document. The
Sections marks imply the heading style in Markdown.
ReferencesReferences are links to terms that are defined elsewhere in the same contract. A reference is created by surrounding the name of a term with underscores,
By default, Markdown will render references in italicized text.
DefinitionsDefinitions are reusable terms that can be referenced elsewhere in a contract. Definitions are created by surrounding the name of a definition with double asterisks,
In the following example,
Or in a definitions section.
Markdown renders text that is surrounded by
Definitions can also be used to identify a Clause:
Would be rendered as:
TablesGitHub Flavored Markdown (GFM), unlike some other Markdown variants, includes support for tables.
Page Breaks & Thematic BreaksGFM allows the insertion of a thematic break, i.e. a horizontal rule, by an empty line followed by a line with 3
However, contracts often need to define a page break between distinct sections. We extend the Markdown notation to define a page break as a thematic break with 4 or more characters.
|
An alternative to extending the GFM spec for page breaks would be to use a HTML tag and rely on a HTML renderer any rendering pipeline.
|
I was just thinking the same thing. The clause I am working on has pretty technical wording and calculation examples built in and could really do with formatting to make it more readable. |
A lot of this work is taking place here: https://github.com/accordproject/markdown-editor and here: https://github.com/accordproject/contract-editor |
We now have support for markdown formatting, not just inspired with but directly using CommonMark. Closing. |
Also see:
#171
The text was updated successfully, but these errors were encountered: