mirror of
https://github.com/jgm/pandoc.git
synced 2026-10-29 17:52:33 +08:00
Default files: Allow leaving input-files blank again.
Leaving it blank yields a Nothing value (interpreted as stdin). Providing an empty list is intepreted as no input. This resolves one part of #5888.
This commit is contained in:
+1
-1
@@ -1433,7 +1433,7 @@ to: html5
|
||||
|
||||
# leave blank for output to stdout:
|
||||
output-file:
|
||||
# leave blank for input from stdin:
|
||||
# leave blank for input from stdin, use [] for no input:
|
||||
input-files:
|
||||
- preface.md
|
||||
- content.md
|
||||
|
||||
@@ -202,15 +202,16 @@ doOpt (k',v) = do
|
||||
"input-files" ->
|
||||
parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
|
||||
optInputFiles o <>
|
||||
Just (map unpack x) })
|
||||
(map unpack <$> x) })
|
||||
"input-file" -> -- allow either a list or a single value
|
||||
(parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
|
||||
optInputFiles o <>
|
||||
Just (map unpack x) }))
|
||||
(map unpack <$> x) }))
|
||||
<|>
|
||||
(parseYAML v >>= \x -> return (\o -> o{ optInputFiles =
|
||||
optInputFiles o <>
|
||||
Just [unpack x] }))
|
||||
((\z -> [unpack z]) <$> x)
|
||||
}))
|
||||
"number-sections" ->
|
||||
parseYAML v >>= \x -> return (\o -> o{ optNumberSections = x })
|
||||
"number-offset" ->
|
||||
|
||||
Reference in New Issue
Block a user