1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-11-27 00:43:47 +00:00

Allow to give the css file for the highlighter in tawashi.ini

This commit is contained in:
King_DuckZ 2017-05-23 18:31:55 +01:00
parent 7ada0f155b
commit 2571e70093
3 changed files with 8 additions and 1 deletions

View file

@ -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

View file

@ -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() {

View file

@ -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<std::string>("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;