Beispiel #1
0
from prestring import Module

sm = Module()
with sm.scope():
    sm.stmt("- foo")
    sm.stmt("- bar")
    sm.stmt("- boo")

m = Module()
m.stmt("// start")
with m.scope():
    m.stmt("itemize")
    m.submodule(sm, newline=False)
m.stmt("// end")
print(m)
Beispiel #2
0
from prestring import Module

m = Module()
m.stmt("// start")
with m.scope():
    m.stmt("itemize")
    sm = m.submodule("")
m.stmt("// end")

with sm.scope():
    sm.stmt("- foo")
    sm.stmt("- bar")
    sm.stmt("- boo")

print(m)