Server: support tabStop, indentedCodeClasses
This commit is contained in:
parent
6274327398
commit
2f5c75132a
1 changed files with 7 additions and 0 deletions
|
@ -35,6 +35,8 @@ data Params = Params
|
|||
, columns :: Maybe Int
|
||||
, standalone :: Maybe Bool
|
||||
, template :: Maybe Text
|
||||
, tabStop :: Maybe Int
|
||||
, indentedCodeClasses :: Maybe [Text]
|
||||
} deriving (Show)
|
||||
|
||||
instance Default Params where
|
||||
|
@ -46,6 +48,8 @@ instance Default Params where
|
|||
, columns = Nothing
|
||||
, standalone = Nothing
|
||||
, template = Nothing
|
||||
, tabStop = Nothing
|
||||
, indentedCodeClasses = Nothing
|
||||
}
|
||||
|
||||
-- Automatically derive code to convert to/from JSON.
|
||||
|
@ -110,6 +114,9 @@ server = convert
|
|||
else return Nothing
|
||||
let readeropts = def{ readerExtensions = readerExts
|
||||
, readerStandalone = isStandalone
|
||||
, readerTabStop = fromMaybe 4 (tabStop params)
|
||||
, readerIndentedCodeClasses = fromMaybe []
|
||||
(indentedCodeClasses params)
|
||||
}
|
||||
let writeropts = def{ writerExtensions = writerExts
|
||||
, writerWrapText = fromMaybe WrapAuto (wrapText params)
|
||||
|
|
Loading…
Reference in a new issue