Wandbox API Jinja2 template cli.
Project description
amaterasu
It is wandbox additional of kamidana of jinja2 cli
amaterasu cli is kamidana wrapper, Adds additional option automatically.
Usage
List Example
$ pip install amaterasu-j2
$ amaterasu sample/wandbox.j2
* clang-3*c
* clang-3.9.1-c
* clang-3.8.1-c
* clang-3.7.1-c
* clang-3.6.0-c
* clang-3.5.0-c
* clang-3.4-c
* clang-3.3-c
* clang-3.2-c
* clang-3.1-c
sample/wandbox.j2
* clang-3*c
{%- set compilers = wandbox_list() | wandbox_fnmatch_compilers("*clang-3*c") %}
{%- for compiler in compilers %}
* {{ compiler.name }}
{%- endfor %}
Compile Example
$ pip install amaterasu-j2
$ amaterasu sample/wandbox-run.j2
```
# This file is a "Hello, world!" in Python language by CPython for wandbox.
import sys
print("Hello, world!")
if len(sys.argv) > 1:
print(sys.argv[1])
# CPython references:
# https://www.python.org/
```
```
Hello, world!
```
```
Hello, world!
Test
```
sample/wandbox-run.j2
{%- set compiler = "cpython-3.8.0" %}
{%- set src = fread("sample/main.py") %}
```
{{ src }}
```
```
{{ wandbox_run(compiler, src).program_message }}
```
```
{{ wandbox_run(compiler, src, runtime_option="Test").program_message }}
```
Use kamidana
$ pip install amaterasu-j2
$ kamidana -a=amaterasu.amaterasu sample/wandbox.j2
* clang-3*c
* clang-3.9.1-c
* clang-3.8.1-c
* clang-3.7.1-c
* clang-3.6.0-c
* clang-3.5.0-c
* clang-3.4-c
* clang-3.3-c
* clang-3.2-c
* clang-3.1-c
Features
Global
name | usage | detail |
---|---|---|
wandbox_list | {{ wandbox_list() }} | return wandbox compilers list json |
wandbox_languages | {{ wandbox_languages() }} | return wandbox language list array |
wandbox_run | {{ wandbox_run(compiler, src, [options], [compier_option], [runtime_option] ) }} | return wandbox compile result |
Filter
name | usage | detail |
---|---|---|
wandbox_fnmatch_compilers | {{ wandbox_list() | wandbox_fnmatch_compilers("clang-3*c") }} | filter compiler name by fnmatch |
wandbox_language_compilers | {{ wandbox_list() | wandbox_language_compilers("C++") }} | filter by language |
Utilities
- markdown_link_pair
- urlencode
- url_quote
- url_quote_plus
- replace_url_quote
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
amaterasu-j2-0.2.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for amaterasu_j2-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0886613838c7c98ffcbd39a36e8cfc0eeee37f30bde5f7e2147384d40db6caf |
|
MD5 | 1b49e7e059cb926688ade83c38f00a1c |
|
BLAKE2b-256 | 6a662e49547121f9a8d9b20f5045f0ebc1ab64c942371abf3a40c77574ef2791 |