docs: Update

This commit is contained in:
Hajime Hoshi 2018-10-16 00:47:29 +09:00
parent 2c9a634752
commit 6bc6c6674f
4 changed files with 73 additions and 59 deletions

View File

@ -24,7 +24,7 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strconv" "sort"
"strings" "strings"
"sync" "sync"
) )
@ -37,7 +37,9 @@ const (
var ( var (
examplesDir = filepath.Join("public", "examples") examplesDir = filepath.Join("public", "examples")
copyright = fmt.Sprintf("© %d Hajime Hoshi", licenseYear) copyright = fmt.Sprintf("© %d Hajime Hoshi", licenseYear)
stableVersion = "" stableVersion = ""
rcVersion = ""
devVersion = "" devVersion = ""
) )
@ -46,37 +48,31 @@ func init() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
lastStableVersion := "" vers := strings.Split(strings.TrimSpace(string(b)), "\n")
lastCommitTime := 0 // TODO: Sort by a semantic version lib
for _, tag := range strings.Split(string(b), "\n") { sort.Strings(vers)
m := regexp.MustCompile(`^v(\d.+)$`).FindStringSubmatch(tag)
if m == nil {
continue
}
t, err := exec.Command("git", "log", tag, "-1", "--format=%ct").Output()
if err != nil {
panic(err)
}
tt, err := strconv.Atoi(strings.TrimSpace(string(t)))
if err != nil {
panic(err)
}
if lastCommitTime >= tt {
continue
}
lastCommitTime = tt
lastStableVersion = m[1]
}
// See the HEAD commit time
stableVersion = lastStableVersion
}
func init() { devVers := []string{}
b, err := exec.Command("git", "show", "master:version.txt").Output() rcVers := []string{}
if err != nil { stableVers := []string{}
panic(err) for _, ver := range vers {
if strings.Index(ver, "-rc") != -1 {
rcVers = append(rcVers, ver)
continue
} }
devVersion = strings.TrimSpace(string(b)) if strings.Index(ver, "-") != -1 {
devVers = append(devVers, ver)
continue
}
stableVers = append(stableVers, ver)
}
stableVersion = stableVers[len(stableVers)-1]
rcVersion = rcVers[len(rcVers)-1]
if rcVersion[:strings.Index(rcVersion, "-")] == stableVersion {
rcVersion = ""
}
devVersion = devVers[len(devVers)-1]
} }
func comment(text string) template.HTML { func comment(text string) template.HTML {
@ -215,6 +211,7 @@ func outputMain() error {
"URL": url, "URL": url,
"Copyright": copyright, "Copyright": copyright,
"StableVersion": stableVersion, "StableVersion": stableVersion,
"RCVersion": rcVersion,
"DevVersion": devVersion, "DevVersion": devVersion,
"GraphicsExamples": graphicsExamples, "GraphicsExamples": graphicsExamples,
"InputExamples": inputExamples, "InputExamples": inputExamples,

View File

@ -36,27 +36,36 @@
</div></header> </div></header>
<main><div class="container"> <main><div class="container">
<p>Stable version: v{{.StableVersion}} / Development version: v{{.DevVersion}}</p> <dl class="row">
<dt class="col-3 text-right">Stable Version</dt>
<dd class="col-9">{{.StableVersion}}</dd>
{{if .RCVersion}}
<dt class="col-3 text-right">Release Candidate Version</dt>
<dd class="col-9">{{.RCVersion}}</dd>
{{end}}
<dt class="col-3 text-right">Development Version</dt>
<dd class="col-9">{{.DevVersion}}</dd>
</dl>
<h2 id="platforms">Platforms</h2> <h2 id="platforms">Platforms</h2>
<dl class="row"> <dl class="row">
<dt class="col-2 text-right">Desktops</dt> <dt class="col-3 text-right">Desktops</dt>
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Windows">Windows</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/macOS">macOS</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/Linux">Linux</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/FreeBSD">FreeBSD</a></dd> <dd class="col-9"><a href="https://github.com/hajimehoshi/ebiten/wiki/Windows">Windows</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/macOS">macOS</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/Linux">Linux</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/FreeBSD">FreeBSD</a></dd>
<dt class="col-2 text-right">Mobiles</dt> <dt class="col-3 text-right">Mobiles</dt>
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Android">Android</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/iOS">iOS</a></dd> <dd class="col-9"><a href="https://github.com/hajimehoshi/ebiten/wiki/Android">Android</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/iOS">iOS</a></dd>
<dt class="col-2 text-right">Web browsers</dt> <dt class="col-3 text-right">Web browsers</dt>
<dd class="col-10">Chrome, Firefox, Safari and Edge (<a href="https://github.com/hajimehoshi/ebiten/wiki/GopherJS">GopherJS</a> and <a href="https://github.com/hajimehoshi/ebiten/wiki/WebAssembly">WebAssembly (Experimental)</a>)</dd> <dd class="col-9">Chrome, Firefox, Safari and Edge (<a href="https://github.com/hajimehoshi/ebiten/wiki/GopherJS">GopherJS</a> and <a href="https://github.com/hajimehoshi/ebiten/wiki/WebAssembly">WebAssembly (Experimental)</a>)</dd>
</dl> </dl>
<p><small>Note: Gamepads and keyboard are not available on Android/iOS.</small></p> <p><small>Note: Gamepads and keyboard are not available on Android/iOS.</small></p>
<h2 id="features">Features</h2> <h2 id="features">Features</h2>
<dl class="row"> <dl class="row">
<dt class="col-2 text-right">2D Graphics</dt> <dt class="col-3 text-right">2D Graphics</dt>
<dd class="col-10">Geometry/Color matrix transformation, Various composition modes, Offscreen rendering, Fullscreen, Text rendering, Automatic batches, Automatic texture atlas</dd> <dd class="col-9">Geometry/Color matrix transformation, Various composition modes, Offscreen rendering, Fullscreen, Text rendering, Automatic batches, Automatic texture atlas</dd>
<dt class="col-2 text-right">Input</dt> <dt class="col-3 text-right">Input</dt>
<dd class="col-10">Mouse, Keyboard, Gamepads, Touches</dd> <dd class="col-9">Mouse, Keyboard, Gamepads, Touches</dd>
<dt class="col-2 text-right">Audio</dt> <dt class="col-3 text-right">Audio</dt>
<dd class="col-10">Ogg/Vorbis, MP3, WAV, PCM</dd> <dd class="col-9">Ogg/Vorbis, MP3, WAV, PCM</dd>
</dl> </dl>
<h2 id="examples">Examples</h2> <h2 id="examples">Examples</h2>

View File

@ -36,27 +36,36 @@
</div></header> </div></header>
<main><div class="container"> <main><div class="container">
<p>Stable version: v1.7.4 / Development version: v1.8.0-alpha</p> <dl class="row">
<dt class="col-3 text-right">Stable Version</dt>
<dd class="col-9">v1.7.4</dd>
<dt class="col-3 text-right">Release Candidate Version</dt>
<dd class="col-9">v1.8.0-rc1</dd>
<dt class="col-3 text-right">Development Version</dt>
<dd class="col-9">v1.9.0-alpha</dd>
</dl>
<h2 id="platforms">Platforms</h2> <h2 id="platforms">Platforms</h2>
<dl class="row"> <dl class="row">
<dt class="col-2 text-right">Desktops</dt> <dt class="col-3 text-right">Desktops</dt>
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Windows">Windows</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/macOS">macOS</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/Linux">Linux</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/FreeBSD">FreeBSD</a></dd> <dd class="col-9"><a href="https://github.com/hajimehoshi/ebiten/wiki/Windows">Windows</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/macOS">macOS</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/Linux">Linux</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/FreeBSD">FreeBSD</a></dd>
<dt class="col-2 text-right">Mobiles</dt> <dt class="col-3 text-right">Mobiles</dt>
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Android">Android</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/iOS">iOS</a></dd> <dd class="col-9"><a href="https://github.com/hajimehoshi/ebiten/wiki/Android">Android</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/iOS">iOS</a></dd>
<dt class="col-2 text-right">Web browsers</dt> <dt class="col-3 text-right">Web browsers</dt>
<dd class="col-10">Chrome, Firefox, Safari and Edge (<a href="https://github.com/hajimehoshi/ebiten/wiki/GopherJS">GopherJS</a> and <a href="https://github.com/hajimehoshi/ebiten/wiki/WebAssembly">WebAssembly (Experimental)</a>)</dd> <dd class="col-9">Chrome, Firefox, Safari and Edge (<a href="https://github.com/hajimehoshi/ebiten/wiki/GopherJS">GopherJS</a> and <a href="https://github.com/hajimehoshi/ebiten/wiki/WebAssembly">WebAssembly (Experimental)</a>)</dd>
</dl> </dl>
<p><small>Note: Gamepads and keyboard are not available on Android/iOS.</small></p> <p><small>Note: Gamepads and keyboard are not available on Android/iOS.</small></p>
<h2 id="features">Features</h2> <h2 id="features">Features</h2>
<dl class="row"> <dl class="row">
<dt class="col-2 text-right">2D Graphics</dt> <dt class="col-3 text-right">2D Graphics</dt>
<dd class="col-10">Geometry/Color matrix transformation, Various composition modes, Offscreen rendering, Fullscreen, Text rendering, Automatic batches, Automatic texture atlas</dd> <dd class="col-9">Geometry/Color matrix transformation, Various composition modes, Offscreen rendering, Fullscreen, Text rendering, Automatic batches, Automatic texture atlas</dd>
<dt class="col-2 text-right">Input</dt> <dt class="col-3 text-right">Input</dt>
<dd class="col-10">Mouse, Keyboard, Gamepads, Touches</dd> <dd class="col-9">Mouse, Keyboard, Gamepads, Touches</dd>
<dt class="col-2 text-right">Audio</dt> <dt class="col-3 text-right">Audio</dt>
<dd class="col-10">Ogg/Vorbis, MP3, WAV, PCM</dd> <dd class="col-9">Ogg/Vorbis, MP3, WAV, PCM</dd>
</dl> </dl>
<h2 id="examples">Examples</h2> <h2 id="examples">Examples</h2>

View File

@ -1 +0,0 @@
1.9.0-alpha