diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-03-16 06:45:47 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-03-16 06:45:47 +0000 |
commit | 9562390d6883110bd00d5b667761ec6b615eb5d7 (patch) | |
tree | ce5448788b39e6d57a352f4bd1f98f1a7374644c | |
parent | da117c9d68fb2169b43dda6131bfa35856113347 (diff) | |
download | pandoc-9562390d6883110bd00d5b667761ec6b615eb5d7.tar.gz |
ConTeXt writer: support images in figures.
Also, DON'T put image in figure (as was done previously)
when it's an inline image.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1893 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r-- | src/Text/Pandoc/Writers/ConTeXt.hs | 10 | ||||
-rw-r--r-- | tests/writer.context | 15 |
2 files changed, 9 insertions, 16 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index b1e3acb8f..545acded5 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -109,6 +109,10 @@ blockToConTeXt (Plain lst) = do let options = stOptions st contents <- wrapTeXIfNeeded options False inlineListToConTeXt lst return $ Reg contents +blockToConTeXt (Para [Image txt (src,_)]) = do + capt <- inlineListToConTeXt txt + return $ Pad $ text "\\placefigure[here,nonumber]{" <> capt <> + text "}{\\externalfigure[" <> text src <> text "]}" blockToConTeXt (Para lst) = do st <- get let options = stOptions st @@ -265,10 +269,8 @@ inlineToConTeXt (Link txt (src, _)) = do label <- inlineListToConTeXt txt return $ text "\\useURL[" <> text ref <> text "][" <> text src <> text "][][" <> label <> text "]\\from[" <> text ref <> char ']' -inlineToConTeXt (Image alternate (src, tit)) = do - alt <- inlineListToConTeXt alternate - return $ text "\\placefigure\n[]\n[fig:" <> alt <> text "]\n{" <> - text tit <> text "}\n{\\externalfigure[" <> text src <> text "]}" +inlineToConTeXt (Image _ (src, _)) = do + return $ text "{\\externalfigure[" <> text src <> text "]}" inlineToConTeXt (Note contents) = do contents' <- blockListToConTeXt contents let rawnote = stripTrailingNewlines $ render contents' diff --git a/tests/writer.context b/tests/writer.context index 50890730d..288d6970c 100644 --- a/tests/writer.context +++ b/tests/writer.context @@ -862,18 +862,9 @@ or here: <http://example.com/> From \quotation{Voyage dans la Lune} by Georges Melies (1902): -\placefigure -[] -[fig:lalune] -{Voyage dans la Lune} -{\externalfigure[lalune.jpg]} - -Here is a movie -\placefigure -[] -[fig:movie] -{} -{\externalfigure[movie.jpg]} icon. +\placefigure[here,nonumber]{lalune}{\externalfigure[lalune.jpg]} + +Here is a movie {\externalfigure[movie.jpg]} icon. \thinrule |