Closed ickc closed 8 years ago
The problem is that it's not clear where the TOC should be placed. That's why I use the {{TOC}}
approach instead of metadata.
You could have the TOC command itself in a transcluded file, and then use different transclude base folders for the master vs child files. This isn't a great workaround, but it should work if done properly.
I'll think about other approaches for the future as well.
I see.
I am just brainstorming on possible ways it can be done in the future:
{{TOC}}
is renderedThis solved the file transclusion problem (assuming the {{TOC}}
in the master file appears first), and also shouldn't break backward compatibility much (most probably people aren't putting 2 TOCs at 2 locations...?).
{{TOC}}
syntax persistsSo TOC metadata and {{TOC}}
are both optional, that means 4 combinations (or 3 if nothing doesn't count).
{{TOC}}
only represents the location (e.g. after Title and abstracts) and the metadata controls the "sensible defaults".**Contents**
before the {{TOC}}
) and the TOC is put at the beginning.Optionally, the TOC metadata can be accompanied with other metadata fields (e.g. toc_title
) to control the "sensible defaults".
Because of how
{{TOC}}
is treated, putting it in each individual files will result in multiple TOC in the master file. I'm not sure if there's any workaround by pure MultiMarkdown, if a TOC is required for each files---individual or the master that includes them.A suggestion is to add an alternative way to add a TOC: by metadata front matter. Put there, file transclusion will exclude it. This loses the flexibility to the location and the title of TOC. For the location, the old syntax can be used if file transclusion is not needed. For the title, a syntax like this in the metadata front matter block:
could work.
The 2 names are directly borrowed from Pandoc - Pandoc User’s Guide.