The table of contents shows across different files via \Include
New to topics? Read the documentation here!
The table of contents shows across different files via
Ciro Santilli 32 Updated 2024-09-07 Created 1970-01-01
\Include
by ![](https://raw.githubusercontent.com/cirosantilli/media/master/ID_photo_of_Ciro_Santilli_taken_in_2013.jpg)
E.g.:
README.ciro
not-readme.ciro
the table of contents for
= My website
== h2
\Include[not-readme]
= Not readme
== Not readme h2
index.html
also contains the headers for not-readme.ciro
producing:- My website
- h2
- Not readme
- Not readme h2
- Not readme
- h2
This feature means that you can split large input files if rendering starts to slow you down, and things will still render exactly the same, with the larger table of contents.
This will be especially important for the website because initially I want users to be able to edit one header at a time, and join all headers with
\Include
. But I still want the ToC to show those children.This was a bit hard because it required doing RECURSIVE SQL queries, something I hadn't done before: stackoverflow.com/questions/192220/what-is-the-most-efficient-elegant-way-to-parse-a-flat-table-into-a-tree/192462#192462 + of course the usual refactor a bunch of stuff and fix tests until you go mad.