Skip to content

Commit c2c1c2d

Browse files
authored
Merge pull request #375 from moremoban/dev
release 0.7.2 - use templates over internet
2 parents d1c6baf + a1a43ba commit c2c1c2d

File tree

23 files changed

+221
-60
lines changed

23 files changed

+221
-60
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: Added
6+
details:
7+
- "Support for templates and configuration files over HTTP(S) protocol with httpfs! Yepee!"
8+
date: 1.5.2020
9+
version: 0.7.2
410
- changes:
511
- action: Fixed
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.1
8-
current_version: 0.7.1
9-
release: 0.7.1
7+
version: 0.7.2
8+
current_version: 0.7.2
9+
release: 0.7.2
1010
branch: master
1111
master: index
1212
command_line_interface: "moban"

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.2 - 1.5.2020
5+
--------------------------------------------------------------------------------
6+
7+
**Added**
8+
9+
#. Support for templates and configuration files over HTTP(S) protocol with
10+
httpfs! Yepee!
11+
412
0.7.1 - 25.04.2020
513
--------------------------------------------------------------------------------
614

README.rst

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,26 @@ Introduction
4141
================================================================================
4242

4343
**moban** started with bringing the high performance template engine (JINJA2) for web
44-
into static text generation. It has been used in `pyexcel` and `coala` project to keep
45-
documentation consistent across the documentations of individual libraries in the same
46-
organisation.
44+
into static text generation.
4745

4846
**moban** can use other python template engine: mako, handlebars, velocity,
4947
haml, slim and tornado, can read other data format: json and yaml, and can access both
5048
template file and configuration file in
5149
any location: zip, git, pypi package, s3, etc.
5250

51+
52+
It has been used in `pyexcel <https://github.com/pyexcel/pyexcel>`_ and
53+
`coala <https://github.com//coala/coala>`_ project to keep
54+
documentation consistent across the documentations of individual libraries in the same
55+
organisation.
56+
57+
And here is a list of other usages:
58+
59+
1. `Django Mobans <https://github.com/django-mobans>`_, templates for django, docker etc.
60+
1. `Math Sheets <https://github.com/chfw/math-sheets>`_, generate custom math sheets
61+
in pdf
62+
63+
5364
Vision
5465
================================================================================
5566

@@ -58,7 +69,7 @@ Any template, any data in any location
5869
Support
5970
================================================================================
6071

61-
If you like moban, please support me on `github <https://github.com/sponsors/chfw>`_,
72+
If you like moban, please support me on,
6273
`patreon <https://www.patreon.com/bePatron?u=5537627>`_
6374
or `bounty source <https://salt.bountysource.com/teams/chfw-pyexcel>`_ to maintain
6475
the project and develop it further.
@@ -69,7 +80,7 @@ a little bit more time in coding, documentation and writing interesting extensio
6980
Credit
7081
================================================================================
7182

72-
`jinja2-fsloader` is the key component to enable PyFilesystem2 support in moban
83+
`jinja2-fsloader <https://github.com/althonos/jinja2-fsloader>`_ is the key component to enable PyFilesystem2 support in moban
7384
v0.6x. Please show your stars there too!
7485

7586
Installation
@@ -150,7 +161,23 @@ Moban in live action:
150161
All use cases are documented `here <http://moban.readthedocs.org/en/latest/#tutorial>`_
151162

152163

153-
Work with files in a git repo
164+
Templates and configuration files over HTTP(S)
165+
================================================================================
166+
167+
`httpfs <https://github.com/moremoban/httpfs>`_ should be installed first.
168+
169+
.. code-block:: bash
170+
171+
$ moban -t 'https://raw.githubusercontent.com/moremoban/pypi-mobans/dev/templates/_version.py.jj2'\
172+
-c 'https://raw.githubusercontent.com/moremoban/pypi-mobans/dev/config/data.yml'\
173+
-o _version.py
174+
175+
176+
In an edge case, if github repo's public url is given,
177+
this github repo shall not have sub repos. This library will fail to
178+
translate sub-repo as url. No magic.
179+
180+
Templates and configuration files in a git repo
154181
================================================================================
155182

