Giter Club home page Giter Club logo

ninja2's Introduction

ninja2

jinja2 command line client v 0.2

Dependencies

Usage

$ ninja2 -h
usage: ninja2 [-h] [-V] (-e | -j | -y) [-l {i18n,do,loopcontrols}] template.j2

read a jinja2 template from file and values from stdin either environment or json or yaml

positional arguments:
  template.j2           File with Jinja2 template

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -e, --env             render from environment
  -j, --json            render from json file
  -y, --yaml            render from yaml file
  -l {i18n,do,loopcontrols}, --load {i18n,do,loopcontrols}
                        load Jinja2 extentions, can be repeated

  (c) 2015 Sascha Spreitzer, MIT License

Render from environment

sspreitzer@s900x3c:~/git/ninja2⟫ cat test.j2 
{{ USER }}
sspreitzer@s900x3c:~/git/ninja2⟫ ./ninja2 -e test.j2 
sspreitzer

Render from json

sspreitzer@s900x3c:~/git/ninja2⟫ cat test.json 
{ "USER": "json-user" }
sspreitzer@s900x3c:~/git/ninja2⟫ ./ninja2 -j test.j2 < test.json
json-user

Render from yaml

Pyyaml must be installed

sspreitzer@s900x3c:~/git/ninja2⟫ cat test.yaml 
---
USER: yaml-user
sspreitzer@s900x3c:~/git/ninja2⟫ ./ninja2 -y test.j2 < test.yaml
yaml-user

Render from environment with all extentions loaded

sspreitzer@s900x3c:~/git/ninja2⟫ cat test.j2 
{{ USER }}
sspreitzer@s900x3c:~/git/ninja2⟫ ./ninja2 -e -l do -l i18n -l loopcontrols test.j2 
sspreitzer

ninja2's People

Contributors

sspreitzer avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

theholm nishedcob

ninja2's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.