git.iko.soy/typeable/pandoc
on master help sign in
Implement footnotes in dokuwiki writer (#386)
commitb14b2d6a85267cee3649048bb761a48cc0ab30be authorclaremacrae <github@cfmacrae.fastmail.co.uk> dateSun 28 Jul 2013, 19:19 (13 years ago) parentb5f86a6
2 files changed+10−12
src/Text/Pandoc/Writers/DokuWiki.hs+3−3 tests/writer.dokuwiki+7−9
src/Text/Pandoc/Writers/DokuWiki.hs+3−3
@@ -38,7 +38,6 @@ DokuWiki: <https://www.dokuwiki.org/dokuwiki>
3838 [ ] Don't generate <div>
3939 [ ] Implement conversion of tables
4040 [ ] Implement comments
41− [ ] Implement footnotes
4241 [ ] Work through the Dokuwiki spec, and check I've not missed anything out
4342 [ ] Test the output in Dokuwiki - and compare against the display of another format, e.g. HTML
4443 [ ] Remove dud/duplicate code
@@ -77,7 +76,8 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
7776 body <- blockListToDokuWiki opts blocks
7877 notesExist <- get >>= return . stNotes
7978 let notes = if notesExist
80− then "\n<references />"
79+ then "" -- TODO Was "\n<references />" Check whether I can really remove this:
80+ -- if it is definitely to do with footnotes, can remove this whole bit
8181 else ""
8282 let main = body ++ notes
8383 let context = defField "body" main
@@ -438,5 +438,5 @@ inlineToDokuWiki opts (Image alt (source, tit)) = do
438438inlineToDokuWiki opts (Note contents) = do
439439 contents' <- blockListToDokuWiki opts contents
440440 modify (\s -> s { stNotes = True })
441− return $ "<ref>" ++ contents' ++ "</ref>"
441+ return $ "((" ++ contents' ++ "))"
442442 -- note - may not work for notes with multiple blocks
tests/writer.dokuwiki+7−9
@@ -634,21 +634,19 @@ Here is a movie {{:movie.jpg|movie}} icon.
634634
635635====== Footnotes ======
636636
637−Here is a footnote reference,<ref>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
638−</ref> and another.<ref>Here’s the long note. This one contains multiple blocks.
637+Here is a footnote reference,((Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
638+)) and another.((Here’s the long note. This one contains multiple blocks.
639639
640640Subsequent blocks are indented to show that they belong to the footnote (as with list items).
641641
642642<pre> { &lt;code&gt; }</pre>
643643If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
644−</ref> This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note.<ref>This is //easier// to type. Inline notes may contain [[http://google.com|links]] and <code>]</code> verbatim characters, as well as [bracketed text].
645−</ref>
644+)) This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note.((This is //easier// to type. Inline notes may contain [[http://google.com|links]] and <code>]</code> verbatim characters, as well as [bracketed text].
645+))
646646
647−<blockquote>Notes can go in quotes.<ref>In quote.
648−</ref>
647+<blockquote>Notes can go in quotes.((In quote.
648+))
649649</blockquote>
650− - And in list items.<ref>In list.</ref>
650+ - And in list items.((In list.))
651651
652652This paragraph should not be part of the note, as it is not indented.
653−
654−<references />