Skip to content

Commit

Permalink
[documentation] simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
Keisuke Izumiya committed Oct 30, 2024
1 parent 6f078d1 commit d1fc17e
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/src/htmldocs/

/www/assets/
/www/docs/simulator/index.min.js
/www/docs/native/
/www/docs/web/
/www/marathon/index.min.js
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@ nimble install pon2 -p:-d:danger -p:-d:pon2.avx2=<bool> -p:-d:pon2.bmi2=<bool>

## Usage

### CLI or Native Application

Run `pon2 -h`.

### Web Application

See the documentations:

- [Simulator](https://24ik.github.io/pon2/docs/simulator/)

## For Developers

It is necessary to place the `assets` directory to the one specified by
Expand Down
17 changes: 7 additions & 10 deletions pon2.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.23.8"
version = "0.23.9"
author = "Keisuke Izumiya"
description = "Application for Puyo Puyo and Nazo Puyo"
license = "Apache-2.0"
Expand All @@ -16,7 +16,7 @@ requires "nim ^= 2.2.0"
requires "docopt ^= 0.7.1"
requires "karax ^= 1.3.3"
requires "nigui ^= 0.2.8"
requires "nimsimd ^= 1.2.13"
requires "nimsimd ^= 1.3.0"
requires "puppy ^= 2.1.2"
requires "suru ^= 0.3.2"

Expand All @@ -39,13 +39,6 @@ task benchmark, "Benchmarking":

exec &"nim c -r -d:pon2.avx2={Avx2} -d:pon2.bmi2={Bmi2} " & "benchmark/main.nim"

task documentation, "Make Documentation":
rmDir "www/docs/native"
exec &"nim doc --project --outdir:www/docs/native src/pon2.nim"

rmDir "www/docs/web"
exec &"nim doc --project --outdir:www/docs/web --backend:js src/pon2.nim"

task web, "Make Web Pages":
const
danger {.booldefine.} = true
Expand Down Expand Up @@ -85,7 +78,11 @@ task web, "Make Web Pages":
"src/pon2.nim".compile "www/marathon/index.min.js", "-d:pon2.marathon", "-d:pon2.assets.web=../assets"

# documentation
exec "nimble -y documentation"
rmDir "www/docs/native"
exec &"nim doc --project --outdir:www/docs/native src/pon2.nim"
rmDir "www/docs/web"
exec &"nim doc --project --outdir:www/docs/web --backend:js src/pon2.nim"
"www/docs/simulator/main.nim".compile "www/docs/simulator/index.min.js"

# assets
cpDir "assets", "www/assets"
2 changes: 1 addition & 1 deletion www/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Pon! Tsu API Document</title>
<title>Pon! Tsu | API Document</title>
<link
href="https://cdn.jsdelivr.net/npm/bulma@1.0.2/css/bulma.min.css"
rel="stylesheet"
Expand Down
22 changes: 22 additions & 0 deletions www/docs/simulator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Pon!通 | 操作方法</title>
<link
href="https://cdn.jsdelivr.net/npm/bulma@1.0.2/css/bulma.min.css"
rel="stylesheet"
/>
<link
href="../../favicon.ico"
rel="shortcut icon"
type="image/x-icon"
/>
</head>

<body>
<div id="ROOT"></div>
<script src="./index.min.js"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions www/docs/simulator/main.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{.experimental: "inferGenericTypes".}
{.experimental: "notnil".}
{.experimental: "strictCaseObjects".}
{.experimental: "strictDefs".}
{.experimental: "strictFuncs".}
{.experimental: "views".}

import karax/[karax, karaxdsl, vdom]

proc newMainNode(): VNode =
buildHtml(section(class = "section")):
tdiv(class = "content"):
h1(class = "title"):
text "Pon!通 操作方法"
img(src = "./manual.png", width = "800")

when isMainModule:
setRenderer newMainNode
122 changes: 122 additions & 0 deletions www/docs/simulator/manual.drawio

Large diffs are not rendered by default.

Binary file added www/docs/simulator/manual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d1fc17e

Please sign in to comment.