doc: Highlight code

This commit is contained in:
Hajime Hoshi 2016-08-27 14:00:06 +09:00
parent 12920a79da
commit 0b7dc630d6
21 changed files with 181 additions and 21 deletions

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - {{.Example.Name}}</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
{{with .Example}}
<h2>Ebiten example - {{.Name}}</h2>
<iframe src="{{.Name}}.content.html" width="{{.Width}}" height="{{.Height}}"></iframe>
<pre><code>{{.Source}}</code></pre>
<pre><code class="language-go">{{.Source}}</code></pre>
{{end}}
</div></main>
@ -32,3 +33,5 @@
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -4,6 +4,7 @@
<link rel="icon" href="./favicon.png" type="image/png">
<title>Ebiten - A simple SNES-like 2D game library in Go</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -55,7 +56,7 @@
<p><a href="http://blog.golang.org/go-programming-language-turns-two">The Gopher photographs by Chris Nokleberg</a> are licensed under <a href="https://creativecommons.org/licenses/by/3.0/">the Creative Commons 3.0 Attributions License</a>.</p>
<h3>Execute the examples</h2>
<pre><code>:; go get github.com/hajimehoshi/ebiten
<pre><code class="language-bash">:; go get github.com/hajimehoshi/ebiten
:; cd $GOPATH/src/github.com/hajimehoshi/ebiten/examples
:; go run -tags example rotate/main.go</code></pre>
<p>Note that you need to specify <code>example</code> tag.</p>
@ -67,7 +68,7 @@ First create a new directory (<code>mkdir hello_world</code>), and change
into it (<code>cd hello_world</code>). Type the following code into
the <code>main.go</code> file:</p>
<pre><code>package main
<pre><code class="language-go">package main
import (
"github.com/hajimehoshi/ebiten"
@ -94,3 +95,6 @@ game. There you have it, your first Ebiten game!</p>
<p>Code is licensed under <a href="https://github.com/hajimehoshi/ebiten/blob/master/LICENSE">Apache License 2.0</a>.</p>
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - alphablending</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - alphablending</h2>
<iframe src="alphablending.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -110,3 +111,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - audio</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - audio</h2>
<iframe src="audio.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -319,3 +320,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - blocks</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - blocks</h2>
<iframe src="blocks.content.html" width="512" height="480"></iframe>
<pre><code>// Please read examples/blocks/main.go and examples/blocks/blocks/*.go
<pre><code class="language-go">// Please read examples/blocks/main.go and examples/blocks/blocks/*.go
// NOTE: If Gamepad API is available in your browswer, you can use gamepads. Try it out!</code></pre>
</div></main>
@ -33,3 +34,5 @@
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - font</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - font</h2>
<iframe src="font.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -127,3 +128,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - gamepad</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - gamepad</h2>
<iframe src="gamepad.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -87,3 +88,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - hsv</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - hsv</h2>
<iframe src="hsv.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -124,3 +125,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - hue</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - hue</h2>
<iframe src="hue.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -77,3 +78,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - keyboard</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - keyboard</h2>
<iframe src="keyboard.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -148,3 +149,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - masking</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - masking</h2>
<iframe src="masking.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -161,3 +162,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - mosaic</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - mosaic</h2>
<iframe src="mosaic.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -85,3 +86,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - noise</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - noise</h2>
<iframe src="noise.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -93,3 +94,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - paint</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - paint</h2>
<iframe src="paint.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -135,3 +136,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - perspective</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - perspective</h2>
<iframe src="perspective.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -98,3 +99,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - piano</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - piano</h2>
<iframe src="piano.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -267,3 +268,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - rotate</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - rotate</h2>
<iframe src="rotate.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -78,3 +79,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -3,6 +3,7 @@
<link rel="icon" href="../favicon.png" type="image/png" >
<title>Ebiten example - sprites</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -22,7 +23,7 @@
<h2>Ebiten example - sprites</h2>
<iframe src="sprites.content.html" width="640" height="480"></iframe>
<pre><code>// &#43;build example
<pre><code class="language-go">// &#43;build example
package main
@ -181,3 +182,5 @@ func main() {
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

View File

@ -4,6 +4,7 @@
<link rel="icon" href="./favicon.png" type="image/png">
<title>Ebiten - A simple SNES-like 2D game library in Go</title>
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="/stylesheets/highlight-default.css">
<link rel="stylesheet" href="/stylesheets/ebiten.css">
<header class="navbar"><div class="container">
@ -83,7 +84,7 @@
<p><a href="http://blog.golang.org/go-programming-language-turns-two">The Gopher photographs by Chris Nokleberg</a> are licensed under <a href="https://creativecommons.org/licenses/by/3.0/">the Creative Commons 3.0 Attributions License</a>.</p>
<h3>Execute the examples</h2>
<pre><code>:; go get github.com/hajimehoshi/ebiten
<pre><code class="language-bash">:; go get github.com/hajimehoshi/ebiten
:; cd $GOPATH/src/github.com/hajimehoshi/ebiten/examples
:; go run -tags example rotate/main.go</code></pre>
<p>Note that you need to specify <code>example</code> tag.</p>
@ -95,7 +96,7 @@ First create a new directory (<code>mkdir hello_world</code>), and change
into it (<code>cd hello_world</code>). Type the following code into
the <code>main.go</code> file:</p>
<pre><code>package main
<pre><code class="language-go">package main
import (
"github.com/hajimehoshi/ebiten"
@ -122,3 +123,6 @@ game. There you have it, your first Ebiten game!</p>
<p>Code is licensed under <a href="https://github.com/hajimehoshi/ebiten/blob/master/LICENSE">Apache License 2.0</a>.</p>
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
<script src="/scripts/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,99 @@
/*
Original highlight.js style (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #F0F0F0;
}
/* Base color: saturation 0; */
.hljs,
.hljs-subst {
color: #444;
}
.hljs-comment {
color: #888888;
}
.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
.hljs-meta-keyword,
.hljs-doctag,
.hljs-name {
font-weight: bold;
}
/* User color: hue: 0 */
.hljs-type,
.hljs-string,
.hljs-number,
.hljs-selector-id,
.hljs-selector-class,
.hljs-quote,
.hljs-template-tag,
.hljs-deletion {
color: #880000;
}
.hljs-title,
.hljs-section {
color: #880000;
font-weight: bold;
}
.hljs-regexp,
.hljs-symbol,
.hljs-variable,
.hljs-template-variable,
.hljs-link,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #BC6060;
}
/* Language color: hue: 90; */
.hljs-literal {
color: #78A960;
}
.hljs-built_in,
.hljs-bullet,
.hljs-code,
.hljs-addition {
color: #397300;
}
/* Meta color: hue: 200 */
.hljs-meta {
color: #1f7199;
}
.hljs-meta-string {
color: #4d99bf;
}
/* Misc effects */
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}