From 3d5ff9053ce8904dd2e687df03e59aef0f9f446e Mon Sep 17 00:00:00 2001 From: TimReset Date: Mon, 11 Sep 2023 23:28:06 +0200 Subject: [PATCH] AsciiDoc: Support view-mode light theme, by @TimReset (#1880 #2091 #2092) --- .../gsantner/markor/format/asciidoc/AsciidocTextConverter.java | 3 ++- app/src/main/res/raw/licenses_3rd_party.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/gsantner/markor/format/asciidoc/AsciidocTextConverter.java b/app/src/main/java/net/gsantner/markor/format/asciidoc/AsciidocTextConverter.java index a2a8384e9..4f9f6ce16 100644 --- a/app/src/main/java/net/gsantner/markor/format/asciidoc/AsciidocTextConverter.java +++ b/app/src/main/java/net/gsantner/markor/format/asciidoc/AsciidocTextConverter.java @@ -11,6 +11,7 @@ import net.gsantner.markor.format.TextConverterBase; import net.gsantner.opoc.format.GsTextUtils; +import net.gsantner.opoc.util.GsContextUtils; import java.io.File; import java.util.Arrays; @@ -52,7 +53,7 @@ public String convertMarkup(String markup, Context context, boolean lightMode, b //standalone : true - to generate header 1 (= title) in the page. if don't do that - title will be absent. //nofooter: true - to don't generate footer (Last updated ...). if don't do that and use standalone : true - the page will have that footer. "var html = asciidoctor.convert(utf8PlainText, {standalone : true, attributes : {nofooter: true, stylesheet: \"" + - (lightMode ? HTML_ASCIIDOCJS_DEFAULT_CSS_INCLUDE : HTML_ASCIIDOCJS_DARK_CSS_INCLUDE) + (!lightMode && GsContextUtils.instance.isDarkModeEnabled(context) ? HTML_ASCIIDOCJS_DARK_CSS_INCLUDE : HTML_ASCIIDOCJS_DEFAULT_CSS_INCLUDE) + "\"}});\n" + "document.getElementById(\"asciidoc_content\").innerHTML = html;"; return putContentIntoTemplate(context, converted, lightMode, file, onLoadJs, HTML_ASCIIDOCJS_JS_INCLUDE); diff --git a/app/src/main/res/raw/licenses_3rd_party.md b/app/src/main/res/raw/licenses_3rd_party.md index d302223ba..1e0f56045 100644 --- a/app/src/main/res/raw/licenses_3rd_party.md +++ b/app/src/main/res/raw/licenses_3rd_party.md @@ -17,7 +17,7 @@ * asciidoctor.js ~° Copyright asciidoctor.js authors -* asciidoctor-skins +asciidoctor-skins ~° Copyright asciidoctor-skins authors * flexmark-ext-prism-linenumber