author | Olivier Brunel
<jjk@jjacky.com> 2023-01-02 13:17:23 UTC |
committer | Olivier Brunel
<jjk@jjacky.com> 2023-01-04 15:10:17 UTC |
parent | 235a1a65c5b54336badd90ac4057ef9f9c9544d2 |
main.c | +6 | -1 |
no-toc.css | +4 | -0 |
diff --git a/main.c b/main.c index aa23cec..dd0cf8e 100644 --- a/main.c +++ b/main.c @@ -37,13 +37,16 @@ enum { enum { CSS_QMDOC, CSS_CUSTOM, + CSS_NO_TOC, NB_CSS }; static struct css { const char *file; size_t offset; } css[NB_CSS] = { - { "qmdoc.css" } + { "qmdoc.css" }, + { NULL }, + { "no-toc.css" } }; struct page { @@ -1176,6 +1179,8 @@ main (int argc, char *argv[]) int fddest = open(destdir, O_RDONLY | O_DIRECTORY | O_CLOEXEC); if (fddest < 0) strerr_diefu3sys(-ERR_IO, "open '", destdir, "'"); + if (!(ctx.options & OPT_NO_TOC)) css[CSS_NO_TOC].file = NULL; + struct page pages[argc - optind]; ctx.pages = pages; ctx.nb_pages = sizeof(pages) / sizeof(*pages); diff --git a/no-toc.css b/no-toc.css new file mode 100644 index 0000000..aa391df --- /dev/null +++ b/no-toc.css @@ -0,0 +1,4 @@ +main > section { + position: inherit; + margin-left: inherit; +}