From 04609095d87caed3460ac38ece86e4d05a477f49 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Sun, 26 Dec 2021 23:04:45 +0000 Subject: [PATCH] set default toc-depth to 6; add cli option to set it --- notes2web.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notes2web.py b/notes2web.py index 0344643..2e358d4 100755 --- a/notes2web.py +++ b/notes2web.py @@ -117,6 +117,7 @@ def get_args(): parser.add_argument('--fuse', type=pathlib.Path, default=pathlib.Path('/opt/notes2web/fuse.js')) parser.add_argument('--searchjs', type=pathlib.Path, default=pathlib.Path('/opt/notes2web/search.js')) parser.add_argument('--tocsearchjs', type=pathlib.Path, default=pathlib.Path('/opt/notes2web/toc_search.js')) + parser.add_argument('--toc-depth', type=int, default=6, dest='toc_depth') return parser.parse_args() @@ -205,7 +206,7 @@ def main(args): '-V', f'filehistory={filehistory}', '-V', f'licenseFull={notes_license}', '--mathjax', - '--toc' + '--toc', f'--toc-depth={args.toc_depth}' ]) pathlib.Path(output_filename).parent.mkdir(parents=True, exist_ok=True)