Skip to content

It is wandbox addtional of kamidana of jinja2 cli

License

Notifications You must be signed in to change notification settings

srz-zumix/amaterasu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

amaterasu

PyPI version Python Versions Codacy Badge Language grade: Python GitHub Actions

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
* cpython-3*
  * cpython-3.10.2
  * cpython-3.9.3
  * cpython-3.8.9
  * cpython-3.7.10
  * cpython-3.6.12

sample/wandbox.j2

* cpython-3*
{%- set compilers = wandbox_list() | wandbox_fnmatch_compilers("cpython-3*") %}
{%- 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 compilers = wandbox_list() | wandbox_fnmatch_compilers("cpython-3*") %}
{%- set compiler = compilers[0].name %}
{%- 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
* cpython-3*
  * cpython-3.10.2
  * cpython-3.9.3
  * cpython-3.8.9
  * cpython-3.7.10
  * cpython-3.6.12

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

utils.py

  • markdown_link_pair
  • urlencode
  • url_quote
  • url_quote_plus
  • replace_url_quote

About

It is wandbox addtional of kamidana of jinja2 cli

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published