Update instrument export command to include more html tags

This commit is contained in:
Ramon Wenger 2023-07-19 12:10:51 +02:00
parent fcc38047b1
commit bb6425c27f
1 changed files with 11 additions and 1 deletions

View File

@ -29,9 +29,19 @@ class Command(BaseCommand):
def handle(self, *args, **options):
# todo: only published after X: Page.last_published_at > X
print("<html><head></head><body>")
print(
"""
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
"""
)
for i in BasicKnowledge.objects.live().filter(slug__in=options["slugs"]):
print(f"<h1>{i.title}</h1>")
print(f"<p>{i.intro}</p>")
for c in i.contents:
action = actions.get(
c.block_type, lambda c: print(f"==={c.block_type}===")