diff --git a/config/debug_tawashi.ini.in b/config/debug_tawashi.ini.in index cc6e2c5..56aa2ec 100644 --- a/config/debug_tawashi.ini.in +++ b/config/debug_tawashi.ini.in @@ -4,6 +4,7 @@ redis_port = 6379 redis_mode = inet host_name = 127.0.0.1 host_port = from_downstream +highlight_css = sh_greenlcd.css website_root = @CMAKE_CURRENT_BINARY_DIR@/html logging_level = trace log_file = @CMAKE_CURRENT_BINARY_DIR@/tawashi.log diff --git a/src/tawashi/main.cpp b/src/tawashi/main.cpp index 49352f4..61fa12e 100644 --- a/src/tawashi/main.cpp +++ b/src/tawashi/main.cpp @@ -81,6 +81,7 @@ namespace { parSettings.add_default("logging_level", "err"); parSettings.add_default("resubmit_wait", "10"); parSettings.add_default("log_file", "-"); + parSettings.add_default("highlight_css", "sh_darkness.css"); } void print_buildtime_info() { diff --git a/src/tawashi_implem/pastie_response.cpp b/src/tawashi_implem/pastie_response.cpp index 6b54310..53db370 100644 --- a/src/tawashi_implem/pastie_response.cpp +++ b/src/tawashi_implem/pastie_response.cpp @@ -28,6 +28,11 @@ namespace tawashi { namespace { const char g_nolang_token[] = "colourless"; + + std::string highlight_css_path (const SettingsBag& parSettings) { + //TODO: make sure the file exists or throw or do something + return parSettings.as("highlight_css"); + } } //unnamed namespace PastieResponse::PastieResponse ( @@ -84,7 +89,7 @@ namespace tawashi { #endif highlighter.setCanUseStdOut(false); highlighter.setTabSpaces(4); - highlighter.setStyleCssFile("sh_darkness.css"); + highlighter.setStyleCssFile(highlight_css_path(settings())); highlighter.setGenerateLineNumbers(false); std::string processed_pastie;