Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ We encourage community and commercial innovation in this area!

### 3. Logic FULL

Unlike some templating systems which prohibit, or minmize, logic in templates, Accord Project templates fully embrace templates that may contain sophisticated logic: conditional logic to determine what text to include, or even calculations, for example to calculate the monthly payments for a mortgage based on the term of the mortgage, the amount and the interest rate.
Unlike some templating systems which prohibit, or minimize, logic in templates, Accord Project templates fully embrace templates that may contain sophisticated logic: conditional logic to determine what text to include, or even calculations, for example to calculate the monthly payments for a mortgage based on the term of the mortgage, the amount and the interest rate.

### 4. Type-safety

Expand Down
2 changes: 1 addition & 1 deletion src/TemplateMarkNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const FOREACH_DEFINITION_RE = /^(org\.accordproject\.templatemark)@(.+)\.
export type TemplateData = Record<string, unknown>;

/**
* TemplateMark nodes that implicity change the data access scope
* TemplateMark nodes that implicitly change the data access scope
* by specifying the name of a property on the node.
*/
export const NAVIGATION_NODES = [
Expand Down
8 changes: 4 additions & 4 deletions test/TemplateMarkInterpreter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ describe('templatemark interpreter', () => {

badTemplates.forEach(function (template) {
test(`should fail to generate ${template.name}`, async () => {
const templatenName = path.parse(template.name).name;
const model = readFileSync(`${BAD_TEMPLATES_ROOT}/${templatenName}/model.cto`, 'utf-8');
const templateMarkup = readFileSync(`${BAD_TEMPLATES_ROOT}/${templatenName}/template.md`, 'utf-8');
const data = JSON.parse(readFileSync(`${BAD_TEMPLATES_ROOT}/${templatenName}/data.json`, 'utf-8'));
const templateName = path.parse(template.name).name;
const model = readFileSync(`${BAD_TEMPLATES_ROOT}/${templateName}/model.cto`, 'utf-8');
const templateMarkup = readFileSync(`${BAD_TEMPLATES_ROOT}/${templateName}/template.md`, 'utf-8');
const data = JSON.parse(readFileSync(`${BAD_TEMPLATES_ROOT}/${templateName}/data.json`, 'utf-8'));
const modelManager = new ModelManager({ strict: true });
modelManager.addCTOModel(model);
const engine = new TemplateMarkInterpreter(modelManager, CLAUSE_LIBRARY);
Expand Down