From 5090e35131320d1603a0dd022103ccb454783593 Mon Sep 17 00:00:00 2001 From: Lancasterwu Date: Mon, 9 Mar 2020 17:54:32 -0400 Subject: [PATCH 01/10] update index, add sidebar option --- index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/index.rst b/index.rst index 96d1ebba..89af23b6 100644 --- a/index.rst +++ b/index.rst @@ -34,6 +34,7 @@ Welcome to the coala documentation! Adding coala as a Git Hook Shell Autocompletion coala as a Docker Image + What is Moban? MAC Hints How To Get In Touch With Us Frequently Asked Questions From b9ce174053bb4d63651e8e07f414fcf6854579df Mon Sep 17 00:00:00 2001 From: Lancasterwu Date: Mon, 9 Mar 2020 17:54:49 -0400 Subject: [PATCH 02/10] update basic description of the moban page --- Users/Moban.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Users/Moban.rst diff --git a/Users/Moban.rst b/Users/Moban.rst new file mode 100644 index 00000000..327109d8 --- /dev/null +++ b/Users/Moban.rst @@ -0,0 +1,34 @@ +What is Moban? +==================== + +Description +----------------- + +Moban is an open source general purpose static text generator , which can use +other python template engine: mako, handlebars, velocity, haml, slim and +tornado, can read other data format: json and yaml, and can access both template +file and configuration file in any location: zip, git, pypi package, s3, etc. +It is used in coala project to keep documentation consistent across the +documentations of individual libraries in the same organisation. You can find +more documentation on `MobanDocumentation https://moban.readthedocs.io/en/latest/`__ + +Install ``moban``: + +:: + + $ pip install moban + +CLI arguments: + +:: + + moban [-h] [-c CONFIGURATION] [-t TEMPLATE] [-o OUTPUT] [-td [TEMPLATE_DIR [TEMPLATE_DIR ...]]] + [-cd CONFIGURATION_DIR] [-m MOBANFILE] [-g GROUP] [--template-type TEMPLATE_TYPE] + [-d DEFINE [DEFINE ...]] [-e EXTENSION [EXTENSION ...]] [-f][--exit-code] + [-V] [-v][template] + +Sample usage: + +:: + + mohan -c [input file(JSON, YAML)] -t [template file] -o [outputfile] From 23ad055191a01ea57cfe7f0689f202f3db78974c Mon Sep 17 00:00:00 2001 From: Lancasterwu Date: Mon, 9 Mar 2020 18:01:43 -0400 Subject: [PATCH 03/10] finished an outline for documentation --- Users/Moban.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Users/Moban.rst b/Users/Moban.rst index 327109d8..5812b4fe 100644 --- a/Users/Moban.rst +++ b/Users/Moban.rst @@ -32,3 +32,21 @@ Sample usage: :: mohan -c [input file(JSON, YAML)] -t [template file] -o [outputfile] + +Moban statically generates text based on an input file and an given template, which +can be used to modify all configuration files of an entire repository. + +Moban Structure +----------------- + +Cathlin's section + +Moban Key Features +----------------- + +(based on test cases) Christopher's section + +Why Moban, and How? +----------------- + +After Jon's discovery From 027b9d3486b188bc3b18b2bbc49a153362d609c6 Mon Sep 17 00:00:00 2001 From: Lancaster Wu Date: Mon, 9 Mar 2020 18:13:39 -0400 Subject: [PATCH 04/10] Update Moban.rst --- Users/Moban.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Users/Moban.rst b/Users/Moban.rst index 5812b4fe..60908dd6 100644 --- a/Users/Moban.rst +++ b/Users/Moban.rst @@ -10,7 +10,7 @@ tornado, can read other data format: json and yaml, and can access both template file and configuration file in any location: zip, git, pypi package, s3, etc. It is used in coala project to keep documentation consistent across the documentations of individual libraries in the same organisation. You can find -more documentation on `MobanDocumentation https://moban.readthedocs.io/en/latest/`__ +more documentation on `Moban Documentation `_. Install ``moban``: From 1e9f79eb7536c898a41f71ceee3cb282685b21f8 Mon Sep 17 00:00:00 2001 From: Lancaster Wu Date: Mon, 9 Mar 2020 18:14:02 -0400 Subject: [PATCH 05/10] Update Moban.rst --- Users/Moban.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Users/Moban.rst b/Users/Moban.rst index 60908dd6..6d133bc3 100644 --- a/Users/Moban.rst +++ b/Users/Moban.rst @@ -10,7 +10,7 @@ tornado, can read other data format: json and yaml, and can access both template file and configuration file in any location: zip, git, pypi package, s3, etc. It is used in coala project to keep documentation consistent across the documentations of individual libraries in the same organisation. You can find -more documentation on `Moban Documentation `_. +more detailed documentation on `Moban Documentation `_. Install ``moban``: From 6ccbe5e45a66b6fe6fb49d74c80f119588bf4bc7 Mon Sep 17 00:00:00 2001 From: Cathlin Lord Date: Wed, 11 Mar 2020 12:14:10 -0400 Subject: [PATCH 06/10] Structure of Moban --- Users/Moban.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Users/Moban.rst b/Users/Moban.rst index 6d133bc3..28c82253 100644 --- a/Users/Moban.rst +++ b/Users/Moban.rst @@ -39,7 +39,13 @@ can be used to modify all configuration files of an entire repository. Moban Structure ----------------- -Cathlin's section +- Moban reads a yaml file (data.yml), this is then rendered into a jinja template +file (jinja files are found within the moban template folder). A “moban.output” +file is then created. +- The template inherits the .jj2 file, which is located in moban.td. +- To use a user defined template, it can be entered within moban.yml. +Moban > moban.cd > moban.yml > template file = base.jj2 (in moban > templates) + Moban Key Features ----------------- From 2b186f5ab90b18a8a5b2fb54a088c85bbf1d4379 Mon Sep 17 00:00:00 2001 From: Cathlin Lord Date: Wed, 11 Mar 2020 12:16:35 -0400 Subject: [PATCH 07/10] Structure of Moban --- Users/Moban.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Users/Moban.rst b/Users/Moban.rst index 28c82253..f22be183 100644 --- a/Users/Moban.rst +++ b/Users/Moban.rst @@ -42,8 +42,10 @@ Moban Structure - Moban reads a yaml file (data.yml), this is then rendered into a jinja template file (jinja files are found within the moban template folder). A “moban.output” file is then created. + - The template inherits the .jj2 file, which is located in moban.td. -- To use a user defined template, it can be entered within moban.yml. + +- To use a user defined template, it can be entered within moban.yml. Moban > moban.cd > moban.yml > template file = base.jj2 (in moban > templates) From 52bc667b25365dcb7bad0bfb02e883e8ca2bb23a Mon Sep 17 00:00:00 2001 From: Christopher Stephenson Date: Wed, 11 Mar 2020 16:16:39 -0400 Subject: [PATCH 08/10] Add testing documentation in Moban.rst --- Users/Moban.rst | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Users/Moban.rst b/Users/Moban.rst index f22be183..354804bc 100644 --- a/Users/Moban.rst +++ b/Users/Moban.rst @@ -52,7 +52,38 @@ Moban > moban.cd > moban.yml > template file = base.jj2 (in moban > templates) Moban Key Features ----------------- -(based on test cases) Christopher's section +The layout of Moban’s test environment closely matches the layout of the actual +repository structure. This consistency helps to ensure that each file in the +source code has a corresponding test file. Additionally, if any test cases need +to be modified for any reason, they will be easy to locate due to the similar +file structure. + +File structure of the tests directory: + +tests +|_____core +|_____data_loaders +|_____deprecated +|_____fixtures +|_____integration_tests +|_____jinja2 +|_____mobanfile +|_____regression_tests + +The core folder includes tests related to context.py, engine, and moban_factory.py. +These tests ensure that the environment variables in context are initialized +correctly, that the jinja2 engine object that Moban creates functions properly, +and that all of the moban_factory functions correctly find the files that are +needed, whether it be templates or actual yml files. + +The data_loaders folder checks that the json_loader, the dictionary merge +function, and the yaml_loader all successfully perform their tasks, while +test_overrides ensures that all overridden functions also work. + +The fixtures folder contains testing files that are only created on initial run +of the test cases such that the test files are not stored in the production build +of moban. + Why Moban, and How? ----------------- From e39a9a6ec48767ebffc51097d406d7573af97501 Mon Sep 17 00:00:00 2001 From: Jon Reibel <31478921+reibelj@users.noreply.github.com> Date: Thu, 12 Mar 2020 12:34:35 -0400 Subject: [PATCH 09/10] Explaining connections to Coala --- Users/Moban.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Users/Moban.rst b/Users/Moban.rst index 354804bc..dea46603 100644 --- a/Users/Moban.rst +++ b/Users/Moban.rst @@ -87,5 +87,4 @@ of moban. Why Moban, and How? ----------------- - -After Jon's discovery +Moban is used as a dependency within Coala. The main purpose and functionality of Moban within Coala is the modification of configuration files within the repository. Specifically, it works within the configuration file in which text is statically generated based on a template and converted into another file type to be used for further configuration and integration. In the case of Coala, Moban is ran on the travis.yml file. The text is statically generated and rendered into a jinja template. This template is stored within the template directory of Moban. A new file "Moban.out" is created and sent to a new .jj2 file and then stored within the the Moban.dt directory. It appears that the functions within travis.yml are created into separate .jj2 files and passed into the new configuration file. From this directory, the created files are then called by the moban.yml file in order to act as another level of configuration and integration for the tool. This integration can run varying checks compared to the Travis CI build allowing for a more robust integration sequence. Taking this into account, there are no impacts or changes made to the run process of Coala including; input, output, and user interaction. The tool has the ability to run without usage of Moban. Knowing this it may be wondered as to why it is being used. From the outside it appears confusing and irrelevant, but taking what is known and understanding the connections between the tools is helpful. The Moban tool is simply being utilized to provide another layer of configuration and integration to Coala. The final reasoning on why it is used this way is left to the developers and contributors to explain. From a3fce56ef8ef889fab28c6a4b2b6abaec583ccbd Mon Sep 17 00:00:00 2001 From: Lancaster Wu Date: Thu, 12 Mar 2020 13:24:23 -0400 Subject: [PATCH 10/10] Fixed an error of displaying structure --- Users/Moban.rst | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Users/Moban.rst b/Users/Moban.rst index dea46603..daf672ae 100644 --- a/Users/Moban.rst +++ b/Users/Moban.rst @@ -60,15 +60,17 @@ file structure. File structure of the tests directory: -tests -|_____core -|_____data_loaders -|_____deprecated -|_____fixtures -|_____integration_tests -|_____jinja2 -|_____mobanfile -|_____regression_tests +:: + + tests + |_____core + |_____data_loaders + |_____deprecated + |_____fixtures + |_____integration_tests + |_____jinja2 + |_____mobanfile + |_____regression_tests The core folder includes tests related to context.py, engine, and moban_factory.py. These tests ensure that the environment variables in context are initialized