Skip to content
Snippets Groups Projects
Commit 31b51a52 authored by Lukáš Krupčík's avatar Lukáš Krupčík
Browse files

edit html_md.sh

parent 0a412f7c
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ if [ "$1" = "-w" ]; then
# test exists file -> yes - kill process wget
until test -f $FILE
until test -f "$FILE"
do
if [ ! -f "$FILE" ]; then
echo "Download..."
......@@ -40,7 +40,7 @@ if [ "$1" = "-w" ]; then
done
echo "Download complete..."
kill $pid
kill "$pid"
find . -name "@@s*" |
while read i;
......@@ -82,7 +82,7 @@ if [ "$1" = "-c" ]; then
do
# filtering html
echo "$i";
echo "\t\tfiltering html files...";
printf "\t\tfiltering html files...\n";
HEAD=$(cat "$i" | grep -n -m1 '<h1' |cut -f1 -d: | tr --delete '\n')
END=$(cat "$i" | grep -n -m1 '<!-- <div tal:content=' |cut -f1 -d: | tr --delete '\n')
......@@ -92,7 +92,7 @@ if [ "$1" = "-c" ]; then
cat "$i" | sed '1,'"$((HEAD-1))"'d' | sed -n -e :a -e '1,'"$DOWN"'!{P;N;D;};N;ba' > "${i%.*}TMP.html"
# converted .html to .md
echo "\t\t.html -> .md"
printf "\t\t.html -> .md\n"
pandoc -f html -t markdown+pipe_tables-grid_tables "${i%.*}TMP.html" -o "${i%.*}.md";
rm "${i%.*}TMP.html";
......@@ -113,7 +113,7 @@ if [ "$1" = "-c" ]; then
done
# text filtering of html, css, ...
echo "\t\tautomatic filter..."
printf "\t\tautomatic filter...\n"
cat filter_auto |
while read y;
do
......@@ -122,7 +122,7 @@ if [ "$1" = "-c" ]; then
cat "${i%.*}TMP.md" > "${i%.*}.md";
done
#echo "\t\tother filter..."
printf "\t\tother filter...\n"
cat filter_other |
while read a;
do
......@@ -137,4 +137,4 @@ if [ "$1" = "-c" ]; then
done
rm filter_autoTMP
rm filter_auto
fi
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment