Readme.md - added Section for customization and notes
[biaweb2.git] / biaweb.cpp
index 0d9a3e8..8e87ab8 100644 (file)
@@ -1,59 +1,7 @@
-#include <iostream>
-#include <fstream>
-#include "biawebdocumenttree.hpp"
-using namespace biaweb;
-
-int main (int argc, char *argv[]) {
-
-    if (argc == 2)
-    {
-        std::shared_ptr<DocumentTree> tree (new DocumentTree (argv[1]));
-        tree.get()->set_stub ("");
-
-        std::shared_ptr<DocumentTree> a1 (new DocumentTree("Child a1"));
-        std::shared_ptr<DocumentTree> a2 (new DocumentTree("Child a2"));
-        std::shared_ptr<DocumentTree> a3 (new DocumentTree("Child a3"));
-        std::shared_ptr<DocumentTree> 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] << " <main tree>" << std::endl;
-
-    // Document doc;
-    // SideBar items;
-    // std::string title, contents, sidetitle;
-    // std::cout << "Enter document title: ";
-    // std::getline (std::cin, title);
-    // std::cout << "Enter markdown file of document: ";
-    // std::getline (std::cin, contents);
-    // while (1) {
-    //     std::string name, url;
-    //     std::cout << "Enter a sidebar item text (empty to end): ";
-    //     std::getline (std::cin, name);
-    //     if (name.empty()) break;
-    //     std::cout << "Enter a sidebar item URL: ";
-    //     std::getline (std::cin, url);
-    //     SideBarItem item (name, url);
-    //     items.add_sidebar_item (item);
-    // }
-    // std::cout << "Enter heading for sidebar: ";
-    // std::getline (std::cin, sidetitle);
-    // items.set_title (sidetitle);
-    // doc.set_title (title);
-    // std::ifstream f (contents);
-    // std::string markdown_contents ( (std::istreambuf_iterator<char> (f)),
-    //                                 (std::istreambuf_iterator<char> ()) );
-
-    // doc.set_markdown_content (markdown_contents);
-    // doc.add_side_bar (items);
-
-    // doc.output_to_html ();
-
-    return 0;
-}
+#include "biawebmain.hpp"
+#include <unistd.h>
+using namespace biaweb; 
+int main (int argc, char **argv) {
+    Main prog (argc, argv);
+    return prog.run ();
+}
\ No newline at end of file