packages = ["kithon"] [[fetch]] from = "https://raw.githubusercontent.com/alploskov/kithon/master/translators/latex/core.tp" [[fetch]] from = "https://raw.githubusercontent.com/alploskov/kithon/master/translators/latex/math_symbols.tp" [[fetch]] from = "https://raw.githubusercontent.com/alploskov/kithon/master/translators/latex/macros.tp" [[fetch]] from = "https://raw.githubusercontent.com/alploskov/kithon/master/translators/latex/math_symbols.tp" [[fetch]] from = "https://raw.githubusercontent.com/alploskov/kithon/master/translators/latex/libs/math.tp"
<Kithon>
OUTPUT LANGUAGE:
from kithon import Transpiler latex_tp = Transpiler() latex_tp.load_templs(open('./core.tp', 'r').read()) latex_tp.load_templs(open('./macros.tp', 'r').read()) latex_tp.load_templs(open('./math_symbols.tp', 'r').read()) latex_tp.load_templs(open('./math.tp', 'r').read()) transpilers = { "js": Transpiler(lang="js"), "go": Transpiler(lang="go"), "lua": Transpiler(lang="lua"), "latex": latex_tp, } def gen(lang, code): return transpilers[lang].generate(code)