aboutsummaryrefslogtreecommitdiff
path: root/pandoc-server
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2025-08-11 19:54:23 +0200
committerJohn MacFarlane <[email protected]>2025-09-02 17:50:47 +0200
commite0acb24528cbf409ae5723e537acb0c2ed4e2d91 (patch)
tree77bf1d4ac09a2ec049da651d32bd97a04656dd4d /pandoc-server
parent64757254ab6e1d005cf8f4ee6c491d97aed7b16f (diff)
Refactor highlighting options [API Change]
A new command line option `--syntax-highlighting` is provided; it takes the values `none`, `default`, `idiomatic`, a style name, or a path to a theme file. It replaces the `--no-highlighting`, `--highlighting-style`, and `--listings` options. The `writerListings` and `writerHighlightStyle` fields of the `WriterOptions` type are replaced with `writerHighlightStyle`. Closes: #10525
Diffstat (limited to 'pandoc-server')
-rw-r--r--pandoc-server/src/Text/Pandoc/Server.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/pandoc-server/src/Text/Pandoc/Server.hs b/pandoc-server/src/Text/Pandoc/Server.hs
index e5f8dee90..bfa2efb32 100644
--- a/pandoc-server/src/Text/Pandoc/Server.hs
+++ b/pandoc-server/src/Text/Pandoc/Server.hs
@@ -275,8 +275,11 @@ server = convertBytes
let isStandalone = optStandalone opts
let toformat = formatName writerFormat
- hlStyle <- traverse (lookupHighlightingStyle . T.unpack)
- $ optHighlightStyle opts
+ hlStyle <- case optSyntaxHighlighting opts of
+ "none" -> pure NoHighlighting
+ "idiomatic" -> pure IdiomaticHighlighting
+ "default" -> pure DefaultHighlighting
+ s -> Skylighting <$> lookupHighlightingStyle (T.unpack s)
mbTemplate <- if isStandalone
then case optTemplate opts of
@@ -327,8 +330,7 @@ server = convertBytes
, writerHtmlQTags = optHtmlQTags opts
, writerSlideLevel = optSlideLevel opts
, writerTopLevelDivision = optTopLevelDivision opts
- , writerListings = optListings opts
- , writerHighlightStyle = hlStyle
+ , writerHighlightMethod = hlStyle
, writerSetextHeaders = optSetextHeaders opts
, writerListTables = optListTables opts
, writerEpubSubdirectory = T.pack $ optEpubSubdirectory opts