Skip to content
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

增加devcontainer开发容器功能 #10

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .devcontainer/build_from_scratch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04

LABEL dev.containers.features="common"

RUN mkdir -p ~/tmp/texlive \
&& cd ~/tmp/texlive \
&& wget --no-check-certificate https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz \
&& zcat < install-tl-unx.tar.gz | tar xf - \
&& cd $(ls -d install-tl-* | head -n 1) \
&& perl ./install-tl --no-interaction --repository https://ctan.math.washington.edu/tex-archive/systems/texlive/tlnet \
&& rm -rf ~/tmp

RUN latest_texlive_path="$(ls -d /usr/local/texlive/[0-9]* | sort -n | tail -1)/bin/x86_64-linux" \
&& echo "export PATH=\'$latest_texlive_path:\$PATH\'" >> ~/.bashrc \
&& echo "export PATH=\'$latest_texlive_path:\$PATH\'" >> ~/.zshrc \
&& echo "export PATH=\'$latest_texlive_path:\$PATH\'" >> ~/.profile \
&& env PATH=$PATH $latest_texlive_path/tlmgr path add \
&& $latest_texlive_path/tlmgr init-usertree

COPY fonts /usr/share/fonts/chinese

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends libfontconfig1 \
&& rm -rf /var/lib/apt/lists/*
24 changes: 24 additions & 0 deletions .devcontainer/build_from_scratch/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "LaTeXspaces-build_from_scratch",
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .devcontainer/build_from_scratch/fonts/SIMKAI.TTF
Binary file not shown.
Binary file added .devcontainer/build_from_scratch/fonts/SIMSUN.TTC
Binary file not shown.
Binary file not shown.
Binary file added .devcontainer/build_from_scratch/fonts/TIMES.TTF
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
67 changes: 67 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "LaTeXspaces-prebuild",
"image": "ghcr.io/w0n9/images/ubuntu-latex:20241008",
// "remoteUser": "vscode",
"customizations": {
"vscode": {
"extensions": [
// "GitHub.copilot",
"James-Yu.latex-workshop"
],
"settings": {
// "files.autoSave": "onFocusChange",
// "latex-workshop.latex.autoBuild.run": "onSave",
// "latex-workshop.latex.recipe.default": "lastUsed",
// "latex-workshop.latex.outDir": "./PDF",
"latex-workshop.showContextMenu": true, //启用上下文LaTeX菜单
"latex-workshop.latex.autoBuild.run": "onSave", //手动编译
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
"latex-workshop.latex.recipe.default": "lastUsed", // 编译时使用上一次使用的编译指令
"latex-workshop.intellisense.package.enabled": true, //根据加载的包,自动完成命令或包
"latex-workshop.latex.recipes": [
Comment on lines +11 to +22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Reconsider hiding error and warning messages.

The VSCode settings provide a good configuration for LaTeX development. However, there are a couple of points to consider:

  1. Hiding error and warning messages (lines 18-19) might prevent users from seeing important information about their LaTeX documents. Consider enabling these or making them configurable by the user.

  2. There are several commented out settings (lines 12-15) that might be useful. Review these and consider if they should be enabled or removed if not needed.

Consider applying this diff to show error and warning messages:

-                "latex-workshop.message.error.show": false,
-                "latex-workshop.message.warning.show": false,
+                "latex-workshop.message.error.show": true,
+                "latex-workshop.message.warning.show": true,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"settings": {
// "files.autoSave": "onFocusChange",
// "latex-workshop.latex.autoBuild.run": "onSave",
// "latex-workshop.latex.recipe.default": "lastUsed",
// "latex-workshop.latex.outDir": "./PDF",
"latex-workshop.showContextMenu": true, //启用上下文LaTeX菜单
"latex-workshop.latex.autoBuild.run": "onSave", //手动编译
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
"latex-workshop.latex.recipe.default": "lastUsed", // 编译时使用上一次使用的编译指令
"latex-workshop.intellisense.package.enabled": true, //根据加载的包,自动完成命令或包
"latex-workshop.latex.recipes": [
"settings": {
// "files.autoSave": "onFocusChange",
// "latex-workshop.latex.autoBuild.run": "onSave",
// "latex-workshop.latex.recipe.default": "lastUsed",
// "latex-workshop.latex.outDir": "./PDF",
"latex-workshop.showContextMenu": true, //启用上下文LaTeX菜单
"latex-workshop.latex.autoBuild.run": "onSave", //手动编译
"latex-workshop.message.error.show": true,
"latex-workshop.message.warning.show": true,
"latex-workshop.latex.recipe.default": "lastUsed", // 编译时使用上一次使用的编译指令
"latex-workshop.intellisense.package.enabled": true, //根据加载的包,自动完成命令或包
"latex-workshop.latex.recipes": [

{
"name": "latexmk",
"tools": [
"latexmk"
]
}
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
}
],
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk"
],
"latex-workshop.synctex.afterBuild.enabled": true,
}
}
},
"features": {}
}