commit b6223c6215908dc881d83b2fef94309151b286c5 Author: Wei, Jing Date: Sat Mar 26 14:45:45 2022 +0800 初始提交 要提交的变更: 新文件: Dockerfile 新文件: README.rst 新文件: mermaid/config.json 新文件: mermaid/puppeteer-config.json Signed-off-by: Wei, Jing diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..99c0a9d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,52 @@ +FROM debian:11 + +WORKDIR /docs + +RUN rm /etc/apt/sources.list +RUN echo "deb http://mirrors.rd.in.linx/debian/ bullseye main non-free contrib \n\ +deb http://mirrors.rd.in.linx/debian/ bullseye-updates main non-free contrib\n\ +deb http://mirrors.rd.in.linx/debian/ bullseye-backports main non-free contrib\n" > /etc/apt/sources.list + +RUN apt-get update \ + && apt-get install -y \ + python3-pip \ + latexmk \ + texlive-xetex \ + texlive-lang-chinese \ + latex-cjk-all \ + python3-pygments \ + fonts-freefont-otf \ + git \ + xindy \ + python3-dev \ + zlib1g-dev \ + libjpeg-dev \ + node-mermaid \ + apt-utils \ + sshpass \ + wget \ + bash \ + npm \ + libgbm1 \ + libasound2 \ + locales \ + graphviz +RUN apt-get autoremove \ + && apt-get clean \ + && rm /var/cache/apt/archives/*.deb /root/.cache/ /var/lib/apt/lists/* -rf +RUN pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple +RUN pip3 install sphinx \ + sphinxcontrib-mermaid \ + sphinxcontrib-tikz \ + sphinx_rtd_theme \ + docxbuilder \ + docxbuilder[math] \ + sphinxcontrib-bibtex \ + sphinxcontrib-blockdiag +RUN pip3 install git+http://gitlab.rd.in.linx/GNU/linuxdoc.git +RUN npm config set registry https://registry.npm.taobao.org +RUN cd /usr/local/; npm install @mermaid-js/mermaid-cli +RUN mkdir /usr/local/etc/mermaid +ADD mermaid/config.json /usr/local/etc/mermaid/config.json +ADD mermaid/puppeteer-config.json /usr/local/etc/mermaid/puppeteer-config.json +ENV PS1='Sphinx-builder#' diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..5b31950 --- /dev/null +++ b/README.rst @@ -0,0 +1,23 @@ +使用说明 +========= + +构建镜像 +--------- + +docker build -t sphinx-doc . + +查看镜像 +--------- + +docker images | grep sphinx-doc + +使用镜像 +--------- + +docker run --rm -v 本地文档所在目录:/docs sphinx-doc:latest make latexpdf + +docker run --rm -v /tmp/doc:/docs sphinx-doc:latest make latexpdf + + + + diff --git a/mermaid/config.json b/mermaid/config.json new file mode 100644 index 0000000..d9c5e80 --- /dev/null +++ b/mermaid/config.json @@ -0,0 +1,14 @@ +{ + "startOnLoad": true, + "flowchart": { + "useMaxWidth": false, + "htmlLabels": true + }, + "sequence": { + "height": 40, + "actorMargin": 80, + "mirrorActors": false, + "bottomMarginAdj": 1 + }, + "theme": "default" +} diff --git a/mermaid/puppeteer-config.json b/mermaid/puppeteer-config.json new file mode 100644 index 0000000..261852f --- /dev/null +++ b/mermaid/puppeteer-config.json @@ -0,0 +1,5 @@ +{ + "args": [ + "--no-sandbox" + ] +}