Skip to main content

Simplate template rensder usesd jinja2

Project description

pyrender

jinja2を使った簡単なテンプレートレンダー パッケージングの練習に利用

$ renderj2 --help
Usage: renderj2 [OPTIONS] TEMPLATE_FILE

  Rendre Jinja2 tempalte

Options:
  -v, --varsfile PATH  vars file path for jinja2
  -o, --output PATH    output file
  --loglevel LVL       Either CRITICAL, ERROR, WARNING, INFO or DEBUG
                       [default: INFO]
  -h, --help           Show this message and exit.
  -V, --version        Show the version and exit.

使い方

# renderj2 --vars vars.yml template.j2

上記のように実行すると、Jinja2の形式で書かれたtempalte.j2vars.ymlの変数を用いてレンダリングします。

レンダリング結果はデフォルトで標準出力に出力されます。 --output オプションを指定することで指定のファイルに出力することも可能です。

Jinja2公式ドキュメント

開発

Require

  • python3
  • Poetry

テスト

$ poetry poe test

ビルド

$ poetry build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

renderj2-1.2.2.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

renderj2-1.2.2-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page