Skip to content

Commit

Permalink
Merge pull request #56 from abap34/dev
Browse files Browse the repository at this point in the history
全体テーマとcssを同時に指定した時に反映されないバグを修正
  • Loading branch information
abap34 authored Nov 9, 2023
2 parents ea0d6ac + 6b0b671 commit ee32ba9
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions src/almo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__";

Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit ee32ba9

Please sign in to comment.