by mimo opencode
This commit is contained in:
lda
2026-05-30 07:33:42 +07:00 Verified
parent c3b6854e46
commit df1253978a
4 changed files with 678 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
<#
.SYNOPSIS
pandoc wrapper with diagram.lua filter, mermaid, and tikz/xelatex support.
.DESCRIPTION
Sets MERMAID_BIN, TIKZ_BIN, and passes --lua-filter diagram.lua to pandoc.
All other arguments are forwarded to pandoc.
.EXAMPLE
.\pandoc-diagram.ps1 -- input.md -o output.pdf
.\pandoc-diagram.ps1 -- input.md -o output.html --embed-resources
.\pandoc-diagram.ps1 -- input.md -o output.pdf --pdf-engine=xelatex
#>
function whereis($cmd) { Get-Command $cmd -CommandType Application | select-object -ExpandProperty Path -First 1 }
$filter = Join-Path $PSScriptRoot 'diagram.lua'
$env:MERMAID_BIN = whereis mmdc
$env:TIKZ_BIN = 'xelatex'
& pandoc --lua-filter $filter --pdf-engine=xelatex @args