Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ create_doc:
- doxygen doxygen/Doxyfile
- cd Documentation
- latexmk -pdf doc.tex
- make doc.html

pages:
image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bookworm-buildd
Expand Down
14 changes: 14 additions & 0 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.PHONY: doc.pdf doc.html

doc.pdf:
latexmk -pdf doc.tex

doc.html:
pandoc doc.tex -o doc.html \
--metadata title="ALF Documentaion" \
--mathjax \
-H header-mathjax.html \
--standalone \
--toc \
--css=pandoc.css \
--number-sections
2 changes: 2 additions & 0 deletions Documentation/header-mathjax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

31 changes: 31 additions & 0 deletions Documentation/html-process-images.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python3

from bs4 import BeautifulSoup
import subprocess
from glob import glob

with open("doc.html", "r", encoding="utf-8") as f:
html = f.read()

soup = BeautifulSoup(html, "html.parser")

imgs = []

for tag in soup.find_all("embed", src=True):
if tag["src"].lower().endswith(".pdf"):
imgs.append(tag["src"])

for img in imgs:
files = glob(f'**/{img}', recursive=True)
if len(files) != 1:
print(f'Could not find {img}: {files}')
continue
subprocess.run(["pdftocairo", "-png", "-singlefile", f'../{files[0]}'], cwd='html')
html = html.replace(img, img.split('/')[-1].replace('.pdf', '.png'))

subprocess.run(["pdftocairo", "-png", "-singlefile", '../Figures/U_Profile.pdf'], cwd='html')
html = html.replace('U_profile.pdf', 'U_Profile.png')


with open("html/doc.html", "w", encoding="utf-8") as f:
f.write(html)
Loading