From 77a3e41fb1fa01fe739c5c450a374498abe7f6d0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 11 Nov 2018 19:22:30 -0500 Subject: 0.3.2 css themes, --dark & --light (default) --- org/output_xmls.org | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'org/output_xmls.org') diff --git a/org/output_xmls.org b/org/output_xmls.org index ab0536d..5a39bfd 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -675,13 +675,13 @@ string lev4_heading_subtoc(M,O)( lev4_subtoc ~= "
\n"; foreach (subtoc; obj.tags.lev4_subtoc) { if (auto m = subtoc.match(rgx.inline_link_subtoc)) { - auto indent = m.captures[1].to!string; + auto indent = (m.captures[1].to!int - 3).to!string; // css assumptions based on use of em for left margin & indent auto text = m.captures[2].to!string; text = font_face(text); auto link = m.captures[3].to!string; lev4_subtoc ~= subtoc.replaceFirst(rgx.inline_link_subtoc, format(q"¶

- %s + ۰ %s

¶", indent, @@ -1296,7 +1296,7 @@ auto code(M,O)( if (!(obj.metainfo.identifier.empty)) { o = format(q"¶
-

%s

+

%s

¶", obj.metainfo.identifier, (obj.metainfo.object_number.empty) ? "" : obj.metainfo.identifier, @@ -1306,7 +1306,7 @@ auto code(M,O)( ); } else { o = format(q"¶
-

%s

+

%s

¶", obj.metainfo.is_a, _txt @@ -1958,9 +1958,13 @@ void css(M)( (pth_html.css).mkdirRecurse; } auto f = File(pth_html.fn_seg_css, "w"); - f.writeln(css.html_seg_css); + (doc_matters.opt.action.css_theme_default) + ? f.writeln(css.light.html_seg) + : f.writeln(css.dark.html_seg); f = File(pth_html.fn_scroll_css, "w"); - f.writeln(css.html_scroll_css); + (doc_matters.opt.action.css_theme_default) + ? f.writeln(css.light.html_scroll) + : f.writeln(css.dark.html_scroll); } catch (ErrnoException ex) { // Handle error } @@ -2867,14 +2871,18 @@ void epub3_write_output_files(M,D,E,Mt,Mic,Otnx,Otn,Oc)( { /+ debug +/ if (doc_matters.opt.action.debug_do) { fn_dbg = pth_epub3.dbg_fn_oebps_css(doc_matters.src.filename); - File(fn_dbg, "w").writeln(css.epub_css); + (doc_matters.opt.action.css_theme_default) + ? File(fn_dbg, "w").writeln(css.light.epub) + : File(fn_dbg, "w").writeln(css.dark.epub); } } fn = pth_epub3.fn_oebps_css(doc_matters.src.filename); auto zip_arc_member_file = new ArchiveMember(); zip_arc_member_file.name = fn; auto zip_data = new OutBuffer(); - zip_data.write(css.epub_css.dup); + (doc_matters.opt.action.css_theme_default) + ? zip_data.write(css.light.epub.dup) + : zip_data.write(css.dark.epub.dup); zip_arc_member_file.expandedData = zip_data.toBytes(); zip.addMember(zip_arc_member_file); createZipFile!()(fn_epub, zip.build()); -- cgit v1.2.3