.\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . .TH "BLOGC\-TOCTREE" "7" "January 2021" "Rafael G. Martins" "blogc Manual" . .SH "NAME" \fBblogc\-toctree\fR \- blogc\'s "table of contents" tree support . .SH "DESCRIPTION" blogc(1) generates a "table of contents" tree for every source file, out of its content headers, that is available for usage as a \fB{{ TOCTREE }}\fR template variable\. The tree is composed by lists of links for the headers, and is usually placed right before the content, as an index\. . .SH "USAGE" For a source file with the following content: . .IP "" 4 . .nf TITLE: Some Title \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- # Header 1 Some content\. ## Header 2 More content\. ### Header 3 Content\. . .fi . .IP "" 0 . .P A template block with the following content: . .IP "" 4 . .nf {% block entry %} {{ TOCTREE }} {% endblock %} . .fi . .IP "" 0 . .P Would generate output similar to this: . .IP "" 4 . .nf
. .fi . .IP "" 0 . .P The depth of the tree can be controlled using the \fBTOCTREE_MAXDEPTH\fR variable, that may be defined globally (see blogc(1)) or for each source file (see blogc\-source(7))\. Setting this variable to \fB0\fR disables the generator\. Setting this variable to a positive number will limit the number of tree levels to such value\. The default value is \fB\-1\fR, which means no maximum depth\. . .P Please note that the depth is evaluated from the lower header level available in the content\. This means that if a source file only have level 2 and level 3 headers, and \fBTOCTREE_MAXDEPTH=1\fR, only headers with level 2 are included in the "table of contents" tree\. . .P For a source file with the following content: . .IP "" 4 . .nf TITLE: Some Title TOCTREE_MAXDEPTH: 1 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- ## Header 2 Some content ### Header 3 More content . .fi . .IP "" 0 . .P With the same template presented before, would generate output similar to this: . .IP "" 4 . .nf . .fi . .IP "" 0 . .SH "BUGS" Please report any issues to: \fIhttps://github\.com/blogc/blogc\fR . .SH "AUTHOR" Rafael G\. Martins <\fIrafael@rafaelmartins\.eng\.br\fR> . .SH "SEE ALSO" blogc(1), blogc\-source(7), blogc\-template(7)