LogMessage: change UnknownExtension -> CouldNotDeduceFormat
This commit is contained in:
parent
d98dde07c9
commit
7d6783006a
3 changed files with 6 additions and 6 deletions
|
@ -141,7 +141,7 @@ convertWithOpts opts = do
|
|||
Nothing | sources == ["-"] -> return "markdown"
|
||||
| any isURI sources -> return "html"
|
||||
| otherwise -> do
|
||||
report $ UnknownExtensions
|
||||
report $ CouldNotDeduceFormat
|
||||
(map takeExtension sources) "markdown"
|
||||
return "markdown"
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ optToOutputSettings opts = do
|
|||
| otherwise ->
|
||||
case formatFromFilePaths [outputFile] of
|
||||
Nothing -> do
|
||||
report $ UnknownExtensions
|
||||
report $ CouldNotDeduceFormat
|
||||
[takeExtension outputFile] "html"
|
||||
return ("html", Nothing)
|
||||
Just f -> return (f, Nothing)
|
||||
|
|
|
@ -89,7 +89,7 @@ data LogMessage =
|
|||
| UnusualConversion String
|
||||
| UnexpectedXmlElement String String
|
||||
| UnknownOrgExportOption String
|
||||
| UnknownExtensions [String] String
|
||||
| CouldNotDeduceFormat [String] String
|
||||
deriving (Show, Eq, Data, Ord, Typeable, Generic)
|
||||
|
||||
instance ToJSON LogMessage where
|
||||
|
@ -211,7 +211,7 @@ instance ToJSON LogMessage where
|
|||
"parent" .= Text.pack parent]
|
||||
UnknownOrgExportOption option ->
|
||||
["option" .= Text.pack option]
|
||||
UnknownExtensions exts format ->
|
||||
CouldNotDeduceFormat exts format ->
|
||||
["extensions" .= map Text.pack exts
|
||||
,"format" .= Text.pack format]
|
||||
|
||||
|
@ -319,7 +319,7 @@ showLogMessage msg =
|
|||
"Unexpected XML element " ++ element ++ " in " ++ parent
|
||||
UnknownOrgExportOption option ->
|
||||
"Ignoring unknown Org export option: " ++ option
|
||||
UnknownExtensions exts format ->
|
||||
CouldNotDeduceFormat exts format ->
|
||||
"Could not deduce format from file extension " ++
|
||||
intercalate " or " exts ++ "\n" ++
|
||||
"Defaulting to " ++ format
|
||||
|
@ -365,4 +365,4 @@ messageVerbosity msg =
|
|||
UnusualConversion {} -> WARNING
|
||||
UnexpectedXmlElement {} -> WARNING
|
||||
UnknownOrgExportOption {} -> WARNING
|
||||
UnknownExtensions{} -> WARNING
|
||||
CouldNotDeduceFormat{} -> WARNING
|
||||
|
|
Loading…
Reference in a new issue