From 6b0b671264aaaba574476742c7aef3b2fdee1ca6 Mon Sep 17 00:00:00 2001 From: abap34 Date: Fri, 10 Nov 2023 03:37:59 +0900 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E4=BD=93=E3=83=86=E3=83=BC=E3=83=9E?= =?UTF-8?q?=E3=81=A8css=E3=82=92=E5=90=8C=E6=99=82=E3=81=AB=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=81=97=E3=81=9F=E6=99=82=E3=81=AB=E5=8F=8D=E6=98=A0?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/almo.cpp | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/almo.cpp b/src/almo.cpp index f0b9e1b..23c99cb 100644 --- a/src/almo.cpp +++ b/src/almo.cpp @@ -8,10 +8,10 @@ int main(int argc, char* argv[]) { // コマンドライン引数のデフォルト値を設定 std::string theme = "light"; - std::string css_setting = "light"; + std::string css_setting = "__default__"; bool debug = false; - std::string editor_theme = "ace/theme/xcode"; - std::string syntax_theme = "github.min"; + std::string editor_theme = "__default__"; + std::string syntax_theme = "__default__"; bool plot_graph = false; std::string out_path = "__stdout__"; @@ -67,13 +67,33 @@ int main(int argc, char* argv[]) { } - // もし theme が dark であれば、 editor_theme と syntax_theme も対応したものにしておく - if (theme == "dark") { - editor_theme = "ace/theme/monokai"; - syntax_theme = "monokai-sublime.min"; - css_setting = "dark"; + // もし theme が dark であれば、 editor_theme と syntax_theme がデフォルトの場合対応したものにしておく + if (theme == "light") { + if (editor_theme == "__default__") { + editor_theme = "ace/theme/chrome"; + } + + if (syntax_theme == "__default__") { + syntax_theme = "github.min"; + } + + if (css_setting == "__default__") { + css_setting = "light"; + } } + else if (theme == "dark") { + if (editor_theme == "__default__") { + editor_theme = "ace/theme/monokai"; + } + + if (syntax_theme == "__default__") { + syntax_theme = "monokai.min"; + } + if (css_setting == "__default__") { + css_setting = "dark"; + } + } // パース auto [meta_data, ast] = almo::parse_md_file(argv[1]);