X-Git-Url: https://harishankar.org/repos/?p=biaweb2.git;a=blobdiff_plain;f=biaweb.cpp;h=22e41213c342de346a459c7fe46133227186956f;hp=0d9a3e897f88bf7e4a339c6063fa7aa532bc3d6c;hb=44d5fb1ff24147859c5f198dd47f6956ec5fea51;hpb=406aa544d873974501056201467c88366f9d31f9 diff --git a/biaweb.cpp b/biaweb.cpp index 0d9a3e8..22e4121 100644 --- a/biaweb.cpp +++ b/biaweb.cpp @@ -5,25 +5,43 @@ using namespace biaweb; int main (int argc, char *argv[]) { - if (argc == 2) - { - std::shared_ptr tree (new DocumentTree (argv[1])); - tree.get()->set_stub (""); - - std::shared_ptr a1 (new DocumentTree("Child a1")); - std::shared_ptr a2 (new DocumentTree("Child a2")); - std::shared_ptr a3 (new DocumentTree("Child a3")); - std::shared_ptr a4 (new DocumentTree("Child a4")); - a3.get()->add_child (a4.get()); - a1.get()->add_child (a2.get()); - a1.get()->add_child (a3.get()); - tree.get()->add_child (a1.get()); - std::cout << a3.get()->stub_hierarchy () << a3.get()->get_stub () << std::endl; - tree.get()->visualize_tree (); - tree.get()->create_index (convert_title (argv[1])); - } - else - std::cout << "Usage: " << argv[0] << "
" << std::endl; +// if (argc == 2) +// { +// std::shared_ptr tree (new DocumentTree (argv[1])); +// tree.get()->set_stub (""); +// tree.get()->set_markdown_summary ("# Hello there\n\n\ +// These are some contents for this page."); + +// std::shared_ptr a1 (new DocumentTree("Child a1")); +// std::shared_ptr a2 (new DocumentTree("Child a2")); +// std::shared_ptr a3 (new DocumentTree("Child a3")); +// std::shared_ptr a4 (new DocumentTree("Child a4")); +// std::shared_ptr d2 (new Document ("Another document")); +// d2.get()->set_creation_date (124012); +// std::shared_ptr d1 (new Document("Test Document")); +// d1.get()->set_creation_date (100000); +// d1.get()->set_markdown_content ("# Heading \n\nThis is some text, hello world"); +// d2.get()->set_markdown_content ("Some document \n\nThis is some document"); +// a1.get()->add_document (d2.get()); +// a1.get()->add_document (d1.get()); +// a3.get()->add_child (a4.get()); +// a1.get()->add_child (a2.get()); +// a1.get()->add_child (a3.get()); +// tree.get()->add_child (a1.get()); +// std::cout << a3.get()->stub_hierarchy () << a3.get()->get_stub () << std::endl; +// tree.get()->visualize_tree (); +// tree.get()->create_tree_html ("/home/hari/Projects/BiaWeb2/templates", +// convert_title (argv[1])); +// } +// // else { +// // std::cout << "Usage: " << argv[0] << "
" << std::endl; + + DocumentTree tree (""); + tree.document_tree_builder ("Test/Reviews"); + tree.visualize_tree (); + tree.create_tree_html ("templates", + "Test/Out"); +// // } // Document doc; // SideBar items;