-
Notifications
You must be signed in to change notification settings - Fork 13
Dev Container の追加 #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
dc684be
ADD devcontainer
kimushun1101 e639bf8
Merge branch 'main' into feature/devcontainer
kimushun1101 4f646c1
ADD description for Dev Container
kimushun1101 e25897b
FIX versions
kimushun1101 3805444
MOD .gitignore for .vscode dir
kimushun1101 837c841
FIX devcontainer README.md
kimushun1101 3aabf44
ADD hyper link
kimushun1101 457ae17
Update README for devcontainer
kimushun1101 5666959
MOD vscode task label
kimushun1101 47996d3
Update README for devcontainer
kimushun1101 9fde1d9
Upgrade nodejs version
kimushun1101 c3b62cd
Update README for devcontainer
kimushun1101 c5810ce
Insert final newline
3w36zj6 a4a6f16
Fix typo
3w36zj6 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Rust v1.77 as a base image | ||
FROM rust:1.77-slim | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
curl \ | ||
# install python3, jinja2 pyyaml | ||
python3 \ | ||
python3-pip \ | ||
&& python3 -m pip install --break-system-packages jinja2 PyYAML \ | ||
# install nodejs and serve | ||
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ | ||
&& apt-get install -y nodejs \ | ||
&& npm install -g [email protected] \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
|
||
WORKDIR /workspace | ||
ENV PATH="/root/.cargo/bin:${PATH}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Dev Containerについて | ||
|
||
Visual Studio Codeで編集する場合には、[Dev Container](https://code.visualstudio.com/docs/devcontainers/containers)を使用してローカル環境でWebページの仕上がりを確認することができます。 | ||
Visual Studio Codeでtypst-jp.github.ioディレクトリを開き以下の操作を実施してください。 | ||
1. Ctrl+Shift+Pから`> Dev Containers: Reopen in Container`を実行 | ||
2. ビルドが完了したらブラウザで http://localhost:3000 に接続 | ||
3. ページを更新した際には、Ctrl+shift+Pから`> Tasks: Run task`を実行し`preview: typst-jp documentation`を選択。ビルドが完了したらブラウザを更新。 | ||
|
||
|
||
## 別のエディターを使用している場合 | ||
|
||
別のエディターで編集している場合にもDockerfileの使用のみであれば可能です。 | ||
ターミナルから typst-jp.github.io ディレクトリ上で以下のコマンドを実行してください。 | ||
1. Docker imageをビルドして実行 | ||
``` | ||
docker build . -f .devcontainer/Dockerfile -t typst-jp-doc | ||
docker run --name typst-jp-doc -p 3000:3000 -it -v "$(pwd):/workspace" -w /workspace --rm typst-jp-doc /bin/bash | ||
``` | ||
2. Dockerコンテナ内でビルド | ||
``` | ||
cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && npx serve -n ./dist | ||
``` | ||
3. ビルドが完了したらブラウザで http://localhost:3000 に接続 | ||
4. ファイルを更新した際には、2 のコマンドを再度実行して、ブラウザを更新。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "typst-jp-domumentation", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": ".." | ||
}, | ||
"forwardPorts": [3000], | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached", | ||
"workspaceFolder": "/workspace", | ||
"postStartCommand": "cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && npx serve -n ./dist" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# General | ||
.vscode | ||
# .vscode | ||
.idea | ||
_things | ||
desktop.ini | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "preview: typst-jp documentation", | ||
"type": "shell", | ||
"command": "cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && echo reload or open http://localhost:3000", | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.