mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 11:12:44 +01:00
Show current version
This commit is contained in:
parent
075c67a84c
commit
9e03c28c67
30
_docs/gen.go
30
_docs/gen.go
@ -17,10 +17,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
@ -52,12 +54,20 @@ func init() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
devVersion = string(b)
|
stableVersion = strings.TrimSpace(string(b))
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
b, err := exec.Command("git", "show", "master:version.txt").Output()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
devVersion = strings.TrimSpace(string(b))
|
||||||
}
|
}
|
||||||
|
|
||||||
func comment(text string) template.HTML {
|
func comment(text string) template.HTML {
|
||||||
// TODO: text should be escaped
|
// TODO: text should be escaped
|
||||||
return template.HTML("<!--" + text + "-->")
|
return template.HTML("<!--\n" + text + "\n-->")
|
||||||
}
|
}
|
||||||
|
|
||||||
func safeHTML(text string) template.HTML {
|
func safeHTML(text string) template.HTML {
|
||||||
@ -97,14 +107,7 @@ func (e *example) Source() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func versions() string {
|
func versions() string {
|
||||||
vers := []string{}
|
return fmt.Sprintf("v%s (dev: v%s)", stableVersion, devVersion)
|
||||||
if stableVersion != "" {
|
|
||||||
vers = append(vers, "Stable: "+stableVersion)
|
|
||||||
}
|
|
||||||
if devVersion != "" {
|
|
||||||
vers = append(vers, "Development: "+devVersion)
|
|
||||||
}
|
|
||||||
return strings.Join(vers, ", ")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -132,9 +135,10 @@ func main() {
|
|||||||
{Name: "rotate"},
|
{Name: "rotate"},
|
||||||
}
|
}
|
||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
"License": license,
|
"License": license,
|
||||||
"Versions": versions(),
|
"StableVersion": stableVersion,
|
||||||
"Examples": examples,
|
"DevVersion": devVersion,
|
||||||
|
"Examples": examples,
|
||||||
}
|
}
|
||||||
if err := t.Funcs(funcs).Execute(f, data); err != nil {
|
if err := t.Funcs(funcs).Execute(f, data); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
@ -21,7 +21,7 @@ table.examples td.code pre {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<h1>Ebiten (海老天)</h1>
|
<h1>Ebiten (海老天)</h1>
|
||||||
<p>{{.Versions}}</p>
|
<p>v{{.StableVersion}}</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>A simple SNES-like 2D game library in Go</li>
|
<li>A simple SNES-like 2D game library in Go</li>
|
||||||
<li>Works on
|
<li>Works on
|
||||||
@ -32,7 +32,7 @@ table.examples td.code pre {
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="http://godoc.org/github.com/hajimehoshi/ebiten">API Docs</a></li>
|
<li><a href="http://godoc.org/github.com/hajimehoshi/ebiten">API Docs</a></li>
|
||||||
<li><a href="http://github.com/hajimehoshi/ebiten">Source Code</a></li>
|
<li><a href="http://github.com/hajimehoshi/ebiten">Source Code</a> (Development version: v{{.DevVersion}})</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2>Features</h2>
|
<h2>Features</h2>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!--Copyright 2014 Hajime Hoshi
|
<!--
|
||||||
|
Copyright 2014 Hajime Hoshi
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -12,6 +13,7 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<link rel="shortcut icon" href="./favicon.png" type="image/png" >
|
<link rel="shortcut icon" href="./favicon.png" type="image/png" >
|
||||||
<link rel="icon" href="./favicon.png" type="image/png" >
|
<link rel="icon" href="./favicon.png" type="image/png" >
|
||||||
@ -34,8 +36,7 @@ table.examples td.code pre {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<h1>Ebiten (海老天)</h1>
|
<h1>Ebiten (海老天)</h1>
|
||||||
<p>Development: 1.0.0-alpha
|
<p>v1.0.0-alpha</p>
|
||||||
</p>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>A simple SNES-like 2D game library in Go</li>
|
<li>A simple SNES-like 2D game library in Go</li>
|
||||||
<li>Works on
|
<li>Works on
|
||||||
@ -46,7 +47,7 @@ table.examples td.code pre {
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="http://godoc.org/github.com/hajimehoshi/ebiten">API Docs</a></li>
|
<li><a href="http://godoc.org/github.com/hajimehoshi/ebiten">API Docs</a></li>
|
||||||
<li><a href="http://github.com/hajimehoshi/ebiten">Source Code</a></li>
|
<li><a href="http://github.com/hajimehoshi/ebiten">Source Code</a> (Development Version: v1.0.0-alpha)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2>Features</h2>
|
<h2>Features</h2>
|
||||||
|
Loading…
Reference in New Issue
Block a user