mirror of
https://github.com/ldericher/autodoc.git
synced 2025-12-06 15:43:01 +00:00
puppeteer configuration
This commit is contained in:
parent
f3219e9477
commit
91699e95ca
3 changed files with 25 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ RUN set -ex; \
|
|||
\
|
||||
deluser --remove-home ubuntu; \
|
||||
\
|
||||
apt-get update; apt-get install -y \
|
||||
apt-get update; apt-get install --no-install-recommends --yes \
|
||||
ghostscript \
|
||||
inotify-tools \
|
||||
make \
|
||||
|
|
@ -22,11 +22,15 @@ WORKDIR /docs
|
|||
ENTRYPOINT ["autodoc"]
|
||||
CMD ["-bw"]
|
||||
|
||||
FROM stage-base AS stage-diagrams
|
||||
FROM stage-base AS stage-diagram
|
||||
|
||||
ENV PUPPETEER_CACHE_DIR="/usr/local/share/puppeteer/cache"
|
||||
|
||||
COPY src/diagram.lua.patch /usr/local/src/autodoc/diagram.lua.patch
|
||||
|
||||
RUN set -ex; \
|
||||
\
|
||||
apt-get update; apt-get install -y \
|
||||
apt-get update; apt-get install --no-install-recommends --yes \
|
||||
libasound2t64 \
|
||||
libatk1.0-0t64 \
|
||||
libatk-bridge2.0-0t64 \
|
||||
|
|
@ -38,6 +42,7 @@ RUN set -ex; \
|
|||
libxkbcommon0 \
|
||||
libxrandr2 \
|
||||
npm \
|
||||
patch \
|
||||
; rm -rf /var/lib/apt/lists/*; \
|
||||
\
|
||||
npm install --global @mermaid-js/mermaid-cli; \
|
||||
|
|
@ -45,4 +50,6 @@ RUN set -ex; \
|
|||
wget \
|
||||
--output-document='/usr/local/share/pandoc/filters/diagram.lua' \
|
||||
'https://raw.githubusercontent.com/pandoc-ext/diagram/refs/heads/main/_extensions/diagram/diagram.lua' \
|
||||
;
|
||||
; \
|
||||
patch /usr/local/share/pandoc/filters/diagram.lua < /usr/local/src/autodoc/diagram.lua.patch; \
|
||||
rm /usr/local/src/autodoc/diagram.lua.patch;
|
||||
|
|
|
|||
11
src/diagram.lua.patch
Normal file
11
src/diagram.lua.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- diagram.lua 2024-11-18 23:55:02.673989033 +0100
|
||||
+++ diagram.patched.lua 2024-11-19 00:10:14.359878550 +0100
|
||||
@@ -158,7 +158,7 @@
|
||||
write_file(infile, code)
|
||||
pipe(
|
||||
self.execpath or 'mmdc',
|
||||
- {"--pdfFit", "--input", infile, "--output", outfile},
|
||||
+ {"--pdfFit", "--puppeteerConfigFile", "/usr/local/share/puppeteer/config.json", "--input", infile, "--output", outfile},
|
||||
''
|
||||
)
|
||||
return read_file(outfile), mime_type
|
||||
3
src/usr/local/share/puppeteer/config.json
Normal file
3
src/usr/local/share/puppeteer/config.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"args": [ "--no-sandbox" ]
|
||||
}
|
||||
Loading…
Reference in a new issue