git.iko.soy/typeable/pandoc
on master help sign in
Made --id-prefix work in DocBook as well as HTML.
c544f20John MacFarlane
README+2−2
@@ -415,8 +415,8 @@ Options affecting specific writers
415
415
416`--id-prefix`=*STRING*
416`--id-prefix`=*STRING*
417: Specify a prefix to be added to all automatically generated identifiers
417: Specify a prefix to be added to all automatically generated identifiers
418− in HTML output. This is useful for preventing duplicate identifiers
418+ in HTML and DocBook output. This is useful for preventing duplicate
419− when generating fragments to be included in other pages.
419+ identifiers when generating fragments to be included in other pages.
420
420
421`-T` *STRING*, `--title-prefix=`*STRING*
421`-T` *STRING*, `--title-prefix=`*STRING*
422: Specify *STRING* as a prefix at the beginning of the title
422: Specify *STRING* as a prefix at the beginning of the title
src/Text/Pandoc/Writers/Docbook.hs+1−1
@@ -103,7 +103,7 @@ elementToDocbook opts lvl (Sec _ _num id' title elements) =
103 n | n == 0 -> "chapter"
103 n | n == 0 -> "chapter"
104 | n >= 1 && n <= 5 -> "sect" ++ show n
104 | n >= 1 && n <= 5 -> "sect" ++ show n
105 | otherwise -> "simplesect"
105 | otherwise -> "simplesect"
106− in inTags True tag [("id",id')] $
106+ in inTags True tag [("id", writerIdentifierPrefix opts ++ id')] $
107 inTagsSimple "title" (inlinesToDocbook opts title) $$
107 inTagsSimple "title" (inlinesToDocbook opts title) $$
108 vcat (map (elementToDocbook opts (lvl + 1)) elements')
108 vcat (map (elementToDocbook opts (lvl + 1)) elements')
109
109