dotfiles/.config/zsh/functions/adoc2md
tastytea 8cb3e7d35d
adoc2md: don't wrap output
Misskey doesn't play well with it
2022-12-08 18:25:34 +01:00

14 lines
276 B
Bash
Executable File

#!/usr/bin/env zsh
# Convert AsciiDoc to Markdown.
setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL
if [[ -v 1 ]]; then
print "usage: print foo | ${0}"
return 1
fi
\cat \
| asciidoc -b docbook --out-file=- - \
| pandoc --from=docbook --to=gfm --wrap=none