incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1345853 - in /sling/site/trunk: content/res/codehilite.css content/res/site.css readme.txt templates/skeleton.html
Date Mon, 04 Jun 2012 07:45:50 GMT
Author: fmeschbe
Date: Mon Jun  4 07:45:49 2012
New Revision: 1345853

URL: http://svn.apache.org/viewvc?rev=1345853&view=rev
Log:
SLING-2002 Improve code high lighting

Added:
    sling/site/trunk/content/res/codehilite.css
Modified:
    sling/site/trunk/content/res/site.css
    sling/site/trunk/readme.txt
    sling/site/trunk/templates/skeleton.html

Added: sling/site/trunk/content/res/codehilite.css
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/res/codehilite.css?rev=1345853&view=auto
==============================================================================
--- sling/site/trunk/content/res/codehilite.css (added)
+++ sling/site/trunk/content/res/codehilite.css Mon Jun  4 07:45:49 2012
@@ -0,0 +1,429 @@
+/*************************************************************************
+
+    For reference: classes defined by the Confluence batch.css
+    
+.code {
+    border-width: 1px;
+    border-style: dashed;
+    overflow: auto;
+}
+
+.code,.preformatted {
+    background-color: #fff;
+}
+
+.code pre,.preformatted pre {
+    font-family: "Courier New", Courier, monospace;
+    line-height: 1.3;
+}
+
+.code-keyword {
+    color: #000091;
+    background-color: inherit;
+}
+
+.code-object {
+    color: #910091;
+    background-color: inherit;
+}
+
+.code-quote {
+    color: #009100;
+    background-color: inherit;
+}
+
+.code-comment {
+    color: #808080;
+    background-color: inherit;
+}
+
+.code-xml .code-keyword {
+    color: inherit;
+    font-weight: bold;
+}
+
+.code-tag {
+    color: #000091;
+    background-color: inherit;
+}
+
+*/
+
+/*************************************************************************
+
+    For reference: classes defined by the old Sling Site CSS
+
+.codehilite {
+    color: black;
+    background-color: #f0f0f0;
+    border: solid 1px black;
+    margin-top: 0.5em;
+    margin-bottom: 0.5em;
+    padding: 0.5em
+}
+
+.codeHeader {
+    text-align: center;
+    font-family: monospace;
+    border-bottom: 1px solid black;
+    padding-top: 0.5em;
+    padding-bottom: 0.5em;
+    margin-bottom: 0.5em;
+}
+
+
+.codehilite pre {
+    margin: 0em
+}
+
+.code-keyword {
+    color: #880000
+}
+
+.code-quote {
+    color: #008800
+}
+
+.code-object {
+    color: #0000dd
+}
+
+.code-java {
+    margin: 0em
+}
+
+*/
+
+/**
+  Apache CMS Code High Lighting
+
+  HTML structure for default (:::, un-numbered code)
+  
+  <div class="codehilite">
+    <pre>
+    ... span-tagged code ...
+    </pre>
+  </div>
+
+
+  HTML structure for #! (line numbered code)
+  
+  <table class="codehilitetable">
+    <tr>
+        <td class="linenos">
+            <div class="linenodiv">
+                <pre>
+                ... line numbers ...
+                </pre>
+            </div>
+        </td>
+        <td class="code">
+            <div class="codehilite">
+                <pre>
+                ... span-tagged code ...
+                </pre>
+            </div>
+        </td>
+    </tr>
+  </table>
+*/
+
+.codehilitetable, .codehilite {
+    color: black;
+    background-color: #f0f0f0;
+    border: solid 1px black;
+    margin-top: 0.5em;
+    margin-bottom: 0.5em;
+    padding: 0.5em;
+}
+
+.codehilitetable .linenos {
+    border: none;
+}
+
+.codehilitetable .linenos .linenodiv {
+}
+
+.codehilitetable .linenos .linenodiv pre {
+    margin: 0px;
+    padding: 0px;
+}
+
+.codehilitetable .code {
+    border: none;
+}
+
+.codehilitetable .code .codehilite {
+    /** overwrite from .codehilite class above */
+    border: none;
+    margin: 0px;
+    padding: 0px;
+}
+
+.codehilite pre {
+    /* Applies to both .codehilite divs, top level and in table */
+    margin: 0px;
+    padding: 0px;
+    overflow: auto;
+}
+
+
+/**
+ * Pygments Code Formatter Styles
+ */
+ 
+/** Whitespace */
+.codehilite .w {
+}
+/** Error */
+.codehilite .err {
+}
+/** Other */
+.codehilite .x {
+}
+
+/** Keyword */
+.codehilite .k {
+    color: #880000
+}
+/** Keyword.Constant */
+.codehilite .kc {
+    color: #880000
+}
+/** Keyword.Declaration */
+.codehilite .kd {
+    color: #880000
+}
+/** Keyword.Namespace */
+.codehilite .kn {
+    color: #880000
+}
+/** Keyword.Pseudo */
+.codehilite .kp {
+    color: #880000
+}
+/** Keyword.Reserved */
+.codehilite .kr {
+    color: #880000
+}
+/** Keyword.Type */
+.codehilite .kt {
+    color: #880000
+}
+    
+/** Name */
+.codehilite .n {
+    color: #0000dd
+}
+/** Name.Attribute */
+.codehilite .na {
+    color: #0000dd
+}
+/** Name.Builtin */
+.codehilite .nb {
+    color: #0000dd
+}
+/** Name.Builtin.Pseudo */
+.codehilite .bp {
+    color: #0000dd
+}
+/** Name.Class */
+.codehilite .nc {
+    color: #0000dd
+}
+/** Name.Constant */
+.codehilite .no {
+    color: #0000dd
+}
+/** Name.Decorator */
+.codehilite .nd {
+    color: #0000dd
+}
+/** Name.Entity */
+.codehilite .ni {
+    color: #0000dd
+}
+/** Name.Exception */
+.codehilite .ne {
+    color: #0000dd
+}
+/** Name.Function */
+.codehilite .nf {
+    color: #0000dd
+}
+/** Name.Property */
+.codehilite .py {
+    color: #0000dd
+}
+/** Name.Label */
+.codehilite .nl {
+    color: #0000dd
+}
+/** Name.Namespace */
+.codehilite .nn {
+    color: #0000dd
+}
+/** Name.Other */
+.codehilite .nx {
+    color: #0000dd
+}
+/** Name.Tag */
+.codehilite .nt {
+    color: #0000dd
+}
+/** Name.Variable */
+.codehilite .nv {
+    color: #0000dd
+}
+/** Name.Variable.Class */
+.codehilite .vc {
+    color: #0000dd
+}
+/** Name.Variable.Global */
+.codehilite .vg {
+    color: #0000dd
+}
+/** Name.Variable.Instance */
+.codehilite .vi {
+    color: #0000dd
+}
+    
+/** Literal */
+.codehilite .l {
+}
+/** Literal.Date */
+.codehilite .ld {
+}
+
+/** String */
+.codehilite .s {
+    color: #008800
+}
+/** String.Backtick */
+.codehilite .sb {
+    color: #008800
+}
+/** String.Char */
+.codehilite .sc {
+    color: #008800
+}
+/** String.Doc */
+.codehilite .sd {
+    color: #008800
+}
+/** String.Double */
+.codehilite .s2 {
+    color: #008800
+}
+/** String.Escape */
+.codehilite .se {
+    color: #008800
+}
+/** String.Heredoc */
+.codehilite .sh {
+    color: #008800
+}
+/** String.Interpol */
+.codehilite .si {
+    color: #008800
+}
+/** String.Other */
+.codehilite .sx {
+    color: #008800
+}
+/** String.Regex */
+.codehilite .sr {
+    color: #008800
+}
+/** String.Single */
+.codehilite .s1 {
+    color: #008800
+}
+/** String.Symbol */
+.codehilite .ss {
+    color: #008800
+}
+    
+/** Number */
+.codehilite .m {
+}
+/** Number.Float */
+.codehilite .mf {
+}
+/** Number.Hex */
+.codehilite .mh {
+}
+/** Number.Integer */
+.codehilite .mi {
+}
+/** Number.Integer.Long */
+.codehilite .il {
+}
+/** Number.Oct */
+.codehilite .mo {
+}
+/** Operator */
+.codehilite .o {
+}
+/** Operator.Word */
+.codehilite .ow {
+}
+/** Punctuation */
+.codehilite .p {
+}
+
+/** Comment */
+.codehilite .c {
+    color: #808080;
+}
+/** Comment.Multiline */
+.codehilite .cm {
+    color: #808080;
+}
+/** Comment.Preproc */
+.codehilite .cp {
+    color: #808080;
+}
+/** Comment.Single */
+.codehilite .c1 {
+    color: #808080;
+}
+/** Comment.Special */
+.codehilite .cs {
+    color: #808080;
+}
+    
+/** Generic */
+.codehilite .g {
+}
+/** Generic.Deleted */
+.codehilite .gd {
+}
+/** Generic.Emph */
+.codehilite .ge {
+}
+/** Generic.Error */
+.codehilite .gr {
+}
+/** Generic.Heading */
+.codehilite .gh {
+}
+/** Generic.Inserted */
+.codehilite .gi {
+}
+/** Generic.Output */
+.codehilite .go {
+}
+/** Generic.Prompt */
+.codehilite .gp {
+}
+/** Generic.Strong */
+.codehilite .gs {
+}
+/** Generic.Subheading */
+.codehilite .gu {
+}
+/** Generic.Traceback */
+.codehilite .gt {
+}
+

