Skip to content

Instantly share code, notes, and snippets.

@yeiichi
Created July 24, 2024 07:46
Show Gist options
  • Save yeiichi/c59e60d103d2b7e94e062bd4b4dbe1c4 to your computer and use it in GitHub Desktop.
Save yeiichi/c59e60d103d2b7e94e062bd4b4dbe1c4 to your computer and use it in GitHub Desktop.
Convert a reST file into an HTML5 file using rst2html5.py.
#!/usr/bin/env zsh
# References: https://stackoverflow.com/a/16596385/11042987
display_intro() {
printf "\033[93m** Convert a reST file into an HTML5 file **\n"
printf "** using rst2html5.py. **\033[0m\n"
return 0
}
main() {
display_intro
echo 'reST Found:' ./*rst
read -r '?Source rst? >> ' in_rst
dttm=$(date +%Y%m%dT%H%M)
out_html=${in_rst}_${dttm}.html
# Main function call
rst2html5 "${in_rst}" --output="${out_html}"
printf "\nResults: %s has been created.\n" "${out_html}"
open "${out_html}"
return 0
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment