diff options
author | Mathieu Boespflug <m@tweag.io> | 2020-06-14 19:43:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-14 10:43:53 -0700 |
commit | e321843f321c5c22a48b19933625f0b026b1ad91 (patch) | |
tree | 9c94492ed402f52d63872695017753574684eb22 /src/Text/Pandoc/Readers | |
parent | 12a35dd0d0f7363ad5b85ab859925113c65aa61f (diff) | |
download | pandoc-e321843f321c5c22a48b19933625f0b026b1ad91.tar.gz |
Docbook: implement <replaceable> (#6437)
A `<replaceable>` is a placeholder that a user is instructed to
replace with a value of their own, like
`<replaceable>prefix</replacable>/bin/foo`. In the standard Docbook
toolchain, this typically appears emphasized, and no other adornement.
But a `<replaceable>` is nearly always in a code element, where
emphasis won't work. So we do the same thing as for `<optional>`:
decorate the content with brackets.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 1b1cbf6ab..884595ae8 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -363,7 +363,7 @@ List of all DocBook tags, with [x] indicating implemented, [x] releaseinfo - Information about a particular release of a document [ ] remark - A remark (or comment) intended for presentation in a draft manuscript -[ ] replaceable - Content that may or must be replaced by the user +[x] replaceable - Content that may or must be replaced by the user [ ] returnvalue - The value returned by a function [ ] revdescription - A extended description of a revision to a document [ ] revhistory - A history of the revisions to a document @@ -983,6 +983,8 @@ parseInline (Elem e) = "option" -> codeWithLang "optional" -> do x <- getInlines e return $ str "[" <> x <> str "]" + "replaceable" -> do x <- getInlines e + return $ str "<" <> x <> str ">" "markup" -> codeWithLang "wordasword" -> emph <$> innerInlines "command" -> codeWithLang |