Files
translation-files/scripts/dj2docx.fish
T
2026-06-27 22:52:17 +08:00

15 lines
382 B
Fish
Executable File

#!/usr/bin/env fish
# Convert target.dj to English docx
# Usage: dj2docx <path-to-target.dj> [output-filename]
# Output filename defaults to /tmp/<parent-dirname>-英文.docx
set tgt (realpath $argv[1])
if set -q argv[2]
set out "$argv[2]"
else
set parent (basename (dirname $tgt))
set out "/tmp/$parent-英文.docx"
end
pandoc $tgt -f djot -t docx -o $out
echo $out