mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
docs: Generate example HTMLs in parallel
This commit is contained in:
parent
56c4dbf28b
commit
bd8a337728
21
_docs/gen.go
21
_docs/gen.go
@ -27,6 +27,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten/internal"
|
"github.com/hajimehoshi/ebiten/internal"
|
||||||
)
|
)
|
||||||
@ -385,12 +386,20 @@ func main() {
|
|||||||
examples = append(examples, inputExamples...)
|
examples = append(examples, inputExamples...)
|
||||||
examples = append(examples, audioExamples...)
|
examples = append(examples, audioExamples...)
|
||||||
examples = append(examples, gamesExamples...)
|
examples = append(examples, gamesExamples...)
|
||||||
|
|
||||||
|
wg := sync.WaitGroup{}
|
||||||
for _, e := range examples {
|
for _, e := range examples {
|
||||||
if err := outputExampleContent(&e); err != nil {
|
e := e
|
||||||
log.Fatal(err)
|
wg.Add(1)
|
||||||
}
|
go func() {
|
||||||
if err := outputExample(&e); err != nil {
|
defer wg.Done()
|
||||||
log.Fatal(err)
|
if err := outputExampleContent(&e); err != nil {
|
||||||
}
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := outputExample(&e); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user