Skip to content

Commit 4399b72

Browse files
committed
Merge branch 'main' into rebuild-english
2 parents bf6a27e + 1e29f30 commit 4399b72

File tree

4 files changed

+113
-6
lines changed

4 files changed

+113
-6
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,42 @@ Public repository for the JijModeling project.
1010
- Note that JijModeling is not an OSS project, and source code is not available.
1111
- This repository is for documentation and learning resources.
1212
- The contents of this repository (not including `jijmodeling` itself) are CC0 public domain.
13+
14+
Build Jupyter Book
15+
-------------------
16+
17+
There are Jupyter Books in both Japanese and English.
18+
19+
| Language | Path | GitHub Pages |
20+
|----------|------|--------------|
21+
| English | [docs/en](./docs/en) | [![Book-EN](https://img.shields.io/badge/Book-English-blue)](https://jij-inc.github.io/JijModeling-Tutorials/en) |
22+
| 日本語 | [docs/ja](./docs/ja) | [![Book-JA](https://img.shields.io/badge/Book-日本語-blue)](https://jij-inc.github.io/JijModeling-Tutorials/ja) |
23+
24+
Each notebook is managed independently and translated manually.
25+
26+
### Build
27+
28+
Install [uv](https://docs.astral.sh/uv/getting-started/installation/) and [task](https://taskfile.dev/installation/).
29+
30+
```shell
31+
task book_ja
32+
```
33+
34+
This command builds the Japanese version of the book in `docs/ja/_build/html` and automatically opens it in the browser. To only build the book, use `build_book_ja` task instead. Available tasks are as follows:
35+
36+
```text
37+
$ task -l
38+
task: Available tasks for this project:
39+
* book_en: Build and open the English version of the book
40+
* book_en_all: Build and open the English version of the book (force rebuild all notebooks)
41+
* book_ja: Build and open the Japanese version of the book
42+
* book_ja_all: Build and open the Japanese version of the book (force rebuild all notebooks)
43+
* build_book_en: Build the English version of the book
44+
* build_book_en_all: Build the English version of the book (force rebuild all notebooks)
45+
* build_book_ja: Build the Japanese version of the book
46+
* build_book_ja_all: Build the Japanese version of the book (force rebuild all notebooks)
47+
* open_book_en: Open the English version of the book
48+
* open_book_ja: Open the Japanese version of the book
49+
* watch_book_en: Watch English notebooks and auto-rebuild of the book
50+
* watch_book_ja: Watch Japanese notebooks and auto-rebuild of the book
51+
```

Taskfile.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# https://taskfile.dev
2+
# yaml-language-server: $schema=https://taskfile.dev/schema.json
3+
version: "3"
4+
5+
tasks:
6+
build_book_ja:
7+
desc: Build the Japanese version of the book
8+
cmds:
9+
- uv run jupyter-book build docs/ja
10+
11+
build_book_ja_all:
12+
desc: Build the Japanese version of the book (force rebuild all notebooks)
13+
cmds:
14+
- uv run jupyter-book build docs/ja --all
15+
16+
open_book_ja:
17+
desc: Open the Japanese version of the book
18+
cmds:
19+
- uv run python -m webbrowser file:///$(pwd)/docs/ja/_build/html/index.html
20+
21+
watch_book_ja:
22+
desc: Watch Japanese notebooks and auto-rebuild of the book
23+
cmds:
24+
- fswatch -o docs/ja/**/*.ipynb | xargs -n1 -I{} jupyter-book build docs/ja
25+
26+
book_ja:
27+
desc: Build and open the Japanese version of the book
28+
cmds:
29+
- task: build_book_ja
30+
- task: open_book_ja
31+
32+
book_ja_all:
33+
desc: Build and open the Japanese version of the book (force rebuild all notebooks)
34+
cmds:
35+
- task: build_book_ja_all
36+
- task: open_book_ja
37+
38+
build_book_en:
39+
desc: Build the English version of the book
40+
cmds:
41+
- uv run jupyter-book build docs/en
42+
43+
build_book_en_all:
44+
desc: Build the English version of the book (force rebuild all notebooks)
45+
cmds:
46+
- uv run jupyter-book build docs/en --all
47+
48+
open_book_en:
49+
desc: Open the English version of the book
50+
cmds:
51+
- uv run python -m webbrowser file:///$(pwd)/docs/en/_build/html/index.html
52+
53+
watch_book_en:
54+
desc: Watch English notebooks and auto-rebuild of the book
55+
cmds:
56+
- fswatch -o docs/en/**/*.ipynb | xargs -n1 -I{} jupyter-book build docs/en
57+
58+
book_en:
59+
desc: Build and open the English version of the book
60+
cmds:
61+
- task: build_book_en
62+
- task: open_book_en
63+
64+
book_en_all:
65+
desc: Build and open the English version of the book (force rebuild all notebooks)
66+
cmds:
67+
- task: build_book_en_all
68+
- task: open_book_en

docs/en/_config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ bibtex_bibfiles:
2121

2222
# Information about where the book exists on the web
2323
repository:
24-
url: https://github.com/Jij-Inc/JijModeling-Tutorials # Online location of your book
25-
path_to_book: en # Optional path to your book, relative to the repository root
26-
branch: main # Which branch of the repository should be used when creating links (optional)
24+
url: https://github.com/Jij-Inc/JijModeling-Tutorials # Online location of your book
25+
path_to_book: docs/en # Optional path to your book, relative to the repository root
26+
branch: main # Which branch of the repository should be used when creating links (optional)
2727

2828
# Add GitHub buttons to your book
2929
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository

docs/ja/_config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ bibtex_bibfiles:
2121

2222
# Information about where the book exists on the web
2323
repository:
24-
url: https://github.com/Jij-Inc/JijModeling-Tutorials # Online location of your book
25-
path_to_book: docs # Optional path to your book, relative to the repository root
26-
branch: main # Which branch of the repository should be used when creating links (optional)
24+
url: https://github.com/Jij-Inc/JijModeling-Tutorials # Online location of your book
25+
path_to_book: docs/ja # Optional path to your book, relative to the repository root
26+
branch: main # Which branch of the repository should be used when creating links (optional)
2727

2828
# Add GitHub buttons to your book
2929
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository

0 commit comments

Comments
 (0)