Skip to content

Commit

Permalink
AsciiDoc: Support view-mode light theme, by @TimReset (#1880 #2091 #2092
Browse files Browse the repository at this point in the history
)
  • Loading branch information
TimReset authored Sep 11, 2023
1 parent 6ed0e8d commit 3d5ff90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/raw/licenses_3rd_party.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* asciidoctor.js
~° Copyright asciidoctor.js authors

* asciidoctor-skins
asciidoctor-skins
~° Copyright asciidoctor-skins authors

* flexmark-ext-prism-linenumber
Expand Down

0 comments on commit 3d5ff90

Please sign in to comment.