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]));
11 tree
.get()->set_stub ("");
13 std::shared_ptr
<DocumentTree
> a1 (new DocumentTree("Child a1"));
14 std::shared_ptr
<DocumentTree
> a2 (new DocumentTree("Child a2"));
15 std::shared_ptr
<DocumentTree
> a3 (new DocumentTree("Child a3"));
16 std::shared_ptr
<DocumentTree
> a4 (new DocumentTree("Child a4"));
17 a3
.get()->add_child (a4
.get());
18 a1
.get()->add_child (a2
.get());
19 a1
.get()->add_child (a3
.get());
20 tree
.get()->add_child (a1
.get());
21 std::cout
<< a3
.get()->stub_hierarchy () << a3
.get()->get_stub () << std::endl
;
22 tree
.get()->visualize_tree ();
23 tree
.get()->create_index (convert_title (argv
[1]));
26 std::cout
<< "Usage: " << argv
[0] << " <main tree>" << std::endl
;
30 // std::string title, contents, sidetitle;
31 // std::cout << "Enter document title: ";
32 // std::getline (std::cin, title);
33 // std::cout << "Enter markdown file of document: ";
34 // std::getline (std::cin, contents);
36 // std::string name, url;
37 // std::cout << "Enter a sidebar item text (empty to end): ";
38 // std::getline (std::cin, name);
39 // if (name.empty()) break;
40 // std::cout << "Enter a sidebar item URL: ";
41 // std::getline (std::cin, url);
42 // SideBarItem item (name, url);
43 // items.add_sidebar_item (item);
45 // std::cout << "Enter heading for sidebar: ";
46 // std::getline (std::cin, sidetitle);
47 // items.set_title (sidetitle);
48 // doc.set_title (title);
49 // std::ifstream f (contents);
50 // std::string markdown_contents ( (std::istreambuf_iterator<char> (f)),
51 // (std::istreambuf_iterator<char> ()) );
53 // doc.set_markdown_content (markdown_contents);
54 // doc.add_side_bar (items);
56 // doc.output_to_html ();