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.
19 lines
513 B
19 lines
513 B
2 years ago
|
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)
|
||
|
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)
|
||
|
return replaceEl(self, Div(*r.content, identifier=r.identifier, classes=r.classes, attributes=r.attributes))
|
||
|
pass
|