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"
"path/filepath"
"regexp"
"strconv"
"sort"
"strings"
"sync"
)
@ -35,9 +35,11 @@ const (
)
var (
examplesDir = filepath.Join("public", "examples")
copyright = fmt.Sprintf("© %d Hajime Hoshi", licenseYear)
examplesDir = filepath.Join("public", "examples")
copyright = fmt.Sprintf("© %d Hajime Hoshi", licenseYear)
stableVersion = ""
rcVersion = ""
devVersion = ""
)
@ -46,37 +48,31 @@ func init() {
if err != nil {
panic(err)
}
lastStableVersion := ""
lastCommitTime := 0
for _, tag := range strings.Split(string(b), "\n") {
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
}
vers := strings.Split(strings.TrimSpace(string(b)), "\n")
// TODO: Sort by a semantic version lib
sort.Strings(vers)
func init() {
b, err := exec.Command("git", "show", "master:version.txt").Output()
if err != nil {
panic(err)
devVers := []string{}
rcVers := []string{}
stableVers := []string{}
for _, ver := range vers {
if strings.Index(ver, "-rc") != -1 {
rcVers = append(rcVers, ver)
continue
}
if strings.Index(ver, "-") != -1 {
devVers = append(devVers, ver)
continue
}
stableVers = append(stableVers, ver)
}
devVersion = strings.TrimSpace(string(b))
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 {
@ -215,6 +211,7 @@ func outputMain() error {
"URL": url,
"Copyright": copyright,
"StableVersion": stableVersion,
"RCVersion": rcVersion,
"DevVersion": devVersion,
"GraphicsExamples": graphicsExamples,
"InputExamples": inputExamples,

View File

@ -36,27 +36,36 @@
</div></header>
<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>
<dl class="row">
<dt class="col-2 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>
<dt class="col-2 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>
<dt class="col-2 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>
<dt class="col-3 text-right">Desktops</dt>
<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-3 text-right">Mobiles</dt>
<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-3 text-right">Web browsers</dt>
<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>
<p><small>Note: Gamepads and keyboard are not available on Android/iOS.</small></p>
<h2 id="features">Features</h2>
<dl class="row">
<dt class="col-2 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>
<dt class="col-2 text-right">Input</dt>
<dd class="col-10">Mouse, Keyboard, Gamepads, Touches</dd>
<dt class="col-2 text-right">Audio</dt>
<dd class="col-10">Ogg/Vorbis, MP3, WAV, PCM</dd>
<dt class="col-3 text-right">2D Graphics</dt>
<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-3 text-right">Input</dt>
<dd class="col-9">Mouse, Keyboard, Gamepads, Touches</dd>
<dt class="col-3 text-right">Audio</dt>
<dd class="col-9">Ogg/Vorbis, MP3, WAV, PCM</dd>
</dl>
<h2 id="examples">Examples</h2>

View File

@ -36,27 +36,36 @@
</div></header>
<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>
<dl class="row">
<dt class="col-2 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>
<dt class="col-2 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>
<dt class="col-2 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>
<dt class="col-3 text-right">Desktops</dt>
<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-3 text-right">Mobiles</dt>
<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-3 text-right">Web browsers</dt>
<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>
<p><small>Note: Gamepads and keyboard are not available on Android/iOS.</small></p>
<h2 id="features">Features</h2>
<dl class="row">
<dt class="col-2 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>
<dt class="col-2 text-right">Input</dt>
<dd class="col-10">Mouse, Keyboard, Gamepads, Touches</dd>
<dt class="col-2 text-right">Audio</dt>
<dd class="col-10">Ogg/Vorbis, MP3, WAV, PCM</dd>
<dt class="col-3 text-right">2D Graphics</dt>
<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-3 text-right">Input</dt>
<dd class="col-9">Mouse, Keyboard, Gamepads, Touches</dd>
<dt class="col-3 text-right">Audio</dt>
<dd class="col-9">Ogg/Vorbis, MP3, WAV, PCM</dd>
</dl>
<h2 id="examples">Examples</h2>

View File

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