-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dan Selman <[email protected]>
- Loading branch information
Showing
14 changed files
with
97 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const MODEL = `namespace [email protected] | ||
concept Address { | ||
o String line1 | ||
o String city | ||
o String state | ||
o String country | ||
} | ||
@template | ||
concept Customer { | ||
o Address address optional | ||
}`; | ||
|
||
const TEMPLATE = ` | ||
> Renders an optional object using the \`#clause\` block with a conditional expression. | ||
{{#clause address condition="return address!==undefined"}} | ||
#### Address | ||
{{line1}}, | ||
{{city}}, {{state}}, | ||
{{country}} | ||
{{/clause}} | ||
Done. | ||
`; | ||
|
||
const DATA = { | ||
"$class" : "[email protected]" | ||
}; | ||
|
||
const NAME = 'Clause with Condition'; | ||
export {NAME, MODEL,DATA,TEMPLATE}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const MODEL = `namespace [email protected] | ||
@template | ||
concept HelloWorld { | ||
o String name | ||
}`; | ||
|
||
const TEMPLATE = `> Includes a TypeScript formula. | ||
### Welcome {{name}}! | ||
Your name has {{% return name.length %}} characters. | ||
`; | ||
|
||
const DATA = { | ||
"$class" : "[email protected]", | ||
"name": "John Doe" | ||
}; | ||
|
||
const NAME = 'Formula'; | ||
export {NAME, MODEL,DATA,TEMPLATE}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ const MODEL = `namespace [email protected] | |
concept Empty { | ||
}`; | ||
|
||
const TEMPLATE = ` | ||
const TEMPLATE = `> Most markdown can be used in a template. | ||
# h1 Heading 8-) | ||
## h2 Heading | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,19 @@ concept TemplateData { | |
o LoyaltyStatus loyaltyStatus optional | ||
}`; | ||
|
||
const TEMPLATE = `{{#optional loyaltyStatus}}Your loyalty status: {{level}}{{else}}You do not have a loyalty status.{{/optional}} | ||
const TEMPLATE = `> The \`{{#optional}}\` block is used with optional content. | ||
{{#optional loyaltyStatus}}You have loyalty status.{{else}}You do not have a loyalty status.{{/optional}} | ||
Done. | ||
`; | ||
|
||
const DATA = { | ||
"$class" : "[email protected]" | ||
"$class" : "[email protected]", | ||
"loyaltyStatus" : { | ||
$class: "[email protected]", | ||
level: "Gold" | ||
} | ||
}; | ||
|
||
const NAME = 'Optional'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters