@ -9,6 +9,7 @@ from typing import List
from transform import transform
from transform import transform
from util import *
from util import *
from context import Context
from context import Context
from group import Group
from katex import KatexClient
from katex import KatexClient
from html import html
from html import html
from tex import tex
from tex import tex
@ -16,15 +17,17 @@ from tex import tex
from mj_show import show
from mj_show import show
doc = import_md ( open ( sys . argv [ 1 ] , " r " ) . read ( ) )
doc = import_md ( open ( sys . argv [ 1 ] , " r " ) . read ( ) )
language = doc . get_metadata ( " language " , None , True )
print ( show ( doc ) )
print ( show ( doc ) )
context = Context ( doc , sys . argv [ 1 ] )
context = Context ( doc , sys . argv [ 1 ] )
doc = doc . walk ( transform , context )
doc = doc . walk ( transform , context )
print ( " --------------------- " )
doc . content = [ Group ( * doc . content , metadata = { " language " : language } ) ]
print ( show ( doc ) )
#print("---------------------")
#print(show(doc))
#print(convert_text(doc, input_format="panflute", output_format="markdown"))
#print(convert_text(doc, input_format="panflute", output_format="markdown"))
katexClient = KatexClient ( )
katexClient = KatexClient ( )
#print(katexClient.render("\\def\\Bruh{K^A\\TeX}"))
#print(katexClient.render("\\Bruh"))
open ( " output.html " , " w " ) . write ( " <head> <meta charset= ' utf-8 ' > <link rel= ' stylesheet ' href= ' https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css ' integrity= ' sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0 ' crossorigin= ' anonymous ' > </head> " + html ( doc , katexClient ) )
open ( " output.html " , " w " ) . write ( " <head> <meta charset= ' utf-8 ' > <link rel= ' stylesheet ' href= ' https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css ' integrity= ' sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0 ' crossorigin= ' anonymous ' > </head> " + html ( doc , katexClient ) )
open ( " output.tex " , " w " ) . write ( " \ input formatitko.tex \n " + tex ( doc ) )
open ( " output.tex " , " w " ) . write ( " \ input formatitko.tex \n " + tex ( doc ) )
#print(tex(doc))
#print(tex(doc))