From 079af93d78fd5f4aad86489be454b38b407dfd08 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 8 Sep 2024 08:52:29 -0700 Subject: [PATCH] CONTRIBUTING.md: summarize steps for adding new cli option. --- CONTRIBUTING.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8cda552f1..e791aad48 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -422,6 +422,27 @@ The library is structured as follows: - `Text.Pandoc.UUID` contains functions for generating UUIDs. - `Text.Pandoc.XML` contains functions for formatting XML. +Adding a new command-line option +-------------------------------- + +To add a new command-line option, you'll need to make changes in several +places: + +- `Text.Pandoc.App.Opt` -- new constructor for Opt and default + value +- `Text.Pandoc.App.CommandLineOptions` -- the option parser +- `Text.Pandoc.App` or `Text.Pandoc.App.OutputSettings` -- + handle the new option +- possibly in pandoc-server: `Text.Pandoc.Server` -- handle the + new option + +If your change requires a new field for ReaderOptions or +WriterOptions, you'll also need to + +- `Text.Pandoc.Options` -- type change and default value +- in pandoc-lua-engine: Text.Pandoc.Lua.Marshal.WriterOptions + and/or Text.Pandoc.Lua.Marshal.ReaderOptions + Lua filters -----------