diff --git a/14_html_to_markdown.sh b/14_html_to_markdown.sh new file mode 100644 index 0000000..2ef6730 --- /dev/null +++ b/14_html_to_markdown.sh @@ -0,0 +1,17 @@ +# Convert all html files in a single directory to markdown +# +# 1. Install pandoc +# 2. Run the script + + + +FILES=*.html +for f in $FILES +do + # extension="${f##*.}" + filename="${f%.*}" + echo "Converting $f to $filename.md" + `pandoc $f -t markdown -o ../mds/$filename.md` + # uncomment this line to delete the source file. + # rm $f +done \ No newline at end of file diff --git a/readme.md b/readme.md index 44c9970..5a2a5e5 100644 --- a/readme.md +++ b/readme.md @@ -13,3 +13,4 @@ 1. **11_optimize_images_with_wand.py**: recursively grab images from a directory, then optimize them for the web 1. **12_csv_split.py**: Splits a CSV file into multiple files based on command line arguments. 1. **13_random_name_generator.py**: random name generator +1. ***14_html_to_markdown.sh**: Convert all html files in a single directory to markdown