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
|
, columns :: Maybe Int
|
||||||
, standalone :: Maybe Bool
|
, standalone :: Maybe Bool
|
||||||
, template :: Maybe Text
|
, template :: Maybe Text
|
||||||
|
, tabStop :: Maybe Int
|
||||||
|
, indentedCodeClasses :: Maybe [Text]
|
||||||
} deriving (Show)
|
} deriving (Show)
|
||||||
|
|
||||||
instance Default Params where
|
instance Default Params where
|
||||||
|
@ -46,6 +48,8 @@ instance Default Params where
|
||||||
, columns = Nothing
|
, columns = Nothing
|
||||||
, standalone = Nothing
|
, standalone = Nothing
|
||||||
, template = Nothing
|
, template = Nothing
|
||||||
|
, tabStop = Nothing
|
||||||
|
, indentedCodeClasses = Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Automatically derive code to convert to/from JSON.
|
-- Automatically derive code to convert to/from JSON.
|
||||||
|
@ -110,6 +114,9 @@ server = convert
|
||||||
else return Nothing
|
else return Nothing
|
||||||
let readeropts = def{ readerExtensions = readerExts
|
let readeropts = def{ readerExtensions = readerExts
|
||||||
, readerStandalone = isStandalone
|
, readerStandalone = isStandalone
|
||||||
|
, readerTabStop = fromMaybe 4 (tabStop params)
|
||||||
|
, readerIndentedCodeClasses = fromMaybe []
|
||||||
|
(indentedCodeClasses params)
|
||||||
}
|
}
|
||||||
let writeropts = def{ writerExtensions = writerExts
|
let writeropts = def{ writerExtensions = writerExts
|
||||||
, writerWrapText = fromMaybe WrapAuto (wrapText params)
|
, writerWrapText = fromMaybe WrapAuto (wrapText params)
|
||||||
|
|
Loading…
Reference in a new issue