Commit Graph

29 Commits

Author SHA1 Message Date
Miek Gieben d69570cae4 .... and the test
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-20 16:41:42 +02:00
Miek Gieben 34e94474d8 Fix special section
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>
2018-08-18 11:27:17 +02:00
Miek Gieben ca40bfdc13 Actually add test case
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-18 09:28:25 +02:00
Miek Gieben 2ba4a94330 Multiple fixes
Caption: fix Table caption, fix testdata as well.
Asides: allow them to have content. Add test for it.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-18 09:08:06 +02:00
Miek Gieben b16b8aba0b
Merge branch 'master' into table-caption 2018-08-18 08:38:38 +02:00
Miek Gieben 194620086f Drop "Caption: " in favor of specific caption triggers
This syntax was actually stolen from Pandoc, where it is used for
Tables (will update that, once those PRs are in). So leave the original
(from mmark1) syntax makes sense.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-17 18:48:55 +02:00
Miek Gieben 665d356b2f Cross reference: prepend '#'
The link is local (by definition) add '#' to mark it as such.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-17 16:41:25 +02:00
Miek Gieben ad60f85428 caption: add table captions
Some "advanced" switching to get the table to be the child of the
figurecaption.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-17 09:44:06 +02:00
Miek Gieben 079fa8b67b Make index ref look like footnote ref
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>
2018-08-17 08:57:17 +02:00
Miek Gieben 05727bd972 Change markers
The current markers clash with the table syntax.
Change to '+++'

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-16 18:19:28 +02:00
Miek Gieben 26c06b95cd index: use idx-N for the ID
Make the ID generation more specific to the index.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-16 17:45:43 +02:00
Miek Gieben a4a196b482 Add uniq ID to indices
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>
2018-08-15 16:32:06 +02:00
Miek Gieben 55ca3c7e06
Merge pull request #60 from mmarkdown/whitespacehack
Mark tests: remove whitespace hack
2018-08-15 15:21:49 +01:00
Miek Gieben cb658cd24f Mark tests: remove whitespace hack
Doesn't add anything and actually created testcases that were wrong.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-15 16:06:25 +02:00
Miek Gieben b360c9efea parser: cross ref: fix
Fix the parsing and add a testcase in testdata/mmark.test

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-15 16:03:59 +02:00
Miek Gieben 699609b6d8 parser: allow indices
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>
2018-08-13 19:21:00 +02:00
Miek Gieben 0d628773de Add quote block even without caption
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>
2018-08-09 16:57:32 +01:00
Miek Gieben 31666d246c Add test
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-06 23:32:08 +01:00
Miek Gieben f58a6fbfa8 fix test
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-03 17:58:50 +01:00
Miek Gieben 6f77bf5ca9 Add citationss
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-03 17:13:36 +01:00
Miek Gieben 864377cdbf More citations
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-03 14:27:02 +01:00
Miek Gieben 1c84e4fb3c Make captions not suck
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-02 09:41:49 +00:00
Miek Gieben 4c3e11dbb9 Fix code block captions
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-02 09:28:41 +00:00
Miek Gieben 77587eb931 Support captions
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>
2018-08-01 19:21:35 +01:00
Miek Gieben 055b0aac3f Add document divisions
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>
2018-08-01 13:46:33 +00:00
Miek Gieben f45815586d Mmark: add SpecialHeading
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>
2018-07-30 22:09:19 +01:00
Miek Gieben d98668d608 Add mmark test
All tests are contained in testdata/mmark.test. Currrently one simple
test is included there.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-30 09:50:50 +01:00
Vytautas Šaltenis 120bb2fae1 Get rid of the preprocess stage
Yay!!
2016-11-10 21:49:58 +02:00
Dmitry Chestnykh 29c5b49e95 Rename upskirtref to testdata; upskirtref_test.go to ref_test.go. 2015-03-24 06:28:49 +01:00