From 75d4a723df5449561d2fff2e23e7664ffac5c26e Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Tue, 15 Oct 2024 16:30:13 +0100 Subject: [PATCH] Add commandline option for publish to exclude the TOC --- doorstop/cli/commands.py | 2 ++ doorstop/cli/main.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doorstop/cli/commands.py b/doorstop/cli/commands.py index 50314292..1825c85f 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 # Write to output file(s) if args.path: diff --git a/doorstop/cli/main.py b/doorstop/cli/main.py index 962f6ee5..0207c8cc 100644 --- a/doorstop/cli/main.py +++ b/doorstop/cli/main.py @@ -536,7 +536,12 @@ def _publish(subs, shared): help="do not include levels on heading and non-heading or non-heading items", ) sub.add_argument("--template", help="template file", default=None) - + sub.add_argument( + "--no-toc", + action="store_true", + help="do not include a table-of-contents in the output", + ) + if __name__ == "__main__": main()