From 01314f53987e57c4fcb49fb86d3971bdb206857f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Feb 2016 05:53:12 +0200 Subject: Add support for ids in paragraphs, local fragment references in links For example: " \h#hello|Hello Example| See the \l{#hello Hello Example} " --- cli/context.hxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cli/context.hxx') diff --git a/cli/context.hxx b/cli/context.hxx index 79c9aab..c67cec5 100644 --- a/cli/context.hxx +++ b/cli/context.hxx @@ -99,6 +99,11 @@ public: regex_mapping const& link_regex; + typedef std::set id_set_type; + id_set_type& id_set; + id_set_type& ref_set; + + // TOC phase. // // 0 - non-TOC @@ -126,6 +131,8 @@ private: string cli_; keyword_set_type keyword_set_; regex_mapping link_regex_; + id_set_type id_set_; + id_set_type ref_set_; unsigned short toc_; toc_stack tocs_; }; @@ -166,6 +173,13 @@ public: string end_toc (); + // Make sure each local fragment reference has the corresponding id. Issue + // diagnostics and throw generation_failed if fails. Otherwise clear the + // id and ref sets. + // + void + verify_id_ref (); + // Substitute doc variable expansions ($var$). Var must be a C identifier. // If the path is not NULL, then also recognize names that start with either // ./ or ../ and treat them as files relative to path. Such file expansions -- cgit v1.1