From 16e5b15cae3c96c185c6be64a5f7256e402067df Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Wed, 17 Mar 2010 06:53:43 +0000 Subject: Docbook writer: support images as figures. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1897 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Writers/Docbook.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index 63647e3aa..fc97ed3ac 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -124,6 +124,14 @@ blockToDocbook :: WriterOptions -> Block -> Doc blockToDocbook _ Null = empty blockToDocbook _ (Header _ _) = empty -- should not occur after hierarchicalize blockToDocbook opts (Plain lst) = wrap opts lst +blockToDocbook opts (Para [Image txt (src,_)]) = + let capt = inlinesToDocbook opts txt + in inTagsIndented "figure" $ + inTagsSimple "title" capt $$ + (inTagsIndented "mediaobject" $ + (inTagsIndented "imageobject" + (selfClosingTag "imagedata" [("fileref",src)])) $$ + inTagsSimple "textobject" (inTagsSimple "phrase" capt)) blockToDocbook opts (Para lst) = inTagsIndented "para" $ wrap opts lst blockToDocbook opts (BlockQuote blocks) = inTagsIndented "blockquote" $ blocksToDocbook opts blocks -- cgit v1.2.3