longform
longform copied to clipboard
Compile Step Request: Insert Table of Contents
(inspired by #37)
This one is a bit strange, as it's a step that acts on all scenes but runs per manuscript. It almost makes me think that steps should be able to insert data into the compile context and then reference it later....in which case this would be two steps, generate and insert. Or a step can insert a post-join hook or something! Obv bears more thinking about, but also very useful.
Other questions here: should a TOC link to headers? Does that mean it should rewrite headers as anchor tags? Should there be page numbers? Exactly how flexible should this step be?
I'd suggest to keep it simple and just create a ToC based on any heading present in the manuscript, maybe with some configuration which heading levels to include, etc.
it should be noted though that at least when pandoc is the end goal, ToC creation can be done easily with pandoc already, so at least for me, this step wouldn't be high priority.
I think there are probably 2 main use cases here:
- Compile for print. Links don’t make sense here.
- Compile for epub / html. Links are critical here.
Maybe you can do the linking in both cases, but style it such that it’s not visually different in the first case?