Separated the strings used for document tree generation from code
[biaweb2.git] / biaweb.cpp
1 #include <iostream>
2 #include <fstream>
3 #include "biawebdocumenttree.hpp"
4 using namespace biaweb;
5
6 int main (int argc, char *argv[]) {
7
8 // if (argc == 2)
9 // {
10 // std::shared_ptr<DocumentTree> tree (new DocumentTree (argv[1]));
11 // tree.get()->set_stub ("");
12 // tree.get()->set_markdown_summary ("# Hello there\n\n\
13 // These are some contents for this page.");
14
15 // std::shared_ptr<DocumentTree> a1 (new DocumentTree("Child a1"));
16 // std::shared_ptr<DocumentTree> a2 (new DocumentTree("Child a2"));
17 // std::shared_ptr<DocumentTree> a3 (new DocumentTree("Child a3"));
18 // std::shared_ptr<DocumentTree> a4 (new DocumentTree("Child a4"));
19 // std::shared_ptr<Document> d2 (new Document ("Another document"));
20 // d2.get()->set_creation_date (124012);
21 // std::shared_ptr<Document> d1 (new Document("Test Document"));
22 // d1.get()->set_creation_date (100000);
23 // d1.get()->set_markdown_content ("# Heading \n\nThis is some text, hello world");
24 // d2.get()->set_markdown_content ("Some document \n\nThis is some document");
25 // a1.get()->add_document (d2.get());
26 // a1.get()->add_document (d1.get());
27 // a3.get()->add_child (a4.get());
28 // a1.get()->add_child (a2.get());
29 // a1.get()->add_child (a3.get());
30 // tree.get()->add_child (a1.get());
31 // std::cout << a3.get()->stub_hierarchy () << a3.get()->get_stub () << std::endl;
32 // tree.get()->visualize_tree ();
33 // tree.get()->create_tree_html ("/home/hari/Projects/BiaWeb2/templates",
34 // convert_title (argv[1]));
35 // }
36 // // else {
37 // // std::cout << "Usage: " << argv[0] << " <main tree>" << std::endl;
38
39 DocumentTree tree ("");
40 tree.document_tree_builder ("Test/Reviews");
41 tree.visualize_tree ();
42 tree.create_tree_html ("templates",
43 "Test/Out");
44 // // }
45
46 // Document doc;
47 // SideBar items;
48 // std::string title, contents, sidetitle;
49 // std::cout << "Enter document title: ";
50 // std::getline (std::cin, title);
51 // std::cout << "Enter markdown file of document: ";
52 // std::getline (std::cin, contents);
53 // while (1) {
54 // std::string name, url;
55 // std::cout << "Enter a sidebar item text (empty to end): ";
56 // std::getline (std::cin, name);
57 // if (name.empty()) break;
58 // std::cout << "Enter a sidebar item URL: ";
59 // std::getline (std::cin, url);
60 // SideBarItem item (name, url);
61 // items.add_sidebar_item (item);
62 // }
63 // std::cout << "Enter heading for sidebar: ";
64 // std::getline (std::cin, sidetitle);
65 // items.set_title (sidetitle);
66 // doc.set_title (title);
67 // std::ifstream f (contents);
68 // std::string markdown_contents ( (std::istreambuf_iterator<char> (f)),
69 // (std::istreambuf_iterator<char> ()) );
70
71 // doc.set_markdown_content (markdown_contents);
72 // doc.add_side_bar (items);
73
74 // doc.output_to_html ();
75
76 return 0;
77 }