Releases: accordproject/template-archive
Cicero v0.21.4
π Bug Fixes
- accordproject/ergo#775 accordproject/ergo#768 Formula execution returning string values do not add extraneous quotes anymore.
- accordproject/markdown-transform#294 accordproject/markdown-transform#295 : Fixes issues with pdf generation for conditionals and optionals
- accordproject/markdown-transform#290 : Fix issue with unquoting variables in conditionals and optionals
Cicero v0.21.3
This is a patch release with some minor improvements.
π Bug fixes
- accordproject/ergo#765 Aligns
Expr as Format
support for amounts so it aligns with the latest formatting support in templates - #580 Fixes issues with compiled templates
- #152 Now properly handles combination of
ciceroVersion
andlatestVersion
for template library filtering - #524 Fixes issues with
compile
command in CLI
Cicero v0.21.2
π This is a patch release with some minor improvements.
ποΈ Dependencies
- Switches to latest Markdown Transform
0.12.3
, fixing a critical issue with rebuilding the parser for a new grammar accordproject/markdown-transform#277 - Switches to latest Ergo
0.21.2
π° API
- #545 Fixes issue with filtering of template index.
TemplateLibrary.getTemplateIndex
with both optionslatestVersion
andciceroVersion
now returns the latest version of the templates compatible with the given Cicero version. - Adds a convenience API call
TemplateInstance.rebuildParser
which allows to properly rebuilds the parser with a new grammar (possibly containing new formulas).
π
- #524 Fixes issues with the arguments for the CLI
compile
subcommand.
Cicero v0.21.1
π This is a patch release with some minor improvements.
ποΈ Dependencies
- Switches to latest Concerto
0.82.8
- Switches to latest Markdown Transform
0.12.2
- Switches to latest Ergo
0.21.1
π° API
- #574 Add support for
markdown_cicero
format inTemplateInstance.draft
(was already the default)
π
- #572 Fixes critical bug in Ergo formula name generation
Cicero v0.21.0
Transmute Release βοΈ
This is a major new release of Accord Project's Cicero templating system. This release includes an entirely new parsing and drafting engine built from the ground up with markdown in mind. It reduces the number of packages dependencies, and should result in better portability and performances.
The new implementation has several benefits:
- It ensures consistency with the commonmark specification
- It exposes a well-defined Document Object Model in JSON format for templates, called
templatemark
- It improves runtime performances and memory footprint
π₯ There are a number of breaking changes which result from the integration of the template syntax into commonmark. See below for details.
ποΈ New parsing and drafting engine #547
Cicero parsing (from text to data) and drafting (from data to text) have been completely reimplemented. The new parsing/drafting engine can be found in the Accord Project markdown-transform
project.
- The parser for template grammars has been switched from Nearley to a proper plugin for the markdown-it library. This means Accord Project template grammars now behave as a proper markdown extension.
- The template parser generation, underpinning
cicero parse
, has been switched from Nearley to parser combinators using the parsimmon library. This results in better performances, portability, and extensibility.
π New Features
Template grammar
- #389 Support for monetary amounts formats has been improved. You can now use an arbitrary number of digits after the decimal point (e.g.,
CCC 0,0.0000
), no digit after the decimal point (e.g.,CCC 0,0
) and the number of monetary symbols handled has been expanded (e.g., when using a format such asK 0,0.00
). - #17 #521 #549 A new optional template block
{{#optional}} ... {{/optional}}
allows templates to specify text for variables with an optional simple or complex type. As opposed to conditional template blocks, those can contain variables within the optional text. An example can be found in the template library. - A new
{{this}}
variable allows templates to handle variables with a list or optional simple type. An example can be found in the template library.
API
- The
draft
call on Clause and contract instances now supports aformat
option for convenience. Supported formats include:html
(HTML document),slate
(the Slate Document Object Model supported by the rich text editor),ciceromark_parsed
(the CiceroMark document object model with data / variables information).
π₯ Breaking changes
Template grammar
Accord Project template grammar (usually the ./text/grammar.tem.md
file in your templates) are now a proper extension of standard commonmark documents. While every effort has been made to reduce the impact on existing template, there are several breaking changes.
- The commonmark specification distinguishes between blocks (e.g., paragraphs, lists) and inlines (e.g., text, links). A similar distinction now exists in template grammars, with: clause (
{{#clause}}
) and lists ({{#ulist}}
and{{#olist}}
) variables in templates corresponding to markdown blocks, and all other variables corresponding to markdown inlines. - Template variables corresponding to markdown blocks must be delimited using opening and closing tags starting with a newline, and ending with a new line. For instance:
{{#clause paymentClause}}Payment. As consideration in full for the rights granted herein, Licensee shall pay Licensor a one-time fee in the amount of {{amountText}} ({{amount}}) upon execution of this Agreement, payable as follows: {{paymentProcedure}}.{{/clause}}
Is no longer considered a clause, but will be parsed as a markdown paragraph. Instead, write:
{{#clause paymentClause}}
Payment. As consideration in full for the rights granted herein, Licensee shall pay Licensor a one-time fee in the amount of {{amountText}} ({{amount}}) upon execution of this Agreement, payable as follows: {{paymentProcedure}}.
{{/clause}}
- Template variables corresponding to markdown inlines have to be written within a single markdown block (i.e., single heading, or single paragraph). For instance the following conditional which spans two markdown paragraphs is no longer supported:
{{#if forceMajeure}},except in the presence of
force majeure.{{/if}}
- Code blocks can no longer contain variables. This is an inherent limitation in markdown parsers (and document model). i.e., the following code block containing a variable
{{name}}
```js
function {{name}}(x) { return x; }
```
is no longer supported.
- Template grammar blocks syntax now use the generic form:
{{#kind name attributes}}More TemplateText{{/kind}}
, whereattributes
are list ofkey="value"
pairs. As a result thejoin
block are now written:{{#join rates separator=β,β}}{{rate}}%{{/join}}
rather than{{#join rates β,β}}{{rate}}%{{/join}}
.
Contracts / Clauses
- #4 Contract or clause text with repeated occurrences of the same variable will now fail parsing if the different occurrences differ. This allows for a stronger validation of the data in the text of your clause or contract.
- #552 Parsing for relationships now returns the proper resource description so they can be distinguished from strings (i.e.,
"resource:org.accordproject.organization.Organization#Party%20A"
rather than"Party A"
). Drafting from data must use the same format. - Clauses within contract text now have to be delimited with the same
{{#clause}}...{{/clause}}
markup used in the corresponding contract template. See for instance the payment clause within the new copyright-license template. - Text in samples corresponding to Ergo formulas must now be written
{{% ...some text... %}}
rather than{{ ...some text...}}
API
- The
TemplateInstance.draft
call is no longer anasync
- The parser manager class has been moved to https://github.com/accordproject/markdown-transform/blob/master/packages/markdown-template/lib/parsermanager.js and completely revised. Among some of the main changes:
- The
ParserManager.getGrammar
call which used to return the Nearley grammar has been removed - The
ParserManager.getTemplatizedGrammar
, which returns the template grammar in textual form has been renamed toParserManager.getTemplate
- The
ParserManager.buildGrammar
call for parser construction has been renamedParserManager.buildParser
- The
ParserManager.getParser
now returns a Parsimmon parser combinator, rather than a Nearly parser - A new
ParserManager.getTemplateMark
call has been added, returning the template grammar Document Object Model - A new
ParserManager.setTemplateMark
allows to set the template grammar directly as TemplateMark (without the need for a grammar in textual form)
- The
βοΈ Cicero server (contribution by @martinhalford)
- The interface to
@accordproject/cicero-server
has been cleaned up, and better documented. - The legacy
CICERO_DATA
environment variable and the corresponding (previously deprecated)/trigger/:template/:data
endpoint has been removed.
π Resolved Issues and Bug Fixes
This new release addresses a number of long standing issues and includes numerous bug fixes:
- #4: Repeated bindings
- #17 #549 #520: Optional parameters
- #386: Remove use of Eval
- #552: parsing for relationships
- #553: Parser modularity
- #554: Handling conditional at the end of paragraph
- #555: Are conditional blocks markdown blocks!?
- #531: Timezone when parsing dates
- #404: Whitespace issues during template parsing
- #386: Parser generation using JavaScript
eval
- #278: nujucks hack for parsing templates in the browser
Cicero v0.20.10
This release includes some new features, including new metadata for template authors (author name and logo), new formatting support for amounts in your template text, new options for drafting, and improvements to the cicero-server
package.
π Templates
- #240 You can now indicate author information in the template metadata (in the
author
field of thepackage.json
file) as well as a logo (alogo.png
file which has to have a size of 128x128 ). (contribution from @algomaster99 with support code from @arteevraina and @jeromesimeon) - #389 Variables whose type is a
Double
or aMonetaryAmount
can now be formatted in your clause or contract text e.g.,{{amount as "0,0.00 CCC"}}
over{ "$class" : "org.accordproject.money.MonetaryAmount, "doubleValue": 10000000, "currencyCode": "USD" }
will be drafted as10,000,000.00 USD
.
π» Command Line
- #305 You can pass new options to the Cicero
draft
call on the command line.--unquoteVariables
removes quotes around string variables and Ergo formulas in your templates. (contribution from @mttrbrts with support code from @jeromesimeon)
π° Cicero Server
- #508
cicero-server
has been redesigned to align with the Cicero command line, now including/trigger
/draft
and/parse
endpoints. (contribution from @martinhalford with support code from @jeromesimeon)
Warning: the
/trigger/:template/:data
endpoint is deprecated. We recommend switching to the new/trigger/:template
which allows to pass the contract data as part of the http POST body
Cicero v0.20.9
π This is a patch release, upgrading to the latest version of markdown transform, and adding some useful information when drafting conditional variables with the wrapVariables
option.
Dependencies
- Uses latest Markdown Transform v0.10.0, including improvements and numerous bug fixes. See release notes for that version and previous ones at https://github.com/accordproject/markdown-transform/releases
- Update to Ergo
0.20.9
Drafting
- When using
ergo draft
with the--wrapVariables
option conditional variables now includewhenTrue
andwhenFalse
attributes containing the alternative text.
Cicero v0.20.8
π This is a bug-fix release, adding properly handling for the --wrapVariables
option in the `cicero normalize command (#506).
Cicero 0.20.7
π This release upgrades to markdown transform 0.9.4
including several bug fixes for CiceroMark.
Cicero v0.20.5
This is a minor release for Cicero 0.20
!
π· This release provides more complete support for the draft
command with the wrapVariables
option, to support the latest Cicero UI components.
π Internal
- Parse errors always raise a
ParseException
(Contribution @dselman)