You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
615 B

from panflute import Div,Span
from util import *
from typing import Callable
class Command:
pass
class InlineCommand(Span, Command):
def call(self, f: Callable) -> Span:
r = f(self)
if "c" in r.attributes:
del r.attributes["c"]
return replaceEl(self, Span(*r.content, identifier=r.identifier, classes=r.classes, attributes=r.attributes))
pass
class MultilineCommand(Div, Command):
def call(self, f: Callable) -> Div:
r = f(self)
if "c" in r.attributes:
del r.attributes["c"]
return replaceEl(self, Div(*r.content, identifier=r.identifier, classes=r.classes, attributes=r.attributes))
pass