ConTeXt writer: Add reference anchors to Div with ids.

This is useful for pandoc-citeproc linked citations.
This commit is contained in:
John MacFarlane 2015-05-28 17:46:26 -07:00
parent e54c8613e8
commit c1f6d5e31f

View file

@ -151,7 +151,13 @@ blockToConTeXt (CodeBlock _ str) =
-- blankline because \stoptyping can't have anything after it, inc. '}'
blockToConTeXt (RawBlock "context" str) = return $ text str <> blankline
blockToConTeXt (RawBlock _ _ ) = return empty
blockToConTeXt (Div _ bs) = blockListToConTeXt bs
blockToConTeXt (Div (ident,_,_) bs) = do
contents <- blockListToConTeXt bs
if null ident
then return contents
else return $
("\\reference" <> brackets (text $ toLabel ident) <> braces empty)
$$ contents
blockToConTeXt (BulletList lst) = do
contents <- mapM listItemToConTeXt lst
return $ ("\\startitemize" <> if isTightList lst