Compare commits

..

23 commits

Author SHA1 Message Date
0612070b66 Merge branch 'hotfix/0.9.1' 2025-10-02 13:40:42 +00:00
778e2d79d7 various small fixes
- pdftools: `mkpdfa` invocation
- pdftools: `PDFA_def.ps` location
- use sRGB by default for better compatibility
2025-10-02 13:40:28 +00:00
2298ab3365 Merge branch 'release/0.9.0' 2025-10-02 14:09:03 +02:00
8375be93c6 add "pdftools.mk" 2025-10-02 14:08:17 +02:00
5ac0d47553 Merge tag 'v0.8.2' into develop
include update for tlmgr
2025-05-06 10:34:23 +00:00
b7e1f15406 Merge branch 'release/0.8.2' 2025-05-06 10:33:57 +00:00
eda145186d update tlmgr 2025-05-06 10:33:23 +00:00
c8931beff6 Merge tag 'v0.8.1' into develop
unchanged
2024-11-22 17:56:59 +01:00
a0ee58674a Merge branch 'release/0.8.1' 2024-11-22 17:56:30 +01:00
e91526f326 CI fix "diagram" build 2024-11-22 17:55:33 +01:00
b5537a78af add twemojis support 2024-11-22 17:48:49 +01:00
df42f0965d Merge tag 'v0.8.0' into develop 2024-11-22 17:33:34 +01:00
4d4b418e63 Merge branch 'release/0.8.0' 2024-11-22 17:27:25 +01:00
5119a9596b Merge branch 'feature/diagram' into develop 2024-11-22 17:20:05 +01:00
2aa936e917 CI 2024-11-22 17:19:52 +01:00
5b8786fb33 experimental alpine support for diagram feature (sometimes hangs?) 2024-11-19 01:48:10 +01:00
91699e95ca puppeteer configuration 2024-11-19 01:01:12 +01:00
f3219e9477 merge changes from workstation "Mustafa":
- add ubuntu libraries
- remove unused Makefile
2024-11-18 23:33:28 +01:00
dd96c4852b ubuntu base variant 2024-11-18 20:16:54 +01:00
bca8809396 Merge tag 'v0.7.1' into develop
Add kpfonts lastpage latexmk
2024-04-23 01:25:58 +02:00
bbec02ddcc Merge branch 'release/0.7.1' 2024-04-23 01:25:36 +02:00
49fe0ebda0 add some TeXlive content 2024-04-23 01:25:21 +02:00
e485a4fe67 Merge tag 'v0.7.0' into develop
include gs command
2024-02-29 23:27:24 +01:00
12 changed files with 222 additions and 46 deletions

View file

@ -3,12 +3,33 @@ kind: pipeline
name: default name: default
steps: steps:
- name: docker - name: default
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 Normal file
View file

@ -0,0 +1 @@
*.icc filter=lfs diff=lfs merge=lfs -text

View file

@ -1,16 +0,0 @@
FROM pandoc/extra:latest
RUN set -ex; \
\
apk add --no-cache \
bash \
ghostscript \
inotify-tools \
make \
;
COPY src/usr /usr
WORKDIR /docs
ENTRYPOINT ["autodoc"]
CMD ["-bw"]

57
Dockerfile.alpine Normal file
View file

@ -0,0 +1,57 @@
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;

64
Dockerfile.ubuntu Normal file
View file

@ -0,0 +1,64 @@
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;

View file

@ -1,28 +0,0 @@
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

11
src/diagram.lua.patch Normal file
View file

@ -0,0 +1,11 @@
--- 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

View file

@ -0,0 +1,11 @@
--- 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) Normal file

Binary file not shown.

View file

@ -0,0 +1,46 @@
#############
# 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) Normal file

Binary file not shown.

View file

@ -0,0 +1,3 @@
{
"args": [ "--no-sandbox" ]
}