Server: support tabStop, indentedCodeClasses

This commit is contained in:
John MacFarlane 2022-08-13 23:16:47 -07:00
parent 6274327398
commit 2f5c75132a

View file

@ -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)