Skip to content

Commit

Permalink
Merge pull request #98 from NorthSecond/master
Browse files Browse the repository at this point in the history
加入 Devcontainer 容器化环境支持
  • Loading branch information
吴坎 committed May 10, 2024
2 parents e02c28a + de6fb94 commit 68b6ca8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM texlive/texlive:TL2022-historic

# Install additional packages & fonts
RUN apt-get update -y \
&& \
apt-get install -y --no-install-recommends apt-transport-https ca-certificates software-properties-common \
&& \
sed -i '/^\([^#].*main\)*$/s/main/& contrib non-free/' /etc/apt/sources.list \
&& \
apt-get update -y \
&& \
apt-get install --no-install-recommends -y ttf-mscorefonts-installer make fonts-arphic-ukai fonts-noto-cjk-extra \
&& \
fc-cache

ENV SHELL /bin/bash

CMD ["/bin/bash"]
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"ms-ceintl.vscode-language-pack-zh-hans",
"james-yu.latex-workshop",
"nickfode.latex-formatter"
]
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Compile
run: |
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@

还可以使用 `git tag`,其会像本仓库一样将构建好的 artifact 永久发布到 [releases](https://github.com/SYSU-SCC/sysu-thesis/releases) 中。

### Devcontainer 编辑(本地 & 在线)

> [!IMPORTANT]
> 无论是本地还是在线编辑,都需要首先创建自己的论文仓库,在自己的仓库进行修改,并建议及时 `commit & push` 到远程仓库进行备份。
本模板提供了 [VS Code Remote - Containers](https://code.visualstudio.com/docs/remote/containers) 相关配置文件,包含了 texlive 2022 和 VS Code 中文和 LaTeX Workshop 插件,可用于本地或在线容器化编辑。

- 对于在线编辑,可以使用 [GitHub Codespaces](https://docs.github.com/zh/codespaces/developing-in-a-codespace/creating-a-codespace-for-a-repository) 通过浏览器版本的 VS Code 进行编辑。(请注意,GitHub Codespaces 每月免费额度有限,请注意用量)。
- 而对于本地编辑,需要安装 [Docker](https://docs.docker.com/get-docker/)[VS Code](https://code.visualstudio.com/),并在 VSCode 中安装 [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) 插件。随后打开本仓库,键入 `F1`,选择 `Remote-Containers: Reopen in Container` 即可构建进入容器环境。

在容器环境中,可以使用 `make pdf` 进行编译并生成 `main.pdf` 文件,或者使用 LaTeX Workshop 插件进行编译与预览。

### texlive 编辑(本地)

本模板需要使用 texlive(>=2020) 进行编译,编译命令如下:
Expand Down

0 comments on commit 68b6ca8

Please sign in to comment.