Documill Dynamo
Breadcrumbs

Create a table of contents (Legacy)

1. Add necessary commands to the Main Flow.

Navigate to Main Flow and add the following command to the Initialize Step:

image-20240109-090347.png


Edit the Initialize step:

image-20240109-090354.png


Add the set command with var = headings

image-20240109-090401.png


Navigate to the Compose - Start step:

image-20240109-090407.png


And add the following command (make sure the var and template attributes are similar on both composeContent commands):

image-20240109-090415.png


2. Add styling to CSS styles.

Copy the following CSS snippet:

.document h1.numbering::before {
counter-increment: h1;
content: counter(h1) ". ";}

.document h2.numbering::before {
counter-increment: h2;
content: counter(h1) "." counter(h2) " ";}

.document h3.numbering::before {
counter-increment: h3;
content: counter(h1) "." counter(h2) "." counter(h3) " ";}

.document .toc-block {
--dyn-style-label: First page ToC block;}

.document .toc-block a::after {
content: leader(dotted) target-counter(attr(href url), page);}

Then, navigate to the CSS Stylesheet:

image-20240109-090425.png


Paste at a position of your own choice:

image-20240109-090432.png


3. Add the table of contents to the page.

Initially, add the Group component to the page where you want the Table of Content to be. Once added, populate the Attributes and Styles tabs (on the right) as follows:

image-20240109-090440.png



image-20240109-090455.png


Proceed to add an ordered list to the selected text and populate the Attribute tab as below:

image-20240109-090502.png


Add a link to the selected text and populate the Attribute tab as below:

image-20240109-090510.png


Test to view the results:

image-20240109-090517.png