Commit 08a26d09 authored by Sabina Köfler's avatar Sabina Köfler
Browse files

Remove TOC removal

parent 05712671
Pipeline #1540 passed with stage
in 2 minutes and 53 seconds
...@@ -91,19 +91,19 @@ select_latex_engine ...@@ -91,19 +91,19 @@ select_latex_engine
# Compile documents # Compile documents
echo -e "\nBeginning conversion...\n" echo -e "\nBeginning conversion...\n"
search1="\[\[_TOC_\]\]" # search1="\[\[_TOC_\]\]"
search2="## Inhalt" # search2="## Inhalt"
# find . -iname "*.md" -o -iname "*.mdown" -o -iname "*.markdown" | while read -r file; do # find -iname finds <pattern> case insensitive # # find . -iname "*.md" -o -iname "*.mdown" -o -iname "*.markdown" | while read -r file; do # find -iname finds <pattern> case insensitive
for file in "${files[@]}"; do # for file in "${files[@]}"; do
echo "File:" ${file} # echo "File:" ${file}
# remove the line that renders the table of contents in markdown and copy file to /PDFs # # remove the line that renders the table of contents in markdown and copy file to /PDFs
if ! grep -q "$search1" $file; then # if ! grep -q "$search1" $file; then
continue # continue
else # else
echo -e "Found search string in $file\n Will make a copy" # echo -e "Found search string in $file\n Will make a copy"
sed "/$search1/d;/$search2/d" $file > ./$pdf_dir/$file # sed "/$search1/d;/$search2/d" $file > ./$pdf_dir/$file
fi # fi
done # done
find ./$pdf_dir -iname "*.md" | while read -r file; do find ./$pdf_dir -iname "*.md" | while read -r file; do
echo -e "\nFound files to convert $file" echo -e "\nFound files to convert $file"
...@@ -123,4 +123,4 @@ find ./$pdf_dir -iname "*.md" | while read -r file; do ...@@ -123,4 +123,4 @@ find ./$pdf_dir -iname "*.md" | while read -r file; do
echo -e "File created\n" echo -e "File created\n"
done done
echo -e "\nAll files complete!" echo -e "\nAll files complete!"
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment