From 03950ac8490d775ddeae862d531aaeda287c8a62 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 18 Jan 2024 08:19:56 -1000 Subject: [PATCH] add page TOCs --- Makefile | 1 + out/css/site.css | 7 +++++++ page.tmpl | 10 ++++++++++ src/Cookbook.md | 10 +++------- src/Newcomer-FAQ.md | 3 --- src/index.md | 5 +++++ src/quickref/index.md | 4 ++++ 7 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index dc48854..b6b39dd 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ html-cfp: MD2HTML=$(PANDOC) \ -f markdown-smart-tex_math_dollars+autolink_bare_uris+wikilinks_title_after_pipe \ + --toc \ --lua-filter=wikilinks.lua \ --lua-filter=headings.lua \ diff --git a/out/css/site.css b/out/css/site.css index 6d1621e..3184dbb 100644 --- a/out/css/site.css +++ b/out/css/site.css @@ -27,3 +27,10 @@ h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { li { margin-bottom:0; } + +#TOC { + border-top: thin solid black; + padding-top: 1em; + border-bottom: thin solid black; + margin-bottom: 2em; +} diff --git a/page.tmpl b/page.tmpl index 539fcd5..093f01b 100644 --- a/page.tmpl +++ b/page.tmpl @@ -37,6 +37,16 @@

plaintextaccounting.org

$title$

+$if(toc)$ + +$endif$ + $body$
diff --git a/src/Cookbook.md b/src/Cookbook.md index 0bc2295..b8fb039 100644 --- a/src/Cookbook.md +++ b/src/Cookbook.md @@ -9,11 +9,7 @@ and we'll add it, or you can [add it yourself](https://github.com/plaintextaccounting/plaintextaccounting/blob/master/src/Cookbook.md). -**[Getting started](#getting-started)**\ -**[General usage](#general-usage)**\ -**[Accounting situations](#accounting-situations)**\ - -### Getting started +## Getting started - [[index|Home]] - links to news, videos, articles, docs and software. - [[Newcomer FAQ]] @@ -23,7 +19,7 @@ and we'll add it, or you can - [[Don't Sink Your First Attempts at Plaintext Accounting]] h/ledger beginner syntax tips - [[quickref/index|Syntax quick reference]] -### General usage +## General usage - [[Importing data]] - [[Reconciling]] @@ -34,7 +30,7 @@ and we'll add it, or you can - [[Recording dates]] - Starting a new file -### Accounting situations +## Accounting situations - [[Borrowing and Lending]] - [[Budgeting]] diff --git a/src/Newcomer-FAQ.md b/src/Newcomer-FAQ.md index 812ce5b..5235f34 100644 --- a/src/Newcomer-FAQ.md +++ b/src/Newcomer-FAQ.md @@ -1,8 +1,5 @@ % Newcomer FAQ -**[What is this](#what-is-this)**\ -**[Objections and concerns](#objections-and-concerns)**\ - ## What is this ### What is accounting, and what can it do for me? diff --git a/src/index.md b/src/index.md index fa4412d..d8421b3 100644 --- a/src/index.md +++ b/src/index.md @@ -1,5 +1,10 @@ % Plain Text Accounting (PTA) +--- +toc: false +... + +
diff --git a/src/quickref/index.md b/src/quickref/index.md index 0af9d0c..64c8275 100644 --- a/src/quickref/index.md +++ b/src/quickref/index.md @@ -1,5 +1,9 @@ % Syntax quick reference +--- +toc: false +... + **[Big 3](index.html)**