mirror of
https://github.com/ldericher/autodoc.git
synced 2025-12-06 23:52:59 +00:00
Compare commits
No commits in common. "master" and "v0.6.0" have entirely different histories.
12 changed files with 45 additions and 222 deletions
25
.drone.yml
25
.drone.yml
|
|
@ -3,33 +3,12 @@ kind: pipeline
|
||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: default
|
- name: docker
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
repo: ldericher/autodoc
|
repo: ldericher/autodoc
|
||||||
|
auto_tag: true
|
||||||
username:
|
username:
|
||||||
from_secret: DOCKER_USERNAME
|
from_secret: DOCKER_USERNAME
|
||||||
password:
|
password:
|
||||||
from_secret: DOCKER_PASSWORD
|
from_secret: DOCKER_PASSWORD
|
||||||
auto_tag: true
|
|
||||||
dockerfile: Dockerfile.alpine
|
|
||||||
target: stage-base
|
|
||||||
|
|
||||||
- name: diagram
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
repo: ldericher/autodoc
|
|
||||||
username:
|
|
||||||
from_secret: DOCKER_USERNAME
|
|
||||||
password:
|
|
||||||
from_secret: DOCKER_PASSWORD
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: diagram
|
|
||||||
dockerfile: Dockerfile.ubuntu
|
|
||||||
target: stage-diagram
|
|
||||||
|
|
||||||
- name: parallelism provider
|
|
||||||
image: alpine
|
|
||||||
depends_on:
|
|
||||||
- default
|
|
||||||
- diagram
|
|
||||||
|
|
|
||||||
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -1 +0,0 @@
|
||||||
*.icc filter=lfs diff=lfs merge=lfs -text
|
|
||||||
15
Dockerfile
Normal file
15
Dockerfile
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
FROM pandoc/extra:latest
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
apk add --no-cache \
|
||||||
|
bash \
|
||||||
|
inotify-tools \
|
||||||
|
make \
|
||||||
|
;
|
||||||
|
|
||||||
|
COPY src/usr /usr
|
||||||
|
|
||||||
|
WORKDIR /docs
|
||||||
|
ENTRYPOINT ["autodoc"]
|
||||||
|
CMD ["-bw"]
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
FROM pandoc/extra:latest AS stage-base
|
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
\
|
|
||||||
apk add --no-cache \
|
|
||||||
bash \
|
|
||||||
ghostscript \
|
|
||||||
inotify-tools \
|
|
||||||
make \
|
|
||||||
patch \
|
|
||||||
; \
|
|
||||||
\
|
|
||||||
tlmgr update --self; \
|
|
||||||
\
|
|
||||||
tlmgr install \
|
|
||||||
kpfonts \
|
|
||||||
lastpage \
|
|
||||||
latexmk \
|
|
||||||
twemojis \
|
|
||||||
;
|
|
||||||
|
|
||||||
COPY src/usr /usr
|
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
\
|
|
||||||
cp /usr/share/ghostscript/lib/PDFA_def.ps /usr/local/share/autodoc/; \
|
|
||||||
patch -d /usr/local/share/autodoc < /usr/local/share/autodoc/PDFA_def.ps.patch; \
|
|
||||||
rm /usr/local/share/autodoc/PDFA_def.ps.patch;
|
|
||||||
|
|
||||||
WORKDIR /docs
|
|
||||||
ENTRYPOINT ["autodoc"]
|
|
||||||
CMD ["-bw"]
|
|
||||||
|
|
||||||
FROM stage-base AS stage-diagram
|
|
||||||
|
|
||||||
ENV PUPPETEER_CACHE_DIR="/usr/local/share/puppeteer/cache" \
|
|
||||||
PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium-browser" \
|
|
||||||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
|
|
||||||
|
|
||||||
COPY src/diagram.lua.patch /usr/local/src/autodoc/diagram.lua.patch
|
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
\
|
|
||||||
apk add --no-cache \
|
|
||||||
chromium \
|
|
||||||
npm \
|
|
||||||
; \
|
|
||||||
\
|
|
||||||
npm install --global @mermaid-js/mermaid-cli; \
|
|
||||||
# rm -rf /root/.cache/puppeteer; \
|
|
||||||
\
|
|
||||||
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;
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
FROM pandoc/extra:latest-ubuntu AS stage-base
|
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
\
|
|
||||||
deluser --remove-home ubuntu; \
|
|
||||||
\
|
|
||||||
apt-get update; apt-get install --no-install-recommends --yes \
|
|
||||||
ghostscript \
|
|
||||||
inotify-tools \
|
|
||||||
make \
|
|
||||||
patch \
|
|
||||||
; rm -rf /var/lib/apt/lists/*; \
|
|
||||||
\
|
|
||||||
tlmgr update --self; \
|
|
||||||
\
|
|
||||||
tlmgr install \
|
|
||||||
kpfonts \
|
|
||||||
lastpage \
|
|
||||||
latexmk \
|
|
||||||
twemojis \
|
|
||||||
;
|
|
||||||
|
|
||||||
COPY src/usr /usr
|
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
\
|
|
||||||
cp /usr/share/ghostscript/10.02.1/lib/PDFA_def.ps /usr/local/share/autodoc/; \
|
|
||||||
patch -d /usr/local/share/autodoc < /usr/local/share/autodoc/PDFA_def.ps.patch; \
|
|
||||||
rm /usr/local/share/autodoc/PDFA_def.ps.patch;
|
|
||||||
|
|
||||||
WORKDIR /docs
|
|
||||||
ENTRYPOINT ["autodoc"]
|
|
||||||
CMD ["-bw"]
|
|
||||||
|
|
||||||
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 --no-install-recommends --yes \
|
|
||||||
libasound2t64 \
|
|
||||||
libatk1.0-0t64 \
|
|
||||||
libatk-bridge2.0-0t64 \
|
|
||||||
libgbm1 \
|
|
||||||
libnss3 \
|
|
||||||
libxcomposite1 \
|
|
||||||
libxdamage1 \
|
|
||||||
libxfixes3 \
|
|
||||||
libxkbcommon0 \
|
|
||||||
libxrandr2 \
|
|
||||||
npm \
|
|
||||||
; rm -rf /var/lib/apt/lists/*; \
|
|
||||||
\
|
|
||||||
npm install --global @mermaid-js/mermaid-cli; \
|
|
||||||
\
|
|
||||||
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;
|
|
||||||
28
Makefile
Normal file
28
Makefile
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
image_tag = ldericher/autodoc
|
||||||
|
docker_build = docker build
|
||||||
|
docker_run = docker run --rm -it
|
||||||
|
examples_flags = -v "$(shell pwd)/examples:/docs" -u "$(shell id -u):$(shell id -g)"
|
||||||
|
|
||||||
|
.PHONY: default
|
||||||
|
default:
|
||||||
|
$(info use other targets: image build watch shell clean)
|
||||||
|
|
||||||
|
.PHONY: image
|
||||||
|
image:
|
||||||
|
$(docker_build) --tag $(image_tag) ./
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build: image
|
||||||
|
$(docker_run) $(examples_flags) $(image_tag) -b
|
||||||
|
|
||||||
|
.PHONY: watch
|
||||||
|
watch: image
|
||||||
|
$(docker_run) $(examples_flags) $(image_tag)
|
||||||
|
|
||||||
|
.PHONY: shell
|
||||||
|
shell: image
|
||||||
|
$(docker_run) $(examples_flags) --entrypoint ash $(image_tag)
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
git clean -xdf ./examples
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
--- diagram.lua
|
|
||||||
+++ diagram.lua
|
|
||||||
@@ -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
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
--- PDFA_def.ps
|
|
||||||
+++ PDFA_def.ps
|
|
||||||
@@ -9,7 +9,7 @@
|
|
||||||
/DOCINFO pdfmark
|
|
||||||
|
|
||||||
% Define an ICC profile :
|
|
||||||
-/ICCProfile (srgb.icc) % Customise
|
|
||||||
+/ICCProfile (/usr/local/share/autodoc/sRGB.icc) % Customise
|
|
||||||
def
|
|
||||||
|
|
||||||
[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark
|
|
||||||
BIN
src/usr/local/share/autodoc/compatibleWithAdobeRGB1998.icc
(Stored with Git LFS)
BIN
src/usr/local/share/autodoc/compatibleWithAdobeRGB1998.icc
(Stored with Git LFS)
Binary file not shown.
|
|
@ -1,46 +0,0 @@
|
||||||
#############
|
|
||||||
# FUNCTIONS #
|
|
||||||
#############
|
|
||||||
|
|
||||||
PDFTOOLS_GSFLAGS := \
|
|
||||||
-sDEVICE=pdfwrite \
|
|
||||||
-dNOOUTERSAVE \
|
|
||||||
-dNOPAUSE \
|
|
||||||
-dQUIET \
|
|
||||||
-dBATCH
|
|
||||||
|
|
||||||
pdftools_pdfcat = gs \
|
|
||||||
$(PDFTOOLS_GSFLAGS) \
|
|
||||||
-sPAPERSIZE=a4 \
|
|
||||||
-dFIXEDMEDIA \
|
|
||||||
-dPDFFitPage \
|
|
||||||
-dCompatibilityLevel=1.7 \
|
|
||||||
-dPDFSETTINGS=/ebook \
|
|
||||||
-sOutputFile=$(2) \
|
|
||||||
$(1)
|
|
||||||
|
|
||||||
pdftools_mkpdfa = gs \
|
|
||||||
$(PDFTOOLS_GSFLAGS) \
|
|
||||||
-dPDFA=$(1) \
|
|
||||||
-sColorConversionStrategy=RGB \
|
|
||||||
-dPDFACompatibilityPolicy=1 \
|
|
||||||
--permit-file-read=/usr/local/share/autodoc/ \
|
|
||||||
-sOutputFile=$(3) \
|
|
||||||
/usr/local/share/autodoc/PDFA_def.ps \
|
|
||||||
$(2)
|
|
||||||
|
|
||||||
############
|
|
||||||
# PATTERNS #
|
|
||||||
############
|
|
||||||
|
|
||||||
# convert PDF to PDF/A-2B
|
|
||||||
%_pdfa2.pdf: %.pdf
|
|
||||||
$(call pdftools_mkpdfa,2,$<,$@)
|
|
||||||
|
|
||||||
# convert PDF to PDF/A-3B
|
|
||||||
%_pdfa3.pdf: %.pdf
|
|
||||||
$(call pdftools_mkpdfa,3,$<,$@)
|
|
||||||
|
|
||||||
# convert PDF to PDF/A (default variant 3B)
|
|
||||||
%_pdfa.pdf: %.pdf
|
|
||||||
$(call pdftools_mkpdfa,3,$<,$@)
|
|
||||||
BIN
src/usr/local/share/autodoc/sRGB.icc
(Stored with Git LFS)
BIN
src/usr/local/share/autodoc/sRGB.icc
(Stored with Git LFS)
Binary file not shown.
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"args": [ "--no-sandbox" ]
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue