Skip to content

Commit 141d3be

Browse files
authored
Merge pull request #392 from moremoban/dev
release 0.7.9
2 parents df46756 + c0e129f commit 141d3be

File tree

18 files changed

+218
-142
lines changed

18 files changed

+218
-142
lines changed

.moban.cd/changelog.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: moban
22
organisation: moremoban
33
releases:
4+
- changes:
5+
- action: Updated
6+
details:
7+
- "`#390`: single render action will print to stdout by defafult"
8+
date: 06.08.2020
9+
version: 0.7.9
410
- changes:
511
- action: Added
612
details:

.moban.cd/moban.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ organisation: moremoban
44
author: C. W.
55
66
license: MIT
7-
version: 0.7.8
8-
current_version: 0.7.8
9-
release: 0.7.8
7+
version: 0.7.9
8+
current_version: 0.7.9
9+
release: 0.7.9
1010
branch: master
1111
master: index
1212
command_line_interface: "moban"

.moban.d/moban_readme.jj2

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,11 @@ versions lower than 0.7.0 if you are still using python 2.
4444
Quick start
4545
================================================================================
4646

47-
.. image:: https://github.com/moremoban/moban/raw/dev/docs/images/moban-in-intro.gif
48-
4947
{% raw %}
5048
.. code-block:: bash
5149

5250
$ export HELLO="world"
5351
$ moban "{{HELLO}}"
54-
Templating {{HELLO}}... to moban.output
55-
Templated 1 file.
56-
$ cat moban.output
5752
world
5853

5954
Or
@@ -76,7 +71,7 @@ A bit formal example:
7671
.. code-block:: bash
7772

7873
$ moban -c data.yml -t my.template
79-
$ cat moban.output
74+
world
8075

8176
Given data.yml as:
8277

@@ -94,11 +89,6 @@ and my.template as:
9489

9590
{% endraw %}
9691

97-
moban.output will contain:
98-
99-
.. code-block:: bash
100-
101-
world
10292

10393
Please note that data.yml will take precedence over environment variables.
10494

@@ -182,6 +172,13 @@ Assume that the custom example was saved in `custom-jj2-plugin`
182172

183173
Moban will then load your custom jinja2 functions
184174

175+
Slim template syntax for jinja2
176+
---------------------------------
177+
178+
with `moban-slim <https://github.com/moremoban/moban-slim>`_ installed,
179+
180+
{% include "slim_example.rst.jj2" %}
181+
185182
Handlebars.js template
186183
----------------------------
187184

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Change log
22
================================================================================
33

4+
0.7.9 - 06.08.2020
5+
--------------------------------------------------------------------------------
6+
7+
**Updated**
8+
9+
#. `#390 <https://github.com/moremoban/moban/issues/390>`_: single render action
10+
will print to stdout by defafult
11+
412
0.7.8 - 09.06.2020
513
--------------------------------------------------------------------------------
614

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lint:
2121
yamllint -d "{extends: default, ignore: .moban.cd/changelog.yml}" .
2222

2323
format:
24-
isort -y $(find moban -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo)
24+
isort $(find moban -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo)
2525
git diff
2626
black -l 79 moban
2727
git diff

README.rst

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,11 @@ versions lower than 0.7.0 if you are still using python 2.
4444
Quick start
4545
================================================================================
4646

47-
.. image:: https://github.com/moremoban/moban/raw/dev/docs/images/moban-in-intro.gif
48-
4947

5048
.. code-block:: bash
5149
5250
$ export HELLO="world"
5351
$ moban "{{HELLO}}"
54-
Templating {{HELLO}}... to moban.output
55-
Templated 1 file.
56-
$ cat moban.output
5752
world
5853
5954
Or
@@ -75,7 +70,7 @@ A bit formal example:
7570
.. code-block:: bash
7671
7772
$ moban -c data.yml -t my.template
78-
$ cat moban.output
73+
world
7974
8075
Given data.yml as:
8176

@@ -92,11 +87,6 @@ and my.template as:
9287
{{hello}}
9388
9489
95-
moban.output will contain:
96-
97-
.. code-block:: bash
98-
99-
world
10090
10191
Please note that data.yml will take precedence over environment variables.
10292

@@ -179,6 +169,31 @@ Assume that the custom example was saved in `custom-jj2-plugin`
179169
180170
Moban will then load your custom jinja2 functions
181171

172+
Slim template syntax for jinja2
173+
---------------------------------
174+
175+
with `moban-slim <https://github.com/moremoban/moban-slim>`_ installed,
176+
177+
Given a data.json file with the following content
178+
179+
.. code-block::
180+
181+
{
182+
"person": {
183+
"firstname": "Smith",
184+
"lastname": "Jones",
185+
},
186+
}
187+
188+
.. code-block:: bash
189+
190+
191+
$ moban --template-type slim -c data.json "{{person.firstname}} {{person.lastname}}"
192+
Slimming <p>{{first... to moban.output
193+
Slimmed 1 file.
194+
$ cat moban.output
195+
Smith Jones
196+
182197
Handlebars.js template
183198
----------------------------
184199

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
copyright = '2017-2020 Onni Software Ltd.'
2626
author = 'C. W.'
2727
# The short X.Y version
28-
version = '0.7.8'
28+
version = '0.7.9'
2929
# The full version, including alpha/beta/rc tags
30-
release = '0.7.8'
30+
release = '0.7.9'
3131

3232
# -- General configuration ---------------------------------------------------
3333

moban/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.7.8"
1+
__version__ = "0.7.9"
22
__author__ = "C. W."

moban/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
file_system.path_join(".", DEFAULT_TEMPLATE_DIRNAME),
5757
],
5858
# moban.output, default output file name
59-
LABEL_OUTPUT: "%s.output" % PROGRAM_NAME,
59+
LABEL_OUTPUT: "-",
6060
# data.yml, default data input file
6161
LABEL_CONFIG: "data%s" % DEFAULT_YAML_SUFFIX,
6262
LABEL_TEMPLATE_TYPE: DEFAULT_TEMPLATE_TYPE,

moban/externals/buffered_writer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ def __init__(self):
1111
self.fs_list = {}
1212

1313
def write_file_out(self, filename, content):
14-
if file_system.is_zip_alike_url(filename):
14+
if filename == "-":
15+
print(content.decode())
16+
elif file_system.is_zip_alike_url(filename):
1517
self.write_file_out_to_zip(filename, content)
1618
else:
1719
write_file_out(filename, content)

0 commit comments

Comments
 (0)