156183
`gitfs2 <https://github.com/moremoban/gitfs2>`_ is optional since v0.7.0 but was
@@ -172,7 +199,7 @@ You can do the following with moban:
172199
__author__ = "C.W."
173200
174201
175-
Work with files in a python package
202+
Templates and configuration files in a python package
176203
================================================================================
177204

178205
`pypifs <https://github.com/moremoban/pypifs>`_ is optional since v0.7.0 but

docs/README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This section covers the use cases for moban. Please check them out individually.
2626
#. `Template copying from a zip to a zip`_
2727
#. `Intermeidate targets`_
2828
#. `Mobanfile inheritance`_
29+
#. `Files over http(s)`_
2930

3031
.. _Jinja2 command line: level-1-jinja2-cli
3132
.. _Template inheritance: level-2-template-inheritance
@@ -50,4 +51,4 @@ This section covers the use cases for moban. Please check them out individually.
5051
.. _Template copying from a zip to a zip: level-21-copy-templates-into-an-alien-file-system
5152
.. _Intermeidate targets: level-22-intermediate-targets
5253
.. _Mobanfile inheritance: level-23-inherit-organisational-moban-file
53-
54+
.. _Files over http(s): level-24-files-over-http

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.1'
28+
version = '0.7.2'
2929
# The full version, including alpha/beta/rc tags
30-
release = '0.7.1'
30+
release = '0.7.2'
3131

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

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ examples folder.
3838
level-21-copy-templates-into-an-alien-file-system/README.rst
3939
level-22-intermediate-targets/README.rst
4040
level-23-inherit-organisational-moban-file/README.rst
41+
level-24-files-over-http/README.rst
4142

4243

4344
For more complex use case, please look at `its usage in pyexcel project <http://pyexcel.readthedocs.io/en/latest/guide.html>`_
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
configuration:
2+
template_dir:
3+
- "https://raw.githubusercontent.com/moremoban/pypi-mobans/dev/templates/"
4+
- local
5+
configuration: config.yml
6+
configuration_dir: >-
7+
https://raw.githubusercontent.com/moremoban/pypi-mobans/dev/config/
8+
targets:
9+
- mytravis.yml: travis.yml.jj2
10+
- test.txt: demo.txt.jj2
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
level 24: templates and configuration files over http(s)
2+
================================================================================
3+
4+
.. note::
5+
6+
You will need to install httpfs
7+
8+
Why not to take a template off the web? Once a template is written somewhere
9+
by somebody, as long as it is good and useful, it is always to reuse it,
10+
isn't it? DRY principle kicks in.
11+
12+
Now with mobanfile, it is possible to package up your mobans/templates and
13+
configuration files from a HTTP(S) protocol.
14+
15+
16+
Here are the sample file::
17+
18+
configuration:
19+
template_dir:
20+
- "https://raw.githubusercontent.com/moremoban/pypi-mobans/dev/templates/"
21+
- local
22+
configuration: config.yml
23+
configuration_dir: "https://raw.githubusercontent.com/moremoban/pypi-mobans/dev/config/"
24+
targets:
25+
- mytravis.yml: travis.yml.jj2
26+
- test.txt: demo.txt.jj2
27+
28+
When you refer to it in configuration section, here is the syntax::
29+
30+
configuration:
31+
template_dir:
32+
- "https://raw.githubusercontent.com/moremoban/pypi-mobans/dev/templates/"
33+
34+
.. warn::
35+
36+
The trailing '/' must be there.
37+
38+
39+
Maintenance note
40+
--------------------------------------------------------------------------------
41+
42+
To the maintainer, in order to eat the dog food. Please checkout pypi-mobans
43+
and run a http server inside local pypi-mobans folder.
44+
45+
Then update moban's mobanfile to::
46+
47+
configuration:
48+
template_dir:
49+
- "http://localhost:8000/templates/"
50+
- "http://localhost:8000/statics/"
51+
- ".moban.d"
52+
53+
Then run `make update`
54+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
overrides: data.yml
2+
level24: "files over http protocol"

0 commit comments

Comments
 (0)