Update the README with table footer syntax: fixes#77
Update the README and just point to mmark.nl instead of listing
all mmark syntax elements (again).
Fix multiple classes in headers.
Make header.Special a bool and rename it it IsSpecial.
Signed-off-by: Miek Gieben <miek@miek.nl>
This takes the syntax from kramdown: https://kramdown.gettalong.org/syntax.html#tables
Rename tableHead to tableHeader, and use tableFooter for consistency.
It's not guarded by any parser extension, except parser.Tables
Signed-off-by: Miek Gieben <miek@miek.nl>
You can't make up you're own attributes, give special header the class
"special". Adjust all testcases.
<hr>: support block level attributes.
Add more tests for block level attributes.
Fix figure attributes, by re-adding the attribute to the inner block
(table, quote or code block).
Fixes#7
Signed-off-by: Miek Gieben <miek@miek.nl>
Make these look like each other for consistency.
Citation can contain links use them to link to the bibliography.
Signed-off-by: Miek Gieben <miek@miek.nl>
To allow linking to indices by giving them an ID; without it an index
can not refer back to the actual index item from main index at the end
of the document.
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>
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>
This adds Mmark support for captions under quotes block or fenced code
blocks. This can be used by adding: `Caption: <text>` under the block.
All text up to the next empty line is read.
This adds ast.Caption, which is a noop in the html/renderer because the
elements need to walk this node outside of the main ast. The node can
only hold span elements (p.inline()).
Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
Implement document divisions
front/main/back-matter. There is no html equivalent of these.
Signed-off-by: Miek Gieben <miek@miek.nl>
This implements asides, blockquote like paragraph prexifed with `A>`
instead of just a '>'
Adds the extension MmarkAsides
Signed-off-by: Miek Gieben <miek@miek.nl>
This adds detection for headers that start with `.#`. It adds the Mmark
extension, update the mmar test, adds some documentation.
I'm reusing the ast.Heading to have a maximum amount of code re-use.
Signed-off-by: Miek Gieben <miek@miek.nl>
This keeps track of the starting number of an ordered list and uses it
when not zero. Fails the tests so it will probably have to wait until
we have the Mmark extension merged.
Signed-off-by: Miek Gieben <miek@miek.nl>
This adds the possibility to add block level attributes:
{#id2}
> line
When enabled to will generate (for HTML) an id="id2" in the openening
tag of the block quote:
<blockquote id="id2">
<p>line</p>
</blockquote>
Only one block level attribute is allowed, if multiple are given only
the last one seen is applied, the rest is silently ignored.
The attributes are stored in *Parser and copied to the node in addBlock.
It's up to the renderer to use the attributes, the html renderer
currently applies them to most block level elements.
Signed-off-by: Miek Gieben <miek@miek.nl>