forked from moremoban/moban
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📚 provide documentation on template_types under configuration. fix mo…
- Loading branch information
Showing
7 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
docs/level-18-user-defined-template-types/.moban.cd/data.base.yaml
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,2 @@ | ||
nihao: shijie | ||
hello: shijie |
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,11 @@ | ||
configuration: | ||
template_types: | ||
my_own_type: | ||
base_type: jinja2 | ||
file_extensions: | ||
- file_type_of_my_choice | ||
options: | ||
extensions: | ||
- jinja2_time.TimeExtension | ||
targets: | ||
- a.output: a.template.file_type_of_my_choice |
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,35 @@ | ||
Level 18: User defined template types | ||
================================================================================ | ||
|
||
Since moban version 4.1, custom template types can be defined to deviate from | ||
default configurations of the template engines. In addition, the configuration | ||
possibilities are: | ||
|
||
#. associate your own file extensions | ||
#. choose your own template engine extensions | ||
#. | ||
|
||
|
||
Evaluation | ||
-------------------------------------------------------------------------------- | ||
|
||
Please go to `docs/level-4-single-command` directory. | ||
|
||
|
||
Here is the `.moban.yml`, which inserts `template_types` on top of the moban | ||
file found in level 4:: | ||
|
||
configuration: | ||
template_types: | ||
my_own_type: | ||
base_type: jinja2 | ||
file_extensions: | ||
- file_type_of_my_choice | ||
options: | ||
extensions: | ||
- jinja2_time.TimeExtension | ||
targets: | ||
- a.output: a.template.file_type_of_my_choice | ||
|
||
|
||
where `template_types` is a dictionary of different custom types |
2 changes: 2 additions & 0 deletions
2
docs/level-18-user-defined-template-types/a.template.file_type_of_my_choice
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,2 @@ | ||
{% now 'utc' %} | ||
|
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,2 @@ | ||
overrides: data.base.yaml | ||
hello: world |
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