You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by cm...@apache.org on 2012/09/14 09:12:04 UTC
svn commit: r1384661 - in /incubator/deltaspike/site/trunk:
content/deltaspike/ content/deltaspike/resources/css/
content/deltaspike/resources/js/ templates/
Author: cmoulliard
Date: Fri Sep 14 07:12:04 2012
New Revision: 1384661
URL: http://svn.apache.org/viewvc?rev=1384661&view=rev
Log:
Add syntax highlighter but does not work - damned
Added:
incubator/deltaspike/site/trunk/content/deltaspike/resources/css/codehilite.css
incubator/deltaspike/site/trunk/content/deltaspike/resources/js/prettyprint.js
Modified:
incubator/deltaspike/site/trunk/content/deltaspike/documentation.mdtext
incubator/deltaspike/site/trunk/content/deltaspike/resources/css/bootstrap.css
incubator/deltaspike/site/trunk/templates/deltaspike-markdown.html
Modified: incubator/deltaspike/site/trunk/content/deltaspike/documentation.mdtext
URL: http://svn.apache.org/viewvc/incubator/deltaspike/site/trunk/content/deltaspike/documentation.mdtext?rev=1384661&r1=1384660&r2=1384661&view=diff
==============================================================================
--- incubator/deltaspike/site/trunk/content/deltaspike/documentation.mdtext (original)
+++ incubator/deltaspike/site/trunk/content/deltaspike/documentation.mdtext Fri Sep 14 07:12:04 2012
@@ -29,20 +29,38 @@ as it uses the ServiceLoader of JDK to d
To bootstrap a CDI container in your Java application, you just need to instantiate the CdiContainer and call the boot method.
+<pre>
+<code>@Stateless
+public class Waiter {
+
+ @Inject
+ public Soup soup;
+
+ public String orderSoup(String name){
+ soup.setName(name);
+ return soup.getName();
+ }
+
+ public String orderWhatTheOtherGuyHad() {
+ String name = soup.getName();
+ return name;
+ }
+}</code>
+</pre>
+
import org.apache.deltaspike.cdise.api.CdiContainer;
import org.apache.deltaspike.cdise.api.CdiContainerLoader;
- ....
public class SimpleApp {
- public static void main(String[] args) {
+ public static void main(String[] args) {
- CdiContainer CdiContainer = CdiContainerLoader.getCdiContainer();
- CdiContainer.boot();
+ CdiContainer CdiContainer = CdiContainerLoader.getCdiContainer();
+ CdiContainer.boot();
- // You can use CDI here
+ // You can use CDI here
- CdiContainer.shutdown();
- }
+ CdiContainer.shutdown();
+ }
}
When boot is called, the CdiContainer will scan the whole classpath for Beans and CDI extensions available.
Modified: incubator/deltaspike/site/trunk/content/deltaspike/resources/css/bootstrap.css
URL: http://svn.apache.org/viewvc/incubator/deltaspike/site/trunk/content/deltaspike/resources/css/bootstrap.css?rev=1384661&r1=1384660&r2=1384661&view=diff
==============================================================================
--- incubator/deltaspike/site/trunk/content/deltaspike/resources/css/bootstrap.css (original)
+++ incubator/deltaspike/site/trunk/content/deltaspike/resources/css/bootstrap.css Fri Sep 14 07:12:04 2012
@@ -682,8 +682,8 @@ cite {
font-style: normal;
}
-code,
-pre {
+/**
+code, pre {
padding: 0 3px 2px;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
font-size: 12px;
@@ -698,6 +698,21 @@ code {
color: #d14;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
+}**/
+
+
+code, pre {
+ padding: 0 3px 2px;
+ font-family: Monaco, Andale Mono, Courier New, monospace;
+ font-size: 12px;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+}
+code {
+ /*background-color: #fee9cc;*/
+ color: rgba(0, 0, 0, 0.75);
+ padding: 1px 3px;
}
pre {
Added: incubator/deltaspike/site/trunk/content/deltaspike/resources/css/codehilite.css
URL: http://svn.apache.org/viewvc/incubator/deltaspike/site/trunk/content/deltaspike/resources/css/codehilite.css?rev=1384661&view=auto
==============================================================================
--- incubator/deltaspike/site/trunk/content/deltaspike/resources/css/codehilite.css (added)
+++ incubator/deltaspike/site/trunk/content/deltaspike/resources/css/codehilite.css Fri Sep 14 07:12:04 2012
@@ -0,0 +1,70 @@
+/*!
+ * Codehilite
+ *
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+.codehilite .c { color: #408080; font-style: italic } /* Comment */
+.codehilite .err { border: 1px solid #FF0000 } /* Error */
+.codehilite .k { color: #008000; font-weight: bold } /* Keyword */
+.codehilite .o { color: #666666 } /* Operator */
+.codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */
+.codehilite .cp { color: #BC7A00 } /* Comment.Preproc */
+.codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */
+.codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */
+.codehilite .gd { color: #A00000 } /* Generic.Deleted */
+.codehilite .ge { font-style: italic } /* Generic.Emph */
+.codehilite .gr { color: #FF0000 } /* Generic.Error */
+.codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.codehilite .gi { color: #00A000 } /* Generic.Inserted */
+.codehilite .go { color: #808080 } /* Generic.Output */
+.codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
+.codehilite .gs { font-weight: bold } /* Generic.Strong */
+.codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.codehilite .gt { color: #0040D0 } /* Generic.Traceback */
+.codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
+.codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
+.codehilite .kp { color: #008000 } /* Keyword.Pseudo */
+.codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
+.codehilite .kt { color: #B00040 } /* Keyword.Type */
+.codehilite .m { color: #666666 } /* Literal.Number */
+.codehilite .s { color: #BA2121 } /* Literal.String */
+.codehilite .na { color: #7D9029 } /* Name.Attribute */
+.codehilite .nb { color: #008000 } /* Name.Builtin */
+.codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */
+.codehilite .no { color: #880000 } /* Name.Constant */
+.codehilite .nd { color: #AA22FF } /* Name.Decorator */
+.codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */
+.codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
+.codehilite .nf { color: #0000FF } /* Name.Function */
+.codehilite .nl { color: #A0A000 } /* Name.Label */
+.codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
+.codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
+.codehilite .nv { color: #19177C } /* Name.Variable */
+.codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
+.codehilite .w { color: #bbbbbb } /* Text.Whitespace */
+.codehilite .mf { color: #666666 } /* Literal.Number.Float */
+.codehilite .mh { color: #666666 } /* Literal.Number.Hex */
+.codehilite .mi { color: #666666 } /* Literal.Number.Integer */
+.codehilite .mo { color: #666666 } /* Literal.Number.Oct */
+.codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
+.codehilite .sc { color: #BA2121 } /* Literal.String.Char */
+.codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
+.codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
+.codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
+.codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
+.codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
+.codehilite .sx { color: #008000 } /* Literal.String.Other */
+.codehilite .sr { color: #BB6688 } /* Literal.String.Regex */
+.codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
+.codehilite .ss { color: #19177C } /* Literal.String.Symbol */
+.codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
+.codehilite .vc { color: #19177C } /* Name.Variable.Class */
+.codehilite .vg { color: #19177C } /* Name.Variable.Global */
+.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
+.codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
+.codehilitetable { border: 1px solid #666; width: 100%; background-color: #666; }
+.codehilitetable .linenos { background-color: #666; padding: 0 5px; width: 20px; }
+.codehilitetable .code { padding: 0 15px; background-color: #fff; }
\ No newline at end of file
Added: incubator/deltaspike/site/trunk/content/deltaspike/resources/js/prettyprint.js
URL: http://svn.apache.org/viewvc/incubator/deltaspike/site/trunk/content/deltaspike/resources/js/prettyprint.js?rev=1384661&view=auto
==============================================================================
--- incubator/deltaspike/site/trunk/content/deltaspike/resources/js/prettyprint.js (added)
+++ incubator/deltaspike/site/trunk/content/deltaspike/resources/js/prettyprint.js Fri Sep 14 07:12:04 2012
@@ -0,0 +1,4 @@
+$(document).ready(function() {
+ $('code').addClass('prettyprint');
+ prettyPrint();
+});
\ No newline at end of file
Modified: incubator/deltaspike/site/trunk/templates/deltaspike-markdown.html
URL: http://svn.apache.org/viewvc/incubator/deltaspike/site/trunk/templates/deltaspike-markdown.html?rev=1384661&r1=1384660&r2=1384661&view=diff
==============================================================================
--- incubator/deltaspike/site/trunk/templates/deltaspike-markdown.html (original)
+++ incubator/deltaspike/site/trunk/templates/deltaspike-markdown.html Fri Sep 14 07:12:04 2012
@@ -17,15 +17,17 @@
{% if headers.base %}<base href="{{ headers.base }}" />{% endif %}
{% if headers.notice %}<!-- {{ headers.notice }} -->{% endif %}
- <!-- Le styles -->
- <link href="resources/css/bootstrap.css" rel="stylesheet">
+ <!-- Styles -->
<style type="text/css">
- body {
- padding-top: 60px;
- padding-bottom: 40px;
- }
+ body {
+ padding-top: 60px;
+ padding-bottom: 40px;
+ }
</style>
- <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet">
+ <link href="resources/css/bootstrap.css" rel="stylesheet">
+ <link href="resources/css/bootstrap-responsive.css" rel="stylesheet">
+ <link href="resources/css/prettify.css" rel="stylesheet" />
+ <link href="resources/css/codehilite.css" rel="stylesheet" />
</head>
<body>
@@ -79,6 +81,7 @@
<!-- Javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
+ <script src="/resources/js/prettyprint.js"></script>
<script src="/resources/js/jquery.js"></script>
<script src="/resources/js/bootstrap-transition.js"></script>
<script src="/resources/js/bootstrap-alert.js"></script>