-
-
Notifications
You must be signed in to change notification settings - Fork 13
Separate handlebars #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Separate handlebars #134
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
012dd60
:fire: separate handlebars to moban-handlebars
chfw 36a4e85
:bug: fix get_primary_key will fail when a module is loaded later. fi…
chfw 71ab3ec
:books: update handlebars usage
chfw 60a3c53
:bug: moban hash does not work because trailing new line was not remo…
chfw 2af95d8
:books: update conf.py from pypi-mobans-pkg
chfw efa67a4
:green_heart: use moban-handlebars git repo for testing
chfw cf596a5
:books: update change log, docs and correct typepos
chfw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,5 @@ | ||
|
|
||
| {{hello}} | ||
|
|
||
| {{nihao}} | ||
|
|
This file contains hidden or 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,6 @@ | ||
| requires: | ||
| - moban-handlebars | ||
|
|
||
| targets: | ||
| - a.output: a.template.handlebars | ||
| - b.output: base.hbs |
This file contains hidden or 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,31 @@ | ||
| Level 11: use handlebars | ||
| ================================================================================ | ||
|
|
||
| moban is extensible via lml. Charlie Liu through Google Code-in 2018 has | ||
| kindly contributed moban-handlebars plugin. | ||
|
|
||
|
|
||
| Evaluation | ||
| -------------------------------------------------------------------------------- | ||
|
|
||
| Please go to `docs/level-11-use-handlebars` directory. | ||
|
|
||
|
|
||
| Here is the `.moban.yml`, which replaces `jj2` with handlebars files in level 4:: | ||
|
|
||
| requires: | ||
| - moban-handlebars | ||
|
|
||
| targets: | ||
| - a.output: a.template.handlebars | ||
| - b.output: base.hbs | ||
|
|
||
|
|
||
| where `targets` should lead an array of dictionaries, `requires` installs | ||
| moban-handlebars extension. You can provide file suffixes: ".handlebars" | ||
| or ".hbs" to your handlebars template. | ||
|
|
||
| Here is how to launch it | ||
| .. code-block:: bash | ||
|
|
||
| moban |
This file contains hidden or 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 @@ | ||
| {{no-inheritance}} |
This file contains hidden or 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,4 @@ | ||
|
|
||
| world | ||
|
|
||
| shijie |
This file contains hidden or 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,3 @@ | ||
| overrides: data.base.yaml | ||
| hello: world | ||
| no-inheritance: handlebars does not support inheritance |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| pyyaml>=3.11 | ||
| jinja2>=2.7.1 | ||
| lml==0.0.4 | ||
| lml>=0.0.7 | ||
| crayons | ||
| pybars3 |
This file contains hidden or 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 @@ | ||
| https://github.com/moremoban/moban-handlebars/archive/master.zip |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| import os | ||
|
|
||
| from nose.tools import eq_ | ||
| from moban.engine_handlebars import EngineHandlebars | ||
| from moban.jinja2.engine import Engine | ||
|
|
||
|
|
||
| def test_handlebars_template_not_found(): | ||
| path = os.path.join("tests", "fixtures", "handlebars_tests") | ||
| engine = EngineHandlebars([path]) | ||
| path = os.path.join("tests", "fixtures", "jinja_tests") | ||
| engine = Engine([path]) | ||
| template = engine.get_template("file_tests.template") | ||
| data = dict(test="here") | ||
| result = engine.apply_template(template, data, None) | ||
| expected = "here" | ||
| expected = "yes\nhere" | ||
| eq_(expected, result) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this format intentional? Used to be a list with each element separated by a newline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one comes from pypi-mobans-pkg, which then comes from sphinx project. The fix is better to come from there.