public class MarkdownService extends Object
Configuration.getTemplatesResource() folder, extract
Placeholders between Configuration.getPlaceholderBegin() and Configuration.getPlaceholderEnd()
tags, create ReportDocuments which represent a content of the placeholders and generate new documents in the
Configuration.getTargetDirectory() with the new content instead of placeholders.| Modifier and Type | Field and Description |
|---|---|
private static String |
IGNORE_SYNTAX_ERROR_PLACEHOLDER_PARAMETER |
private static String |
IMAGE_DIRECTORY_NAME |
private static MarkdownService |
instance
Singleton.
|
private static org.slf4j.Logger |
logger |
private static String |
SLASH |
private static String |
SVG_FILE_EXTENSION |
private static String |
SVG_TAG_BEGIN |
private static String |
SVG_TAG_END |
private static String |
SVG_TAG_MIDDLE |
private static String |
SYNTAX_ERROR_GENERATED_KEYWORD |
| Constructor and Description |
|---|
MarkdownService() |
| Modifier and Type | Method and Description |
|---|---|
private void |
createDirectoryIfNotExists(File directory) |
String |
generateDiagram(Placeholder placeholder,
String plantUml,
SubstitutionContext substitutionContext)
Generate SVG image file and a link to the file.
|
private String |
generateSvgFileAndTagForMarkdown(File mdFile,
File imageDirectory,
String plantUml,
Placeholder placeholder,
boolean replaceFilterId) |
static MarkdownService |
getInstance() |
private String |
replaceFilterId(String svg)
Replace all occurrences of the generated ids with constants.
|
private static final org.slf4j.Logger logger
private static final String SLASH
private static final String IMAGE_DIRECTORY_NAME
private static final String SVG_FILE_EXTENSION
private static final String SVG_TAG_BEGIN
private static final String SVG_TAG_MIDDLE
private static final String SVG_TAG_END
private static final String SYNTAX_ERROR_GENERATED_KEYWORD
private static final String IGNORE_SYNTAX_ERROR_PLACEHOLDER_PARAMETER
private static final MarkdownService instance
public MarkdownService()
public static MarkdownService getInstance()
MarkdownService singleton.public String generateDiagram(Placeholder placeholder, String plantUml, SubstitutionContext substitutionContext)
Placeholder.getResource() fieldConfiguration.getTargetDirectory() directoryIMAGE_DIRECTORY_NAME directoryReportDocument form the PlaceholderToReportDocumentServicePrintable.getCacheLines() listgenerateSvgFileAndTagForMarkdown(File, File, String, Placeholder, boolean) methodplaceholder - the state objectplantUml - PlantUML source notation. If the value is 'null', the value will be obtained from
ReportDocument which is stored in
PlaceholderToReportDocumentService.getReportDocument(Placeholder).substitutionContext - the current stateprivate String generateSvgFileAndTagForMarkdown(File mdFile, File imageDirectory, String plantUml, Placeholder placeholder, boolean replaceFilterId)
private String replaceFilterId(String svg)
<filter height="300%" id="f10gnta8ifhhre" width="300%" x="-1" y="-1">
svg - for replacingprivate void createDirectoryIfNotExists(File directory)
Copyright © 2023. All rights reserved.