Forcer la sortie des diagrammes en png
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
{{- $description := default $data.description | default $title -}}
|
{{- $description := default $data.description | default $title -}}
|
||||||
{{- $image := .Page.Resources.GetMatch $imgPath -}}
|
{{- $image := .Page.Resources.GetMatch $imgPath -}}
|
||||||
{{- $display := $image }}
|
{{- $display := $image }}
|
||||||
{{- if gt $display.Height 810 }}
|
{{- if and $display (ne $display.MediaType.SubType "svg") (gt $display.Height 810) }}
|
||||||
{{- $display = $image.Resize "x810" -}}
|
{{- $display = $image.Resize "x810" -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<figure>
|
<figure>
|
||||||
@@ -38,4 +38,4 @@
|
|||||||
</p>
|
</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</figure>
|
</figure>
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ async function ensurePuppeteerConfig() {
|
|||||||
|
|
||||||
async function renderMermaidDiagram(inputPath, outputPath) {
|
async function renderMermaidDiagram(inputPath, outputPath) {
|
||||||
const cliPath = getMermaidCliPath();
|
const cliPath = getMermaidCliPath();
|
||||||
const args = ['-i', inputPath, '-o', outputPath];
|
const args = ['-i', inputPath, '-o', outputPath, '-e', 'png'];
|
||||||
const env = { ...process.env };
|
const env = { ...process.env };
|
||||||
|
|
||||||
const executablePath = resolvePuppeteerExecutablePath();
|
const executablePath = resolvePuppeteerExecutablePath();
|
||||||
@@ -206,7 +206,7 @@ async function generateDiagrams(bundlePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const relativePath = path.relative(diagramsRoot, mermaidFile);
|
const relativePath = path.relative(diagramsRoot, mermaidFile);
|
||||||
const outputRelative = relativePath.replace(/\.mermaid$/i, '.svg');
|
const outputRelative = relativePath.replace(/\.mermaid$/i, '.png');
|
||||||
const outputPath = path.join(bundlePath, OUTPUT_DIR, outputRelative);
|
const outputPath = path.join(bundlePath, OUTPUT_DIR, outputRelative);
|
||||||
|
|
||||||
await ensureDirectory(path.dirname(outputPath));
|
await ensureDirectory(path.dirname(outputPath));
|
||||||
|
|||||||
Reference in New Issue
Block a user