Modified: sling/site/trunk/content/res/site.css
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/res/site.css?rev=1345853&r1=1345852&r2=1345853&view=diff
==============================================================================
--- sling/site/trunk/content/res/site.css (original)
+++ sling/site/trunk/content/res/site.css Mon Jun  4 07:45:49 2012
@@ -144,45 +144,6 @@ img {
     padding-top: 1em;
 }
 
-.codehilite {
-    color: black;
-    background-color: #eeeeee;
-    border: solid 1px black;
-    margin-top: 0.5em;
-    margin-bottom: 0.5em;
-    padding: 0.5em
-}
-
-.codeHeader {
-    text-align: center;
-    font-family: monospace;
-    border-bottom: 1px solid black;
-    padding-top: 0.5em;
-    padding-bottom: 0.5em;
-    margin-bottom: 0.5em;
-}
-
-
-.codehilite pre {
-    margin: 0em
-}
-
-.code-keyword {
-    color: #880000
-}
-
-.code-quote {
-    color: #008800
-}
-
-.code-object {
-    color: #0000dd
-}
-
-.code-java {
-    margin: 0em
-}
-
 .preformatted {
     color: black;
     background-color: #eeeeee;
@@ -250,3 +211,6 @@ td {
     margin-top: 10px;
     text-align: left;
 }
+
+/* Code High Lighting */
+

Modified: sling/site/trunk/readme.txt
URL: http://svn.apache.org/viewvc/sling/site/trunk/readme.txt?rev=1345853&r1=1345852&r2=1345853&view=diff
==============================================================================
--- sling/site/trunk/readme.txt (original)
+++ sling/site/trunk/readme.txt Mon Jun  4 07:45:49 2012
@@ -58,4 +58,11 @@ Some usefull hints:
     Note: It is important to have the first part as a single line,
     otherwise the Django/Markdown combo will create list for each
     entry.
-  
\ No newline at end of file
+  
+  * Code Highlighting works by indenting code by four blanks.
+    To indicate the type of highlighting preced the code style text with
+    either :::<lexer> to get high lighted code using the given <lexer>
+    or #!<lexer> to get high lighted code with line numbers using the
+    given <lexer>.
+    See http://www.apache.org/dev/cmsref.html#code-hilighter for main info
+    See http://pygments.org/docs/lexers/ for supported lexers
\ No newline at end of file

Modified: sling/site/trunk/templates/skeleton.html
URL: http://svn.apache.org/viewvc/sling/site/trunk/templates/skeleton.html?rev=1345853&r1=1345852&r2=1345853&view=diff
==============================================================================
--- sling/site/trunk/templates/skeleton.html (original)
+++ sling/site/trunk/templates/skeleton.html Mon Jun  4 07:45:49 2012
@@ -19,8 +19,9 @@
 -->
   <head>
     <title>Apache Sling - {% block title %}{% endblock %}</title>
-    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
     <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
   </head>
   <body>



Mime
View raw message