Cicero 0.20 to 0.21
The main change between the 0.20
release and the 0.21
release is the new markdown syntax and parser infrastructure based on markdown-it
. While most templates designed for 0.20
should still work on 0.21
some changes might be needed to the contract or template text to account for this new syntax.
note
Before following those migration instructions, make sure to first install version 0.21
of Cicero, as described in the Install Cicero Section of this documentation.
Metadata Changes
You should only have to update the Cicero version in the package.json
for your template to ^0.21.0
. Remember to also increment the version number for the template itself.
Example
After those changes, the accordproject
field in your package.json
should look as follows (with the template
field being either clause
or contract
depending on the template):
...
"accordproject": {
"template": "clause",
"cicero": "^0.21.0"
}
...
Text Changes
Both the markdown for the grammar and sample text have been updated and consolidated in the 0.21
release and may require some adjustments. You can find complete information about the latest syntax in the Markdown Text Section of this documentation. For an existing template, you should apply the following changes.
Text Grammar Changes
- Clause or list blocks should have their opening and closing tags on a single line terminated by whitespace. I.e., you should change occurrences of :
to{{#clause clauseName}}...clause text...{{/clauseName}}
and similarly for ordered and unordeded list blocks ({{#clause clauseName}} ...clause text... {{/clauseName}}
olist
andulist
). - Markdown container blocks are no longer supported inside inline blocks (
if
join
andwith
blocks).
tip
We recommend using the new TemplateMark Dingus to check that your template variables, blocks and formula are properly identified following the new markdown parsing rules.
Text Samples Changes
- Nested clause template should be now identified within contract templates using clause blocks. I.e., if you use a
paymentClause
, you should change your text from:
to...negate the notices Licensor provides and requires hereunder. Payment. As consideration in full for the rights granted herein, Licensee shall pay Licensor a one-time fee in the amount of "one hundred US Dollars" (100.0 USD) upon execution of this Agreement, payable as follows: "bank transfer". General. ...
...negate the notices Licensor provides and requires hereunder. {{#clause paymentClause}} Payment. As consideration in full for the rights granted herein, Licensee shall pay Licensor a one-time fee in the amount of "one hundred US Dollars" (100.0 USD) upon execution of this Agreement, payable as follows: "bank transfer". {{/clause}} General. ...
- The text corresponding to formulas should be changed from
{{ ...text...}}
to{{% ...text... %}}
.
You should also ensure that any changes to the grammar text is reflected in the samples. Any change in the grammar text outside of variables should be applied to the corresponding sample.md
files as well.
tip
You can check that the samples and grammar are in agreement by using the cicero parse
command.
Model Changes
There should be no model changes required for this version.
Logic Changes
There should be no logic changes required for this version.
API Changes
A number of API changes may affect Node.js applications using Cicero or Ergo packages. The main API changes are:
- Cicero:
@accordproject/cicero-core
package- the
ParserManager
class has been completely overhauled and moved to the@accordproject/@markdown-template
package.
- the
CLI Changes
- The
cicero draft --wrapVariables
option has been removed - The
ergo draft
command has been removed
Cicero Server Changes
Cicero server API has been completely overhauled to match the more recent engine interface
- The contract data is now passed as part of the REST POST request for the
trigger
endpoint