@@ -60,7 +60,7 @@ hierarchicalize (block:rest) =
61-- | Convert list of authors to a docbook <author> section
61-- | Convert list of authors to a docbook <author> section
62authorToDocbook :: WriterOptions -> [Char] -> Doc
62authorToDocbook :: WriterOptions -> [Char] -> Doc
63−authorToDocbook options name = indentedInTags options "author" $
63+authorToDocbook options name = indentedInTags "author" $
64 if ',' `elem` name
64 if ',' `elem` name
65 then -- last name first
65 then -- last name first
66 let (lastname, rest) = break (==',') name
66 let (lastname, rest) = break (==',') name
@@ -84,7 +84,7 @@ writeDocbook options (Pandoc (Meta title authors date) blocks) =
84 then text (writerHeader options)
84 then text (writerHeader options)
85 else empty
85 else empty
86 meta = if (writerStandalone options)
86 meta = if (writerStandalone options)
87− then indentedInTags options "articleinfo" $
87+ then indentedInTags "articleinfo" $
88 (inTags "title" (inlinesToDocbook options title)) $$
88 (inTags "title" (inlinesToDocbook options title)) $$
89 (vcat (map (authorToDocbook options) authors)) $$
89 (vcat (map (authorToDocbook options) authors)) $$
90 (inTags "date" (text date))
90 (inTags "date" (text date))
@@ -97,7 +97,7 @@ writeDocbook options (Pandoc (Meta title authors date) blocks) =
97 vcat (map (elementToDocbook options') elements) $$
97 vcat (map (elementToDocbook options') elements) $$
98 text (writerIncludeAfter options')
98 text (writerIncludeAfter options')
99 body' = if writerStandalone options'
99 body' = if writerStandalone options'
100− then indentedInTags options' "article" (meta $$ body)
100+ then indentedInTags "article" (meta $$ body)
101 else body in
101 else body in
102 render $ head $$ body' <> text "\n"
102 render $ head $$ body' <> text "\n"
@@ -116,8 +116,8 @@ inTags :: String -> Doc -> Doc
116inTags tagType contents = inTagsWithAttrib tagType [] contents
116inTags tagType contents = inTagsWithAttrib tagType [] contents
118-- | Put the supplied contents in indented block btw start and end tags.
118-- | Put the supplied contents in indented block btw start and end tags.
119−indentedInTags :: WriterOptions -> [Char] -> Doc -> Doc
119+indentedInTags :: [Char] -> Doc -> Doc
120−indentedInTags options tagType contents = text ("<" ++ tagType ++ ">") $$
120+indentedInTags tagType contents = text ("<" ++ tagType ++ ">") $$
121 nest 2 contents $$ text ("</" ++ tagType ++ ">")
121 nest 2 contents $$ text ("</" ++ tagType ++ ">")
123-- | Convert an Element to Docbook.
123-- | Convert an Element to Docbook.
@@ -128,7 +128,7 @@ elementToDocbook options (Sec title elements) =
128 let elements' = if null elements
128 let elements' = if null elements
129 then [Blk (Para [])]
129 then [Blk (Para [])]
130 else elements in
130 else elements in
131− indentedInTags options "section" $
131+ indentedInTags "section" $
132 inTags "title" (wrap options title) $$
132 inTags "title" (wrap options title) $$
133 vcat (map (elementToDocbook options) elements')
133 vcat (map (elementToDocbook options) elements')
@@ -147,7 +147,7 @@ listItemToDocbook options item =
147 let plainToPara (Plain x) = Para x
147 let plainToPara (Plain x) = Para x
148 plainToPara y = y in
148 plainToPara y = y in
149 let item' = map plainToPara item in
149 let item' = map plainToPara item in
150− indentedInTags options "listitem" (blocksToDocbook options item')
150+ indentedInTags "listitem" (blocksToDocbook options item')
152-- | Convert a Pandoc block element to Docbook.
152-- | Convert a Pandoc block element to Docbook.
153blockToDocbook :: WriterOptions -> Block -> Doc
153blockToDocbook :: WriterOptions -> Block -> Doc
@@ -155,20 +155,20 @@ blockToDocbook options Blank = text ""
155blockToDocbook options Null = empty
155blockToDocbook options Null = empty
156blockToDocbook options (Plain lst) = wrap options lst
156blockToDocbook options (Plain lst) = wrap options lst
157blockToDocbook options (Para lst) =
157blockToDocbook options (Para lst) =
158− indentedInTags options "para" (wrap options lst)
158+ indentedInTags "para" (wrap options lst)
159blockToDocbook options (BlockQuote blocks) =
159blockToDocbook options (BlockQuote blocks) =
160− indentedInTags options "blockquote" (blocksToDocbook options blocks)
160+ indentedInTags "blockquote" (blocksToDocbook options blocks)
161blockToDocbook options (CodeBlock str) =
161blockToDocbook options (CodeBlock str) =
162 text "<screen>\n" <> text (codeStringToXML str) <> text "\n</screen>"
162 text "<screen>\n" <> text (codeStringToXML str) <> text "\n</screen>"
163blockToDocbook options (BulletList lst) =
163blockToDocbook options (BulletList lst) =
164− indentedInTags options "itemizedlist" $ listItemsToDocbook options lst
164+ indentedInTags "itemizedlist" $ listItemsToDocbook options lst
165blockToDocbook options (OrderedList lst) =
165blockToDocbook options (OrderedList lst) =
166− indentedInTags options "orderedlist" $ listItemsToDocbook options lst
166+ indentedInTags "orderedlist" $ listItemsToDocbook options lst
167blockToDocbook options (RawHtml str) = text str -- raw XML block
167blockToDocbook options (RawHtml str) = text str -- raw XML block
168blockToDocbook options HorizontalRule = empty -- not semantic
168blockToDocbook options HorizontalRule = empty -- not semantic
169blockToDocbook options (Note _ _) = empty -- shouldn't occur
169blockToDocbook options (Note _ _) = empty -- shouldn't occur
170blockToDocbook options (Key _ _) = empty -- shouldn't occur
170blockToDocbook options (Key _ _) = empty -- shouldn't occur
171−blockToDocbook options _ = indentedInTags options "para" (text "Unknown block type")
171+blockToDocbook options _ = indentedInTags "para" (text "Unknown block type")
173-- | Put string in CDATA section
173-- | Put string in CDATA section
174cdata :: String -> Doc
174cdata :: String -> Doc
@@ -221,11 +221,11 @@ inlineToDocbook options (Link text (Ref ref)) = empty -- shouldn't occur
221inlineToDocbook options (Image alt (Src src tit)) =
221inlineToDocbook options (Image alt (Src src tit)) =
222 let titleDoc = if null tit
222 let titleDoc = if null tit
223 then empty
223 then empty
224− else indentedInTags options "objectinfo" $
224+ else indentedInTags "objectinfo" $
225− indentedInTags options "title"
225+ indentedInTags "title"
226 (text $ stringToXML options tit) in
226 (text $ stringToXML options tit) in
227− indentedInTags options "inlinemediaobject" $
227+ indentedInTags "inlinemediaobject" $
228− indentedInTags options "imageobject" $
228+ indentedInTags "imageobject" $
229 titleDoc $$ inTagsWithAttrib "imagedata" [("fileref", src)] empty
229 titleDoc $$ inTagsWithAttrib "imagedata" [("fileref", src)] empty
230inlineToDocbook options (Image alternate (Ref ref)) = empty --shouldn't occur
230inlineToDocbook options (Image alternate (Ref ref)) = empty --shouldn't occur
231inlineToDocbook options (NoteRef ref) =
231inlineToDocbook options (NoteRef ref) =
@@ -234,4 +234,4 @@ inlineToDocbook options (NoteRef ref) =
234 if null hits
234 if null hits
235 then empty
235 then empty
236 else let (Note _ contents) = head hits in
236 else let (Note _ contents) = head hits in
237− indentedInTags options "footnote" $ blocksToDocbook options contents
237+ indentedInTags "footnote" $ blocksToDocbook options contents