Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
formatting multilines (#604)
Browse files Browse the repository at this point in the history
* formatting multilines

* fix comments

* remove \[
  • Loading branch information
ninggao authored Feb 25, 2020
1 parent 816d618 commit dc31509
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 33 deletions.
6 changes: 3 additions & 3 deletions packages/dialog/templates/en-us/booleanProperty.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
@{NameTemplate()}
@{ValueTemplate()}

\[@{schemaName}-@{property}Entity.@{locale}.lg]
\[library.lg]
\[library-Missing.lg]
[@{schemaName}-@{property}Entity.@{locale}.lg]
[library.lg]
[library-Missing.lg]
```

# AskTemplate
Expand Down
32 changes: 25 additions & 7 deletions packages/dialog/templates/en-us/enumEntity.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,42 @@

>>> This is because of issues around ' and } in strings--see enumEntityDesired.lg for a test case
# template
- @{propertyEntity()}\n@{chooseEntity()}\n\[library.lg]\n\[library-Choose.lg]
-```
@{propertyEntity()}
@{chooseEntity()}

[library.lg]
[library-Choose.lg]
```

# chooseEntity
- # choose@{property}Entity\n- @\{chooseEnumEntity(@{concat("'", property, "'")})\}\n
-```
# choose@{property}Entity
- @\{chooseEnumEntity(@{concat("'", property, "'")})\}
```

# propertyEntity
- @{join(createArray(namePlusSwitch(), cases(), default()), '\n')}\n
- @{join(createArray(namePlusSwitch(), cases(), default()), '')}

# namePlusSwitch
- # @{property}Entity(value) \n- SWITCH: @\{value\}
-```
# @{property}Entity(value)
- SWITCH: @\{value\}
```

# case(option)
- - CASE: @\{'@{option}'\} \n - @{phrase(option)}
-```
- CASE: @\{'@{option}'\}
- @{phrase(option)}
```

# cases
- @{join(foreach(schema.properties[property].enum, enum, case(enum)), '\n')}
- @{join(foreach(schema.properties[property].enum, enum, case(enum)), '')}

# default
- - DEFAULT: \n - I don't understand @\{value\}
-```
- DEFAULT:
- I don't understand @\{value\}
```

[generator.lg](../generator.lg)
6 changes: 3 additions & 3 deletions packages/dialog/templates/en-us/enumProperty.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
@{NameTemplate()}
@{ValueTemplate()}

\[@{schemaName}-@{property}Entity.@{locale}.lg]
\[library.lg]
\[library-Missing.lg]
[@{schemaName}-@{property}Entity.@{locale}.lg]
[library.lg]
[library-Missing.lg]
```

# AskTemplate
Expand Down
6 changes: 5 additions & 1 deletion packages/dialog/templates/en-us/library-Help.lg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
- ELSEIF: @{$expectedProperties}
- @{join(foreach($expectedProperties, expected, help1(expected)), '\n')}
- ELSE:
- @{requiredProperties()}\n@{optionalProperties()}\nYou can find out about a specific property by doing 'help <property>'.
-```
@{requiredProperties()}
@{optionalProperties()}
You can find out about a specific property by doing 'help <property>'.
```

# help1(property)
- IF: @{dialogClass.schema.properties[property].enum}
Expand Down
15 changes: 12 additions & 3 deletions packages/dialog/templates/en-us/library-PROPERTYName.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@
- @{join(createArray(namePlusSwitch(), cases(), default()), '\n')}

# namePlusSwitch
- # PROPERTYName(value) \n- SWITCH: @\{value\}
-```
# PROPERTYName(value)
- SWITCH: @\{value\}
```

# case(option)
- - CASE: @\{'@{option}'\} \n - @{phrase(option)}
-```
- CASE: @\{'@{option}'\}
- @{phrase(option)}
```

# cases
- @{join(foreach(properties, prop, case(prop)), '\n')}

# default
- - DEFAULT: \n - I don't understand @\{value\}
-```
- DEFAULT:
- I don't understand @\{value\}
```
5 changes: 4 additions & 1 deletion packages/dialog/templates/en-us/library-triggerIntent.lu.lg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
- @{schemaName}-@{triggerIntent}.lu

# template
- # @{triggerIntent}\n@{join(foreach(entities, entity, entityPattern(entity)), '\n')}
-```
# @{triggerIntent}
@{join(foreach(entities, entity, entityPattern(entity)), '\n')}
```

# entityPattern(entity)
- IF: @{contains(schema.$expectedOnly, entity)}
Expand Down
5 changes: 2 additions & 3 deletions packages/dialog/templates/en-us/library.lg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# requiredProperties
- IF: @{count(dialogClass.schema.required) > 0}
- Required properties include: @{join(foreach(dialogClass.schema.required, property, name(property)), ',')}\n
- Required properties include: @{join(foreach(dialogClass.schema.required, property, name(property)), ',')}
- ELSE:
-

Expand Down Expand Up @@ -45,7 +45,6 @@
- Which property do you want to change?

# notUnderstood
- Sorry, I do not understand @{join(foreach(turn.unrecognizedtext, chunk, concat("'", chunk, "'")), ' or ')}\n
- Sorry, I do not understand @{join(foreach(turn.unrecognizedtext, chunk, concat("'", chunk, "'")), ' or ')}

> TODO: Would be good to split out all the component pieces, i.e. help, cancel, confirmation into their own files
[library-PROPERTYName.lg]
5 changes: 4 additions & 1 deletion packages/dialog/templates/en-us/locale.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
- @{schemaName}.@{locale}.lg

# template
- >>> Library\n@{join(foreach(templates.lg, lg, concat('[', lg.fallbackName, '](', lg.fallbackName, ')')), '\n')}
-```
>>> Library
@{join(foreach(templates.lg, lg, concat('[', lg.fallbackName, '](', lg.fallbackName, ')')), '\n')}
```
5 changes: 4 additions & 1 deletion packages/dialog/templates/en-us/locale.lu.lg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
- ../luis/@{schemaName}.@{locale}.lu

# template
- >>> Library\n@{join(foreach(templates.lu, lu, concat('[', lu.fullName, '](../', locale, '/', lu.fullName, ')')), '\n')}
-```
>>> Library
@{join(foreach(templates.lu, lu, concat('[', lu.fullName, '](../', locale, '/', lu.fullName, ')')), '\n')}
```
5 changes: 4 additions & 1 deletion packages/dialog/templates/en-us/numberEntity.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

>>> This is because of issues around ' and } in strings--see enumEntityDesired.lg for a test case
# template
- # @{property}Entity(val)\n- @\{val\}
-```
# @{property}Entity(val)
- @\{val\}
```

[generator.lg](../generator.lg)
6 changes: 3 additions & 3 deletions packages/dialog/templates/en-us/numberProperty.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
@{NameTemplate()}
@{ValueTemplate()}

\[@{schemaName}-@{property}Entity.@{locale}.lg]
\[library.lg]
\[library-Missing.lg]
[@{schemaName}-@{property}Entity.@{locale}.lg]
[library.lg]
[library-Missing.lg]
```

# AskTemplate
Expand Down
4 changes: 2 additions & 2 deletions packages/dialog/templates/en-us/objectProperty.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
@{AskTemplate()}
@{NameTemplate()}

\[library.lg]
\[library-Missing.lg]
[library.lg]
[library-Missing.lg]
```

# AskTemplate
Expand Down
5 changes: 4 additions & 1 deletion packages/dialog/templates/en-us/stringEntity.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

>>> This is because of issues around ' and } in strings--see enumEntityDesired.lg for a test case
# template
- # @{property}Entity(val)\n- @\{val\}
-```
# @{property}Entity(val)
- @\{val\}
```

[generator.lg](../generator.lg)
6 changes: 3 additions & 3 deletions packages/dialog/templates/en-us/stringProperty.lg.lg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
@{NameTemplate()}
@{ValueTemplate()}

\[@{schemaName}-@{property}Entity.@{locale}.lg]
\[library.lg]
\[library-Missing.lg]
[@{schemaName}-@{property}Entity.@{locale}.lg]
[library.lg]
[library-Missing.lg]
```

# AskTemplate
Expand Down

0 comments on commit dc31509

Please sign in to comment.