[devdocsgjs/main: 219/239] Improve color scheme.




commit 684d5bb1946fe41e8862f316bdd0dc36a9b961fc
Author: xjkdev <xjk2008 gmail com>
Date:   Thu Mar 10 17:06:36 2022 +0800

    Improve color scheme.
    
    Known issue: space eaten by Nokogiri.

 assets/stylesheets/pages/_eigen3.scss | 160 +++++-----------------------------
 lib/docs/filters/eigen3/clean_html.rb |  11 ++-
 2 files changed, 28 insertions(+), 143 deletions(-)
---
diff --git a/assets/stylesheets/pages/_eigen3.scss b/assets/stylesheets/pages/_eigen3.scss
index ae5c5f99..3505f0aa 100644
--- a/assets/stylesheets/pages/_eigen3.scss
+++ b/assets/stylesheets/pages/_eigen3.scss
@@ -1,12 +1,14 @@
 ._eigen3 {
     /* General */
-    a.el {
-        font-weight: bold;
-    }
     a {
-        color: #3D578C;
         font-weight: normal;
-        text-decoration: none;
+    }
+
+    code {
+        margin: 0 1px;
+        padding: 1px 4px 2px;
+        background: var(--labelBackground);
+        border-radius: 3px;
     }
     /* end General */
 
@@ -24,130 +26,6 @@
     }
     /* end Title */
 
-    /* Fragments */
-    div.fragment {
-        display: table;
-        padding: 4px;
-        border: 1px solid #C4CFE5;
-    }
-    .fragment {
-        text-align: left;
-        direction: ltr;
-        overflow-x: auto;
-        overflow-y: hidden;
-    }
-
-    div.line {
-        font-family: var(--monoFont);
-        font-size: 13px;
-        min-height: 13px;
-        line-height: 1.0;
-        text-wrap: unrestricted;
-        white-space: -moz-pre-wrap;
-        white-space: -pre-wrap;
-        white-space: -o-pre-wrap;
-        white-space: pre-wrap;
-        word-wrap: break-word;
-        // text-indent: -53px;
-        // padding-left: 53px;
-        padding-bottom: 0px;
-        margin: 0px;
-        -webkit-transition-property: background-color, box-shadow;
-        -webkit-transition-duration: 0.5s;
-        -moz-transition-property: background-color, box-shadow;
-        -moz-transition-duration: 0.5s;
-        -ms-transition-property: background-color, box-shadow;
-        -ms-transition-duration: 0.5s;
-        -o-transition-property: background-color, box-shadow;
-        -o-transition-duration: 0.5s;
-        transition-property: background-color, box-shadow;
-        transition-duration: 0.5s;
-    }
-
-    .fragment {
-        text-align: left;
-        direction: ltr;
-        overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/
-        overflow-y: hidden;
-    }
-
-    div.line::after {
-        content: "\000A";
-        white-space: pre;
-    }
-
-    a.code, a.code:visited, a.line, a.line:visited {
-        color: #4665A2;
-    }
-
-    a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited {
-        color: #4665A2;
-    }
-
-    /* end Fragements */
-
-    /* Code Colorization */
-
-    span.keyword {
-        color: var(--prismKeyword)
-    }
-
-    span.keywordtype {
-        color: var(--prismKeyword)
-    }
-
-    span.keywordflow {
-        color: var(--prismKeyword)
-    }
-
-    span.comment {
-        color: var(--textColorLight);
-    }
-
-    span.preprocessor {
-        color: var(--prismKeyword);
-    }
-
-    span.stringliteral {
-        color: var(--prismText);
-    }
-
-    span.charliteral {
-        color: var(--prismText);
-    }
-
-    // span.vhdldigit {
-    //     color: #ff00ff
-    // }
-
-    // span.vhdlchar {
-    //     color: #000000
-    // }
-
-    // span.vhdlkeyword {
-    //     color: #700070
-    // }
-
-    // span.vhdllogic {
-    //     color: #ff0000
-    // }
-
-    // blockquote {
-    //     background-color: #F7F8FB;
-    //     border-left: 2px solid #9CAFD4;
-    //     margin: 0 24px 0 4px;
-    //     padding: 0 12px 0 16px;
-    // }
-
-    // blockquote.DocNodeRTL {
-    //     border-left: 0;
-    //     border-right: 2px solid #9CAFD4;
-    //     margin: 0 4px 0 24px;
-    //     padding: 0 16px 0 12px;
-    // }
-
-    /* end Code Colorization */
-
     /* Member List */
 
     .memtitle {
@@ -189,7 +67,7 @@
 
     .memtemplate {
         font-size: 80%;
-        color: #4665A2;
+        color: var(--prismKeyword);
         font-weight: normal;
         margin-left: 9px;
     }
@@ -204,6 +82,12 @@
         border: none;
     }
 
+    .memproto a.el, .memberdecls a.el {
+        // font-weight: bold;
+        color: var(--prismKeyword);
+        text-decoration: none;
+    }
+
     td.mlabels-left, td.mlabels-right {
         border: none;
         padding: 0;
@@ -244,24 +128,20 @@
     }
 
     .paramname {
-        // color: #602020;
         white-space: nowrap;
       }
 
     span.mlabel {
-        background-color: #728DC1;
-        // border-top: 1px solid #5373B4;
-        // border-left: 1px solid #5373B4;
-        // border-right: 1px solid #C4CFE5;
-        // border-bottom: 1px solid #C4CFE5;
-        text-shadow: none;
-        color: white;
+        // text-shadow: none;
+        font-family: monospace;
+        color: var(--prismKeyword);
         margin-right: 4px;
         padding: 2px 3px;
-        border-radius: 3px;
-        font-size: 7pt;
+        // border-radius: 3px;
+        font-size: 12px;
         white-space: nowrap;
         vertical-align: middle;
       }
     /* end Member Name */
+
 }
diff --git a/lib/docs/filters/eigen3/clean_html.rb b/lib/docs/filters/eigen3/clean_html.rb
index e1215403..21c2a1e2 100644
--- a/lib/docs/filters/eigen3/clean_html.rb
+++ b/lib/docs/filters/eigen3/clean_html.rb
@@ -3,10 +3,15 @@ module Docs
     class CleanHtmlFilter < Filter
 
       def call
-        # TODO doc.inner_html = parse
-        # inner_html = String.new(doc.inner_html).gsub(/<div class="line">(.*?)<\/div>/m, 
"\\1\n").gsub(/<div class="fragment">(.*?)<\/div>/m, '<pre class="fragment">\1</pre>')
-        # doc.inner_html = inner_html
         @doc = at_css('#doc-content')
+
+        css("div.fragment").each do |node|
+          node.css("div.line").each do |node|
+            node.replace(node.inner_html + "\n")
+          end
+          node.replace("<pre data-language=\"cpp\" class=\"fragment\">" + node.inner_html + "</pre>")
+        end
+
         css('#MSearchSelectWindow').remove
         css('#MSearchResultsWindow').remove
         css('.directory .levels').remove


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]