dotfiles/.config/zsh/functions/adoc2md

14 lines
276 B
Plaintext
Raw Normal View History

2022-12-08 03:01:01 +01:00
#!/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