This builds an include stack of files being included. The initial file
being worked on is signalled by an empty value.
Signed-off-by: Miek Gieben <miek@miek.nl>
This parsed (!item) as an index, subitems are allowed as well as making
the index primary (by adding another !: (!!item). The HTML output is
non-existent and there is no go in gomarkdown to render an index (left
to a custom renderer)
Signed-off-by: Miek Gieben <miek@miek.nl>
Allows one to add more head tags, mostly scripts usually, to be included
in the <HEAD> section of the generated HTML. This keeps the doc self
contained.
Signed-off-by: Miek Gieben <miek@miek.nl>
Add ast.Callout node that is detected in test and extra utils to parse
it in codeblock.
See https://mmark.nl/post/syntax/#callouts for what they are.
Signed-off-by: Miek Gieben <miek@miek.nl>
This is the same fix as for #40, but for quote block.
Add bare quote test to testdata/mmark.test as well for this.
Signed-off-by: Miek Gieben <miek@miek.nl>
Add test for code include <{{..}}. And Fix off-by-one error if we
process a code include.
Also set the language if we have a code include.
Signed-off-by: Miek Gieben <miek@miek.nl>
Make the test table driven and fix bugs uncovered by the new test.
Mainly in the area of parsing the optional address specification between
block quotes.
Signed-off-by: Miek Gieben <miek@miek.nl>
Implement the TODO and a method `String()` that returns a string for
AlignmentFlags.
Pondered doing the same for Matters and CitationTypes, but those are
more renderer dependent (and not standard).
Signed-off-by: Miek Gieben <miek@miek.nl>
Also export it, so it can be used directly in mmark/xml/renderer.go (I
had the exact copy of this code there)
Fixes#27
Signed-off-by: Miek Gieben <miek@miek.nl>
If the mmark extension is set and there is no caption we should still
add the block to the AST.
Caught by mmark testing.
Signed-off-by: Miek Gieben <miek@miek.nl>
This adds a IncludesHook that returns the byte to be read. Error
handling is completely left to the client. By default when there is no
includehook we return nil for bytes read.
Signed-off-by: Miek Gieben <miek@miek.nl>