diff options
| author | rwd <yctct@yctct.com> | 2024-09-26 20:34:49 +0200 |
|---|---|---|
| committer | rwd <yctct@yctct.com> | 2024-09-26 20:34:49 +0200 |
| commit | 5da0565b02a9add6c6f1b967a224d5148306507f (patch) | |
| tree | 2a5808f7064a6e19a7eeefcd257679edd588b157 /build-html.sh | |
Add all files
Diffstat (limited to 'build-html.sh')
| -rwxr-xr-x | build-html.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/build-html.sh b/build-html.sh new file mode 100755 index 0000000..99972a5 --- /dev/null +++ b/build-html.sh @@ -0,0 +1,24 @@ +#!/bin/bash +echo Welcome to the markdown to html converter. +markdown_file="$1" +echo file is "$markdown_file" + +if [[ -z "$markdown_file" ]]; then + printf "Usage: %s <markdown_file>\n" "$0" + exit 1 + fi + + # output_dir="$(dirname "$markdown_file")" + # output_file="$output_dir/${markdown_file%%.*}.html" + output_file="${markdown_file%%.*}.html" + + pandoc "$markdown_file" -f markdown+hard_line_breaks \ + -t html5 -H "header.html" \ + --template="default.html" \ + -o "$output_file" --verbose --highlight-style=breezedark + + + printf "markdown_file: %s\n" "$markdown_file" + printf "output_file: %s\n" "$output_file" + + echo We did it capitan, we converted to html. |
