mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-25 08:55:55 +00:00
@@ -416,8 +416,9 @@ Options affecting specific writers
|
||||
|
||||
`--id-prefix`=*STRING*
|
||||
: Specify a prefix to be added to all automatically generated identifiers
|
||||
in HTML and DocBook output. This is useful for preventing duplicate
|
||||
identifiers when generating fragments to be included in other pages.
|
||||
in HTML and DocBook output, and to footnote numbers in markdown output.
|
||||
This is useful for preventing duplicate identifiers when generating
|
||||
fragments to be included in other pages.
|
||||
|
||||
`-T` *STRING*, `--title-prefix=`*STRING*
|
||||
: Specify *STRING* as a prefix at the beginning of the title
|
||||
|
||||
@@ -215,6 +215,7 @@ data WriterOptions = WriterOptions
|
||||
, writerColumns :: Int -- ^ Characters in a line (for text wrapping)
|
||||
, writerEmailObfuscation :: ObfuscationMethod -- ^ How to obfuscate emails
|
||||
, writerIdentifierPrefix :: String -- ^ Prefix for section & note ids in HTML
|
||||
-- and for footnote marks in markdown
|
||||
, writerSourceDirectory :: FilePath -- ^ Directory path of 1st source file
|
||||
, writerUserDataDir :: Maybe FilePath -- ^ Path of user data directory
|
||||
, writerCiteMethod :: CiteMethod -- ^ How to print cites
|
||||
|
||||
@@ -174,7 +174,7 @@ notesToMarkdown opts notes =
|
||||
noteToMarkdown :: WriterOptions -> Int -> [Block] -> State WriterState Doc
|
||||
noteToMarkdown opts num blocks = do
|
||||
contents <- blockListToMarkdown opts blocks
|
||||
let num' = text $ show num
|
||||
let num' = text $ writerIdentifierPrefix opts ++ show num
|
||||
let marker = if isEnabled Ext_footnotes opts
|
||||
then text "[^" <> num' <> text "]:"
|
||||
else text "[" <> num' <> text "]"
|
||||
@@ -655,7 +655,7 @@ inlineToMarkdown opts (Image alternate (source, tit)) = do
|
||||
inlineToMarkdown opts (Note contents) = do
|
||||
modify (\st -> st{ stNotes = contents : stNotes st })
|
||||
st <- get
|
||||
let ref = show $ (length $ stNotes st)
|
||||
let ref = text $ writerIdentifierPrefix opts ++ show (length $ stNotes st)
|
||||
if isEnabled Ext_footnotes opts
|
||||
then return $ "[^" <> text ref <> "]"
|
||||
else return $ "[" <> text ref <> "]"
|
||||
then return $ "[^" <> ref <> "]"
|
||||
else return $ "[" <> ref <> "]"
|
||||
|
||||
Reference in New Issue
Block a user