From e70523d704b2c7df779e97a1e69e4e5df308eceb Mon Sep 17 00:00:00 2001 From: ulrich Date: Tue, 21 Jul 2020 13:33:25 +0000 Subject: [PATCH] In Arbeit: PDF Theme, noch als Parameter abfassen --- src/de/uhilger/wbx/web/AdocServlet.java | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/de/uhilger/wbx/web/AdocServlet.java b/src/de/uhilger/wbx/web/AdocServlet.java index 2b55c81..4ee14f7 100644 --- a/src/de/uhilger/wbx/web/AdocServlet.java +++ b/src/de/uhilger/wbx/web/AdocServlet.java @@ -125,9 +125,20 @@ * nach PDF transformiert werden soll */ private void transform(String fileName, String backend) { + Map<String, Object> attributes; File outFile = new File(fileName); - Map<String, Object> attributes = attributes().attribute("pdf-themesdir", outFile.getParent()).attribute("pdf-theme","test").sourceHighlighter("highlightjs") - .asMap(); + File pdfStyles = new File(outFile.getParentFile(), "custom-theme.yml"); + if(pdfStyles.exists()) { + attributes = attributes() + .attribute("pdf-themesdir", outFile.getParent()) + .attribute("pdf-theme","custom") + .sourceHighlighter("highlightjs") + .asMap(); + } else { + attributes = attributes() + .sourceHighlighter("highlightjs") + .asMap(); + } Map<String, Object> options; if(null != backend) { options = options().inPlace(false) -- Gitblit v1.9.3