BigUpdate
Python application / build (push) Has been cancelled

This commit is contained in:
Igor20264
2026-09-03 10:44:08 +03:00
parent d2da20fdb2
commit 516abe7b83
177 changed files with 40178 additions and 2 deletions
+35
View File
@@ -0,0 +1,35 @@
# Build PDF from markdown via two pipelines:
# 1) MD → LaTeX project (Python md2latex)
# 2) LaTeX → PDF (XeLaTeX / latexmk)
#
# Usage:
# powershell -File scripts\md2pdf.ps1 examples\example.md
# powershell -File scripts\md2pdf.ps1 report.md -OutDir build\report -TitlePage title.pdf
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$Markdown,
[string]$OutDir = "",
[string]$TitlePage = "",
[switch]$NoPdf
)
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
Set-Location $Root
$md = Resolve-Path $Markdown
if (-not $OutDir) {
$OutDir = Join-Path (Split-Path $md) (([IO.Path]::GetFileNameWithoutExtension($md)) + "_latex")
}
$pyArgs = @("-m", "md2latex", "$md", "-o", "$OutDir")
if ($TitlePage) { $pyArgs += @("--titlepage", "$TitlePage") }
if (-not $NoPdf) { $pyArgs += "--pdf" }
Write-Host "=== Pipeline 1+2: MD → LaTeX → PDF ==="
& python @pyArgs
exit $LASTEXITCODE
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# MD → LaTeX → PDF (XeLaTeX)
# Usage: scripts/md2pdf.sh report.md [out_dir]
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
MD="${1:?markdown file}"
OUT="${2:-}"
ARGS=(-m md2latex "$MD" --pdf)
if [[ -n "$OUT" ]]; then ARGS+=(-o "$OUT"); fi
exec python "${ARGS[@]}"