3 #include "biawebdocumenttree.hpp"
4 using namespace biaweb
;
6 int main (int argc
, char *argv
[]) {
10 std::shared_ptr
<DocumentTree
> tree (new DocumentTree (argv
[1]));
12 std::shared_ptr
<DocumentTree
> a1 (new DocumentTree("Child a1"));
13 std::shared_ptr
<DocumentTree
> a2 (new DocumentTree("Child a2"));
14 std::shared_ptr
<DocumentTree
> a3 (new DocumentTree("Child a3"));
15 std::shared_ptr
<DocumentTree
> a4 (new DocumentTree("Child a4"));
16 a3
.get()->add_child (a4
.get());
17 a1
.get()->add_child (a2
.get());
18 a1
.get()->add_child (a3
.get());
19 tree
.get()->add_child (a1
.get());
20 std::cout
<< a3
.get()->stub_hierarchy () << a3
.get()->get_stub () << std::endl
;
21 tree
.get()->visualize_tree ();
22 tree
.get()->create_index ();
25 std::cout
<< "Usage: " << argv
[0] << " <main tree>" << std::endl
;
29 // std::string title, contents, sidetitle;
30 // std::cout << "Enter document title: ";
31 // std::getline (std::cin, title);
32 // std::cout << "Enter markdown file of document: ";
33 // std::getline (std::cin, contents);
35 // std::string name, url;
36 // std::cout << "Enter a sidebar item text (empty to end): ";
37 // std::getline (std::cin, name);
38 // if (name.empty()) break;
39 // std::cout << "Enter a sidebar item URL: ";
40 // std::getline (std::cin, url);
41 // SideBarItem item (name, url);
42 // items.add_sidebar_item (item);
44 // std::cout << "Enter heading for sidebar: ";
45 // std::getline (std::cin, sidetitle);
46 // items.set_title (sidetitle);
47 // doc.set_title (title);
48 // std::ifstream f (contents);
49 // std::string markdown_contents ( (std::istreambuf_iterator<char> (f)),
50 // (std::istreambuf_iterator<char> ()) );
52 // doc.set_markdown_content (markdown_contents);
53 // doc.add_side_bar (items);
55 // doc.output_to_html ();