This commit is contained in:
Florian Schroedl
2022-05-04 17:00:00 +02:00
parent 4b59ac3727
commit 2717984b6c

View File

@@ -154,24 +154,26 @@ func pprint*(x: OrgDocument, indent = 0): string =
fields, fields,
) )
## OrgDocument.PrettyPrinters ## OrgDocument.PrettyPrinters
func `$`*(xs: OrgDocument): string = pprint(xs) func `$`*(xs: OrgDocument): string = pprint(xs)
when isMainModule: when isMainModule:
echo OrgDocument( let doc = OrgDocument(
children: @[ children: @[
OrgBlock( OrgBlock(
kind: orgHeading, kind: orgHeading,
children: @[ children: @[
OrgInlineBlock( OrgInlineBlock(
kind: orgLink, kind: orgLink,
linkUrl: "Foo", linkUrl: "https://placeholder.com",
linkDescription: "Bar".just(), linkDescription: "Placeholder".just(),
), ),
], ],
), ),
OrgBlock(kind: orgHeading), OrgBlock(kind: orgHeading, level: 1),
OrgBlock(kind: orgHeading), OrgBlock(kind: orgHeading),
] ]
) )