Skip to content
Snippets Groups Projects
Commit d3b0945a authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

prace: box -> LineMarkup

parent e139356c
No related branches found
No related tags found
No related merge requests found
import panflute as pf
from formatitko.command_env import parse_string
from formatitko.elements import Slanted
from formatitko.elements import Slanted, FLineMarkup
formatitko_commands={}
def formatitko_command(f):
......@@ -45,6 +45,14 @@ def box(element, context, processor):
'lemma': "Lemma",
'def': "Definice",
}[element.attributes["t"]]
color = {
'fact': "red",
'task': "orange",
'algo': "brown",
'theorem': "green",
'lemma': "lightgreen",
'def': "blue",
}.get(element.attributes["t"], "black")
out = []
intro = []
if 'name' in element.attributes:
......@@ -56,12 +64,12 @@ def box(element, context, processor):
for e in content:
if not out:
if isinstance(e, pf.Para):
out.append(pf.Para(intro, Slanted(*e.content)))
out.append(pf.Para(intro, *e.content))
else:
raise NotImplemented()
else:
out += make_emph(e, wrap_class=Slanted)
return out
out.append(e)
return [FLineMarkup(*out, color=color)]
@formatitko_command
def proof(element, context, processor):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment