From 1d6e80c91ca5a6c4551d89e7a1979490c2505745 Mon Sep 17 00:00:00 2001 From: Harishankar Date: Fri, 22 May 2020 12:07:30 +0530 Subject: [PATCH] Replaced cmake with scons Replaced cmake build with scons --- CMakeLists.txt | 8 -------- SConstruct | 14 ++++++++++++++ biaweb.cpp | 2 ++ biawebstrings.hpp | 1 + templates/style.tpl.css | 22 ++++++++++------------ 5 files changed, 27 insertions(+), 20 deletions(-) delete mode 100644 CMakeLists.txt create mode 100644 SConstruct diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 02a31b7..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required (VERSION 3.0) -project (biaweb2 CXX) -set (CMAKE_CXX_STANDARD 17) -find_library (MARKDOWN markdown) -find_library (FMT fmt) -add_executable (biaweb biaweb.cpp) -target_link_libraries (biaweb "${MARKDOWN}" "${FMT}") - diff --git a/SConstruct b/SConstruct new file mode 100644 index 0000000..d9a3794 --- /dev/null +++ b/SConstruct @@ -0,0 +1,14 @@ +env = Environment () +env.Append (CXXFLAGS = '-std=c++17') +conf = Configure (env) +if not conf.CheckCHeader ("mkdio.h"): + print ("markdown header mkdio not found. Install libmarkdown2-dev or equivalent") + Exit (1) +if not conf.CheckCXXHeader ("fmt/format.h"): + print ("libfmt header file fmt/format.h not found. Install the libfmt-dev or equivalent") + Exit (1) +env = conf.Finish () +biaweb = env.Program (target='biaweb', source=['biaweb.cpp'], + LIBS=['fmt', 'markdown'], LIBPATH=['/usr/lib', '/usr/local/lib']) +Default (biaweb) + diff --git a/biaweb.cpp b/biaweb.cpp index f720fe0..d0c284e 100644 --- a/biaweb.cpp +++ b/biaweb.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "biawebdocumenttree.hpp" using namespace biaweb; @@ -10,6 +11,7 @@ int main (int argc, char *argv[]) { // An empty document tree std::unique_ptr tree (new DocumentTree ("")); tree.get()->document_tree_builder ("Test/Reviews"); + std::cout << VISUALIZE_TREE << std::endl; tree.get()->visualize_tree (); Template tpl ("templates"); tree.get()->create_tree_html (&tpl, "Test/Out"); diff --git a/biawebstrings.hpp b/biawebstrings.hpp index 970fede..55f4177 100644 --- a/biawebstrings.hpp +++ b/biawebstrings.hpp @@ -7,6 +7,7 @@ namespace biaweb { const char* NO_SUCH_PATH_ERROR = "No such path! Specify an existing file path" ; const char* DATE_IN_FORMAT = "%Y-%m-%d %H:%M %Z"; const char* GENERATED_IN = "Generated in (s): "; + const char* VISUALIZE_TREE = "Generated document tree: "; // NAMED INDEX FOR DOCUMENT STRING BITS (LOADED FROM TEMPLATE FILE stringbits.txt) const unsigned int HOME = 0; diff --git a/templates/style.tpl.css b/templates/style.tpl.css index 2f9d6b5..ec2e68b 100644 --- a/templates/style.tpl.css +++ b/templates/style.tpl.css @@ -1,14 +1,17 @@ body { background-color:white; color: black; - font-family:Verdana, Geneva, Tahoma, sans-serif; - font-size: 0.9em; + font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; + font-size: 1em; margin: 0; padding: 0; } - h1, h2, h3, h4, h5, h6 { font-family: Georgia, 'Times New Roman', Times, serif; + background-color: whitesmoke; +} +header h1 { + background: none; } header { width: 100%; @@ -21,40 +24,33 @@ header { width: 100%; text-align: left; } - .doclisttable thead { font-weight: bold; } - .doclisttable tbody { color: #3f3f3f; } - .doclisttable td { padding:0.2em; } - .inlinelist { display: inline-block; padding: 0em; margin: 0em; } - .inlinelist li { display: inline-block; margin-right: 0.9em; } - div#modification { width: 100%; color:darkgray; font-size: 0.8em; - float:left; } div#navbit { width: 100%; - float: left; font-size: 0.8em; + background: none; } footer { width: 100%; @@ -70,7 +66,9 @@ nav#sidebar { width: 30%; padding: 1%; } - +nav#sidebar h2 { + background: none; +} section#content { width: 63%; margin-right:1%; -- 2.20.1