From 415c83cf65d1e33c69320c01705b649f6743e7cf Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Tue, 15 Oct 2024 16:30:13 +0100 Subject: [PATCH] feature: Add commandline option for publish to exclude the TOC --- doorstop/cli/commands.py | 2 ++ doorstop/cli/main.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/doorstop/cli/commands.py b/doorstop/cli/commands.py index 06c4f4d7..3c57a776 100644 --- a/doorstop/cli/commands.py +++ b/doorstop/cli/commands.py @@ -563,6 +563,8 @@ def run_publish(args, cwd, error, catch=True): kwargs = {} if args.width: kwargs["width"] = args.width + if args.no_toc: + kwargs["toc"] = False if args.index: kwargs["index"] = True diff --git a/doorstop/cli/main.py b/doorstop/cli/main.py index eb5756aa..6614e593 100644 --- a/doorstop/cli/main.py +++ b/doorstop/cli/main.py @@ -543,6 +543,11 @@ def _publish(subs, shared): help="Generate top level index (when producing markdown).", action="store_true", ) + sub.add_argument( + "--no-toc", + action="store_true", + help="do not include a table-of-contents in the output", + ) if __name__ == "__main__":