Created
April 15, 2020 11:14
-
-
Save ianpaul/0be759a233d7a2fa9ceac2a4f948bc49 to your computer and use it in GitHub Desktop.
Convert markdown to HTML in Bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A simple Bash script to create HTML in stdout from a markdown file | |
# This script requires pandoc. On Ubuntu use `sudo apt install pandoc` to install. | |
# Check to see if the user included a filename. If not, ask them for one. | |
if [ -z "$1" ]; then | |
read -p "Please provide a filename (include the path if not in this directory): " file | |
else file=$1 | |
fi | |
# Execute this 'pandoc' command to create HTML from markdown and display in stdout for copying | |
pandoc -f markdown $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment