A simple fish shell script to convert any documents – which is supported by pandoc – to markdown format. I’m using this with my hakyll blog post when I need to post in another system which only supports markdown.
pandoc command line tool: Official Install guide
curl -sL https://raw.githubusercontent.com/jeongoon/fish-pandoc-any-to-markdown/main/pandoc-any-to-markdown.fish -o pandoc-any-to-markdown.fish
# move it to where your binary apps are located.
# normally it is ~/.local/bin on Linux.
chmod u+x pandoc-any-to-markdown.fish
Note: If your file path must contain a extension. ex) input.org.
./pandoc-any-to-markdown.fish input.org > output.markdown
# ^^ need to capture both stdout and stderr