1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt-doc.git synced 2025-04-25 03:57:11 -07:00

More colors.

This commit is contained in:
Cedric Beust 2015-12-05 16:38:43 -08:00
parent d8637a2e85
commit e72ef89ae9
4 changed files with 154 additions and 148 deletions

View file

@ -1,136 +1,11 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: #FFFABF !important;
}
/*.syntaxhighlighter .line.alt1 {*/
/*background-color: white !important;*/
/*}*/
/*.syntaxhighlighter .line.alt2 {*/
/*background-color: #FFFABF;*/
/*}*/
/*.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {*/
/*background-color: #c3defe !important;*/
/*}*/
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: black !important;
}
.syntaxhighlighter .gutter {
color: #787878 !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #d4d0c8 !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #d4d0c8 !important;
color: white !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #3f5fbf !important;
background: white !important;
border: 1px solid #d4d0c8 !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #3f5fbf !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #aa7700 !important;
}
.syntaxhighlighter .toolbar {
color: #a0a0a0 !important;
background: #d4d0c8 !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: #a0a0a0 !important;
}
.syntaxhighlighter .toolbar a:hover {
color: red !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: black !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #3f5fbf !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #2a00ff !important;
}
.syntaxhighlighter .keyword {
color: #7f0055 !important;
}
.syntaxhighlighter .preprocessor {
color: #646464 !important;
}
.syntaxhighlighter .variable {
color: #aa7700 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ff1493 !important;
}
.syntaxhighlighter .constants {
color: #0066cc !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #7f0055 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: gray !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: red !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}
.syntaxhighlighter .xml .keyword {
color: #3f7f7f !important;
font-weight: normal !important;
}
.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a {
color: #7f007f !important;
}
.syntaxhighlighter .xml .string {
font-style: italic !important;
color: #2a00ff !important;
}
/* /*
* Kobalt CSS * Kobalt CSS
*/ */
code {
background-color: #ffffff;
}
.source-header { .source-header {
border: solid 1px #cccccc; border: solid 1px #cccccc;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
@ -237,3 +112,133 @@ table {
.bs-callout-info h4 { .bs-callout-info h4 {
color: #5bc0de; color: #5bc0de;
} }
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: #FFFABF !important;
}
/*.syntaxhighlighter .line.alt1 {*/
/*background-color: white !important;*/
/*}*/
/*.syntaxhighlighter .line.alt2 {*/
/*background-color: #FFFABF;*/
/*}*/
/*.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {*/
/*background-color: #c3defe !important;*/
/*}*/
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: black !important;
}
.syntaxhighlighter .gutter {
color: #787878 !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #d4d0c8 !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #d4d0c8 !important;
color: white !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #3f5fbf !important;
background: white !important;
border: 1px solid #d4d0c8 !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #3f5fbf !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: #aa7700 !important;
}
.syntaxhighlighter .toolbar {
color: #a0a0a0 !important;
background: #d4d0c8 !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: #a0a0a0 !important;
}
.syntaxhighlighter .toolbar a:hover {
color: red !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: black !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #3f5fbf !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: #2a00ff !important;
}
.syntaxhighlighter .keyword {
color: #7f0055 !important;
}
.syntaxhighlighter .preprocessor {
color: #646464 !important;
}
.syntaxhighlighter .variable {
color: #aa7700 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ff1493 !important;
}
.syntaxhighlighter .constants {
color: #0066cc !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #7f0055 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: gray !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: red !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}
.syntaxhighlighter .xml .keyword {
color: #3f7f7f !important;
font-weight: normal !important;
}
.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a {
color: #7f007f !important;
}
.syntaxhighlighter .xml .string {
font-style: italic !important;
color: #2a00ff !important;
}

View file

@ -96,7 +96,7 @@
The plug-in will find your `Build.kt` file and it will automatically update your project's libraries and The plug-in will find your `Build.kt` file and it will automatically update your project's libraries and
dependencies to reflect it. For example, suppose you have the following dependencies: dependencies to reflect it. For example, suppose you have the following dependencies:
</p> </p>
<pre> <pre class="brush:java">
compile("org.apache.ant:ant:1.7.0", compile("org.apache.ant:ant:1.7.0",
"com.google.inject:guice:4.0:no_aop", "com.google.inject:guice:4.0:no_aop",
"com.beust:jcommander:1.48") "com.beust:jcommander:1.48")
@ -125,7 +125,7 @@ compile("org.apache.ant:ant:1.7.0",
The plug-in understands other scopes as well (e.g. "provided", "runtime"). For example, let's The plug-in understands other scopes as well (e.g. "provided", "runtime"). For example, let's
move a dependency in the "runtime" section of the build file: move a dependency in the "runtime" section of the build file:
</p> </p>
<pre> <pre class="brush:java">
dependencies { dependencies {
runtime("com.google.inject:guice:4.0:no_aop") runtime("com.google.inject:guice:4.0:no_aop")
compile("org.apache.ant:ant:1.7.0", compile("org.apache.ant:ant:1.7.0",

View file

@ -140,9 +140,9 @@ function generateScript(src) {
} }
var LINKS = [ var LINKS = [
"../css/kobalt.css",
"../bootstrap/dist/css/bootstrap.min.css", "../bootstrap/dist/css/bootstrap.min.css",
"../sh/styles/shCore.css" "../sh/styles/shCore.css",
"../css/kobalt.css"
]; ];
var SCRIPTS = [ var SCRIPTS = [

View file

@ -12,6 +12,7 @@
<script type="text/javascript" src="../sh/scripts/shBrushJScript.js"></script> <script type="text/javascript" src="../sh/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="../sh/scripts/shBrushJava.js"></script> <script type="text/javascript" src="../sh/scripts/shBrushJava.js"></script>
<script type="text/javascript" src="../sh/scripts/shBrushPlain.js"></script> <script type="text/javascript" src="../sh/scripts/shBrushPlain.js"></script>
<script type="text/javascript" src="../sh/scripts/shBrushXml.js"></script>
<script> <script>
SyntaxHighlighter.defaults['gutter'] = false; SyntaxHighlighter.defaults['gutter'] = false;
@ -70,7 +71,7 @@
Let's start by creating our project: Let's start by creating our project:
</p> </p>
<pre> <pre class="brush:plain">
$ mkdir linecount $ mkdir linecount
$ mkdir -p src/main/kotlin/com/beust/plugin/linecount $ mkdir -p src/main/kotlin/com/beust/plugin/linecount
$ touch src/main/kotlin/com/beust/plugin/linecount/Main.kt $ touch src/main/kotlin/com/beust/plugin/linecount/Main.kt
@ -81,7 +82,7 @@ $ $KOBALT_HOME/kobaltw --init
I create an empty <code>Main.kt</code> in the example above so that calling <code>./kobaltw --init</code> will detect the project as a Kotlin one. This way, the <code>Build.kt</code> file generated is already configured for Kotlin. Since we will be publishing this project to a Maven repository, we need to make sure that its <code>group</code>, <code>artifactId</code> and <code>version</code> are correct. The only thing that the generator can't guess is the <code>group</code>, so let's go ahead and fix it: I create an empty <code>Main.kt</code> in the example above so that calling <code>./kobaltw --init</code> will detect the project as a Kotlin one. This way, the <code>Build.kt</code> file generated is already configured for Kotlin. Since we will be publishing this project to a Maven repository, we need to make sure that its <code>group</code>, <code>artifactId</code> and <code>version</code> are correct. The only thing that the generator can't guess is the <code>group</code>, so let's go ahead and fix it:
</p> </p>
<pre> <pre class="brush:java">
val project = kotlinProject { val project = kotlinProject {
name = "kobalt-line-count" name = "kobalt-line-count"
group = "com.beust.kobalt" group = "com.beust.kobalt"
@ -95,7 +96,7 @@ val project = kotlinProject {
Once there, it will be automatically copied in the right place in our jar file: Once there, it will be automatically copied in the right place in our jar file:
</p> </p>
<pre> <pre class="brush:xml">
&lt;kobalt-plugin&gt; &lt;kobalt-plugin&gt;
&lt;name&gt;kobalt-line-count&lt;/name&gt; &lt;name&gt;kobalt-line-count&lt;/name&gt;
&lt;plugins&gt; &lt;plugins&gt;
@ -112,7 +113,7 @@ val project = kotlinProject {
Let's start by writing the simplest plug-in we can: Let's start by writing the simplest plug-in we can:
</p> </p>
<pre> <pre class="brush:java">
package com.beust.kobalt.plugin.linecount package com.beust.kobalt.plugin.linecount
import com.beust.kobalt.api.* import com.beust.kobalt.api.*
@ -130,7 +131,7 @@ public class Main : BasePlugin() {
Before we can upload it, we need to create the package in bintray, <a href="https://bintray.com/docs/usermanual/uploads/uploads_creatinganewpackage.html">as explained here</a>. Once this is done, we are ready to do our first upload: Before we can upload it, we need to create the package in bintray, <a href="https://bintray.com/docs/usermanual/uploads/uploads_creatinganewpackage.html">as explained here</a>. Once this is done, we are ready to do our first upload:
</p> </p>
<pre> <pre class="brush:plain">
$ ./kobaltw uploadJcenter $ ./kobaltw uploadJcenter
... ...
========== kobalt-line-count:uploadJcenter ========== kobalt-line-count:uploadJcenter
@ -143,7 +144,7 @@ $ ./kobaltw uploadJcenter
If you go to the maven section of your bintray account, you will now see that the new package has two unpublished files. Your new plug-in won't be visible by clients until you publish those files, so let's update our build file to automatically publish files from now on: If you go to the maven section of your bintray account, you will now see that the new package has two unpublished files. Your new plug-in won't be visible by clients until you publish those files, so let's update our build file to automatically publish files from now on:
</p> </p>
<pre> <pre class="brush:java">
jcenter { jcenter {
publish = true publish = true
} }
@ -153,7 +154,7 @@ jcenter {
And now, let's implement our logic, which is pretty simple: And now, let's implement our logic, which is pretty simple:
</p> </p>
<pre> <pre class="brush:java">
// Main.kt // Main.kt
@Task(name = "lineCount", description = "Count the lines", runBefore = arrayOf("compile")) @Task(name = "lineCount", description = "Count the lines", runBefore = arrayOf("compile"))
fun lineCount(project: Project): TaskResult { fun lineCount(project: Project): TaskResult {
@ -180,7 +181,7 @@ fun lineCount(project: Project): TaskResult {
We create a task called <code>"lineCount"</code> in which we look for all files ending in ".kt" in all the source directories of the project. Finally, we display a count of files and lines at the end by using <code>log()</code>, which is automatically supplied by the Kobalt API: We create a task called <code>"lineCount"</code> in which we look for all files ending in ".kt" in all the source directories of the project. Finally, we display a count of files and lines at the end by using <code>log()</code>, which is automatically supplied by the Kobalt API:
</p> </p>
<pre> <pre class="brush:java">
public class Main : BasePlugin() { public class Main : BasePlugin() {
</pre> </pre>
@ -189,7 +190,7 @@ public class Main : BasePlugin() {
</p> </p>
<pre> <pre class="brush:plain">
$ ./kobaltw uploadJcenter $ ./kobaltw uploadJcenter
... ...
kobalt-line-count: Compilation succeeded kobalt-line-count: Compilation succeeded
@ -208,7 +209,7 @@ Time to Build: 5907 ms
Finally, let's use our plug-in from another project. Since we didn't link this project to JCenter, it's uploaded in the user's maven repository, so we will have to add this maven repository to the build file where we want to use the plug-in. Adjust this line to point to your own maven repo: Finally, let's use our plug-in from another project. Since we didn't link this project to JCenter, it's uploaded in the user's maven repository, so we will have to add this maven repository to the build file where we want to use the plug-in. Adjust this line to point to your own maven repo:
</p> </p>
<pre> <pre class="brush:java">
val repos = repos("https://dl.bintray.com/cbeust/maven/") val repos = repos("https://dl.bintray.com/cbeust/maven/")
val plugins = plugins("com.beust.kobalt:kobalt-line-count:0.2") val plugins = plugins("com.beust.kobalt:kobalt-line-count:0.2")
</pre> </pre>
@ -217,7 +218,7 @@ val plugins = plugins("com.beust.kobalt:kobalt-line-count:0.2")
Now let's launch a build: Now let's launch a build:
</p> </p>
<pre> <pre class="brush:plain">
$ ./kobaltw assemble $ ./kobaltw assemble
... ...
========== kobalt:lineCount ========== kobalt:lineCount
@ -230,7 +231,7 @@ Found 4972 lines in 65 files
Note that our plugin ran before the <code>compile</code> task, as we requested in the <code>@Task</code> annotation. We can also verify that it's activated and we can invoke the task directly instead of having it run as part of the build: Note that our plugin ran before the <code>compile</code> task, as we requested in the <code>@Task</code> annotation. We can also verify that it's activated and we can invoke the task directly instead of having it run as part of the build:
</p> </p>
<pre> <pre class="brush:java">
$ ./kobaltw --tasks $ ./kobaltw --tasks
===== kobalt-line-count ===== ===== kobalt-line-count =====
lineCount Count the lines lineCount Count the lines
@ -246,7 +247,7 @@ Found 4972 lines in 65 files
<p> <p>
When your plug-in is activated, Kobalt will invoke its <code>apply()</code> function: When your plug-in is activated, Kobalt will invoke its <code>apply()</code> function:
</p> </p>
<pre> <pre class="brush:java">
override fun apply(project: Project, context: KobaltContext) { override fun apply(project: Project, context: KobaltContext) {
} }
</pre> </pre>
@ -261,7 +262,7 @@ override fun apply(project: Project, context: KobaltContext) {
The simplest way to run your plug-in in your IDE is to create a main function in the main class of your The simplest way to run your plug-in in your IDE is to create a main function in the main class of your
plug-in as follows: plug-in as follows:
</p> </p>
<pre> <pre class="brush:java">
fun main(argv: Array&lt;String&gt;) { fun main(argv: Array&lt;String&gt;) {
com.beust.kobalt.main(argv) com.beust.kobalt.main(argv)
} }
@ -281,7 +282,7 @@ public class Main : BasePlugin() {
on your file system: on your file system:
</p> </p>
<pre> <pre class="brush:java">
val p = plugins( val p = plugins(
file(homeDir("kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.8.jar")) file(homeDir("kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.8.jar"))
) )