X-Git-Url: https://harishankar.org/repos/?p=biaweb2.git;a=blobdiff_plain;f=biawebdocumenttree.hpp;h=a65e334cc75667cb1e1248f560297448128cfb5a;hp=cf75c867d2cced1e7d6f013c8fbf8f36cb88c0dc;hb=f56e2150cc79638c890ef23ef82097a4bdffd2ce;hpb=abd61eb094efbfca05e6fe0f1dd34a3e8e7de7a2 diff --git a/biawebdocumenttree.hpp b/biawebdocumenttree.hpp index cf75c86..a65e334 100644 --- a/biawebdocumenttree.hpp +++ b/biawebdocumenttree.hpp @@ -17,6 +17,9 @@ namespace biaweb { std::list children; // title of this tree std::string title; + // summary for this tree - this is displayed in the index.html file of + // this tree before the list of articles in the tree + std::string summary; // file stub of this tree std::string stub; // list of documents in this tree @@ -40,6 +43,20 @@ namespace biaweb { this->parent = nullptr; } + // set the summary for this tree + void set_summary (std::string summary) { + this->summary = summary; + } + + // set the summary for this tree as markdown text + void set_markdown_summary (std::string summary) { + this->summary = convert_to_markdown (summary); + } + + std::string get_summary () { + return this->summary; + } + // create the document index for this tree void create_tree_html (std::string destdir); @@ -196,7 +213,7 @@ namespace biaweb { doc.add_side_bar (*bar2.get()); doc.output_to_html (filepath); } - index.get()->set_content (article_list.to_html()); + index.get()->set_content (this->summary + article_list.to_html()); index.get()->output_to_html (filepath);