aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc/source-parser.h
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2020-09-11 01:07:43 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2020-09-11 01:15:14 +0200
commitff8898476685e6b7dff03231275a6a8bc2cbaf17 (patch)
treeafe908628d29fac856bd246f7959c53e95ccce4f /src/blogc/source-parser.h
parent15264fdb1062cf27be5c103f6bff5df67a7f78dc (diff)
downloadblogc-ff8898476685e6b7dff03231275a6a8bc2cbaf17.tar.gz
blogc-ff8898476685e6b7dff03231275a6a8bc2cbaf17.tar.bz2
blogc-ff8898476685e6b7dff03231275a6a8bc2cbaf17.zip
blogc: generate table of contents tree
this commit allows users to use the `{{ TOCTREE }}` variable in their templates, to get automatically generated table of contents for entries. The variable is binded to each entry, so it can be used in any block that runs in entry context, like `{% block entry %}`. There's a small performance penalty for this, because the table of contents is rendered for any entry, despite being used or not, and not generated on-demand. still missing documentation. tests are good enough.
Diffstat (limited to 'src/blogc/source-parser.h')
-rw-r--r--src/blogc/source-parser.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blogc/source-parser.h b/src/blogc/source-parser.h
index 8672fb0..2acd753 100644
--- a/src/blogc/source-parser.h
+++ b/src/blogc/source-parser.h
@@ -1,6 +1,6 @@
/*
* blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+ * Copyright (C) 2014-2020 Rafael G. Martins <rafael@rafaelmartins.eng.br>
*
* This program can be distributed under the terms of the BSD License.
* See the file LICENSE.
@@ -13,7 +13,7 @@
#include "../common/error.h"
#include "../common/utils.h"
-bc_trie_t* blogc_source_parse(const char *src, size_t src_len,
+bc_trie_t* blogc_source_parse(const char *src, size_t src_len, int toctree_maxdepth,
bc_error_t **err);
#endif /* _SOURCE_PARSER_H */