Compare commits
No commits in common. "2580b1a49888b32601b5d796f8b268226b806c22" and "7fdbc77a7f5231dde9d6a29dfa5ce2d5150b610a" have entirely different histories.
2580b1a498
...
7fdbc77a7f
11 changed files with 88 additions and 101 deletions
|
@ -1,19 +1,14 @@
|
|||
FROM docker.io/ldericher/autodoc:diagram
|
||||
|
||||
RUN set -ex; \
|
||||
\
|
||||
# source: https://stackoverflow.com/a/39420880
|
||||
ln -s \
|
||||
/workspaces/lev-templates/deploy/pdfa \
|
||||
/opt/ \
|
||||
; \
|
||||
COPY pdfa /opt/pdfa
|
||||
|
||||
# install TeXoffice
|
||||
ln -s \
|
||||
/workspaces/lev-templates/deploy/texoffice \
|
||||
/opt/texlive/texdir/texmf-dist/tex/latex/texoffice \
|
||||
; \
|
||||
COPY --chown=root:root \
|
||||
texoffice \
|
||||
/opt/texlive/texdir/texmf-dist/tex/latex/texoffice
|
||||
|
||||
RUN /opt/texlive/texdir/bin/default/texconfig rehash
|
||||
|
||||
# install lenaisten directory
|
||||
ln -s \
|
||||
/workspaces/lev-templates/src/lenaisten \
|
||||
/opt/lenaisten \
|
||||
;
|
||||
COPY --chown=root:root lenaisten /opt/lenaisten
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
"postCreateCommand": "whoami; sudo /opt/texlive/texdir/bin/default/texconfig rehash",
|
||||
|
||||
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode"
|
||||
|
||||
|
|
2
.gitattributes
vendored
2
.gitattributes
vendored
|
@ -1,3 +1,3 @@
|
|||
deploy/pdfa/bin/* filter=lfs diff=lfs merge=lfs -text
|
||||
.devcontainer/pdfa/bin/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
|
@ -1,64 +0,0 @@
|
|||
# compile markdown using pandoc
|
||||
# params:
|
||||
# 1: input file
|
||||
# 2: pandoc template
|
||||
# 3: output format
|
||||
# 4: output file
|
||||
compile_md = pandoc \
|
||||
$(1) \
|
||||
--standalone \
|
||||
--from markdown \
|
||||
--to $(3) \
|
||||
--template $(2) \
|
||||
--variable colorlinks:true \
|
||||
--variable csquotes:true \
|
||||
--variable hyperrefoptions:pdfa \
|
||||
--variable lang:de-DE \
|
||||
--output $(4)
|
||||
|
||||
GSFLAGS := \
|
||||
-sDEVICE=pdfwrite \
|
||||
-dNOOUTERSAVE \
|
||||
-dNOPAUSE \
|
||||
-dQUIET \
|
||||
-dBATCH
|
||||
|
||||
# post-process and compress PDF files
|
||||
# params:
|
||||
# 1: input file
|
||||
# 2: output file
|
||||
postprocess_pdf = gs \
|
||||
$(GSFLAGS) \
|
||||
-sPAPERSIZE=a4 \
|
||||
-dFIXEDMEDIA \
|
||||
-dPDFFitPage \
|
||||
-dCompatibilityLevel=1.7 \
|
||||
-dPDFSETTINGS=/ebook \
|
||||
-sOutputFile=$(2) \
|
||||
$(1)
|
||||
|
||||
# convert PDF to PDF/A 2-b
|
||||
# params:
|
||||
# 1: input file
|
||||
# 2: output file
|
||||
convert_pdfa = /opt/pdfa/bin/gs-919-linux_x86_64 \
|
||||
$(GSFLAGS) \
|
||||
-dPDFA=2 \
|
||||
-sProcessColorModel=DeviceRGB \
|
||||
-dPDFACompatibilityPolicy=1 \
|
||||
-sOutputFile=$(2) \
|
||||
/opt/pdfa/PDFA_def.ps \
|
||||
$(1)
|
||||
|
||||
# convert markdown to PDF
|
||||
# params:
|
||||
# 1: input file
|
||||
# 2: pandoc template
|
||||
# 3: output file
|
||||
md2pdf = $(call compile_md,$(1),$(2),pdf,-) | $(call postprocess_pdf,-,$(3))
|
||||
|
||||
# convert markdown to PDF
|
||||
# 1: input file
|
||||
# 2: pandoc template
|
||||
# 3: output file
|
||||
md2pdfa = $(call md2pdf,$(1),$(2),-) | $(call convert_pdfa,-,$(3))
|
|
@ -1,39 +1,97 @@
|
|||
#%SRCPAT% \.prot\.md
|
||||
|
||||
include /opt/lenaisten/lev-templates.mk
|
||||
############
|
||||
# Settings #
|
||||
############
|
||||
|
||||
suffixPub :=
|
||||
suffixInt := _intern
|
||||
|
||||
|
||||
###########
|
||||
# Default #
|
||||
###########
|
||||
|
||||
suffixSubst = $(patsubst %.$(2),%$(4).$(3),$(1))
|
||||
|
||||
mdFiles := $(wildcard *.prot.md)
|
||||
mdSuffix = $(patsubst %.prot.md,%$(1),$(mdFiles))
|
||||
|
||||
pdfFilesPub := $(call mdSuffix,$(suffixPub).pdf)
|
||||
texFilesPub := $(call mdSuffix,$(suffixPub).tex)
|
||||
pdfFilesPub := $(call suffixSubst,$(mdFiles),prot.md,pdf,$(suffixPub))
|
||||
texFilesPub := $(call suffixSubst,$(mdFiles),prot.md,tex,$(suffixPub))
|
||||
|
||||
pdfFilesInt := $(call mdSuffix,$(suffixInt).pdf)
|
||||
texFilesInt := $(call mdSuffix,$(suffixInt).tex)
|
||||
pdfFilesInt := $(call suffixSubst,$(mdFiles),prot.md,pdf,$(suffixInt))
|
||||
texFilesInt := $(call suffixSubst,$(mdFiles),prot.md,tex,$(suffixInt))
|
||||
|
||||
.PHONY: all autodoc
|
||||
all: pdf tex
|
||||
autodoc: pdf
|
||||
.PHONY: all pdf pdfPub pdfInt tex texPub texInt
|
||||
all: pdf
|
||||
|
||||
.PHONY: pdf tex
|
||||
pdf: $(pdfFilesPub) $(pdfFilesInt)
|
||||
tex: $(texFilesPub) $(texFilesInt)
|
||||
pdf: pdfPub pdfInt
|
||||
pdfPub: $(pdfFilesPub)
|
||||
pdfInt: $(pdfFilesInt)
|
||||
|
||||
tex: texPub texInt
|
||||
texPub: $(texFilesPub)
|
||||
texInt: $(texFilesInt)
|
||||
|
||||
|
||||
###########
|
||||
# Recipes #
|
||||
###########
|
||||
|
||||
compile_md = pandoc \
|
||||
$(2) \
|
||||
--standalone \
|
||||
--from markdown \
|
||||
--to $(1) \
|
||||
--template lev-protokoll \
|
||||
--variable colorlinks:true \
|
||||
--variable csquotes:true \
|
||||
--variable hyperrefoptions:pdfa \
|
||||
--variable lang:de-DE \
|
||||
--output $(3)
|
||||
|
||||
GSFLAGS := \
|
||||
-sDEVICE=pdfwrite \
|
||||
-dNOOUTERSAVE \
|
||||
-dNOPAUSE \
|
||||
-dQUIET \
|
||||
-dBATCH
|
||||
|
||||
postprocess_pdf = gs \
|
||||
$(GSFLAGS) \
|
||||
-sPAPERSIZE=a4 \
|
||||
-dFIXEDMEDIA \
|
||||
-dPDFFitPage \
|
||||
-dCompatibilityLevel=1.7 \
|
||||
-dPDFSETTINGS=/ebook \
|
||||
-sOutputFile=$(2) \
|
||||
$(1)
|
||||
|
||||
convert_pdfa = /opt/pdfa/bin/gs-919-linux_x86_64 \
|
||||
$(GSFLAGS) \
|
||||
-dPDFA=2 \
|
||||
-sProcessColorModel=DeviceRGB \
|
||||
-dPDFACompatibilityPolicy=1 \
|
||||
-sOutputFile=$(2) \
|
||||
/opt/pdfa/PDFA_def.ps \
|
||||
$(1)
|
||||
|
||||
md2pdf = $(call compile_md,pdf,$(1),-) | $(call postprocess_pdf,-,$(2))
|
||||
|
||||
md2pdfa = $(call md2pdf,$(1),-) | $(call convert_pdfa,-,$(2))
|
||||
|
||||
# pdf
|
||||
|
||||
%$(suffixPub).pdf: %.prot.md lev-shorthands.sty
|
||||
python3 /opt/lenaisten/redact.py $< | $(call md2pdfa,-,lev-protokoll,$@)
|
||||
python3 /opt/lenaisten/redact.py $< | $(call md2pdfa,-,$@)
|
||||
|
||||
%$(suffixInt).pdf: %.prot.md lev-shorthands.sty
|
||||
python3 /opt/lenaisten/redact.py --internal $< | $(call md2pdfa,-,lev-protokoll,$@)
|
||||
python3 /opt/lenaisten/redact.py -i $< | $(call md2pdfa,-,$@)
|
||||
|
||||
# tex
|
||||
|
||||
%$(suffixPub).tex: %.prot.md lev-shorthands.sty
|
||||
python3 /opt/lenaisten/redact.py $< | $(call compile_md,-,lev-protokoll,latex,$@)
|
||||
python3 /opt/lenaisten/redact.py $< | $(call compile_md,latex,-,$@)
|
||||
|
||||
%$(suffixInt).tex: %.prot.md lev-shorthands.sty
|
||||
python3 /opt/lenaisten/redact.py --internal $< | $(call compile_md,-,lev-protokoll,latex,$@)
|
||||
python3 /opt/lenaisten/redact.py -i $< | $(call compile_md,latex,-,$@)
|
||||
|
|
Loading…
Reference in a new issue