99# Author: Piero Grandesso
1010# https://github.com/piero-g/markdown-workflow
1111#
12+ # Todo:
13+ # rework as a complete loop
14+ # add media-extract
15+ # add several fixes via sed, like:
16+ # - remove mark `\[([^\]]*)\]\{\.mark\}`
17+ # - fix `\...` and `\"`
18+ #
19+
1220
1321# ####
1422# 0. events log and other checks
@@ -109,7 +117,7 @@ printf '%b\n' "[$(date +"%Y-%m-%d %H:%M:%S")] Starting conversion of manuscripts
109117 if [ " ${manuscript} " != " ${manuscript% .${EXT1} } " ]; then
110118 printf ' %b\n' " [$( date +" %Y-%m-%d %H:%M:%S" ) ] ${manuscript} : trying to convert it in Markdown..." >> " $workingDir /$eventslog "
111119 # actual conversion with Pandoc
112- if pandoc --wrap=none --atx-headers -o " $tempdir /${manuscript% .${EXT1} } .md" " $manuscript " ; then
120+ if pandoc --wrap=none --markdown-headings=atx -o " $tempdir /${manuscript% .${EXT1} } .md" " $manuscript " ; then
113121 printf ' %b\n' " [$( date +" %Y-%m-%d %H:%M:%S" ) ] ... ${manuscript} was converted!" >> " $workingDir /$eventslog "
114122 # archive the processed manuscript
115123 mv " $manuscript " " $workingDir /archive/original-version/${manuscript% .${EXT1} } -$( date +" %Y-%m-%dT%H-%M-%S" ) .${EXT1} "
@@ -122,7 +130,7 @@ printf '%b\n' "[$(date +"%Y-%m-%d %H:%M:%S")] Starting conversion of manuscripts
122130 elif [ " ${manuscript} " != " ${manuscript% .${EXT2} } " ]; then
123131 printf ' %b\n' " [$( date +" %Y-%m-%d %H:%M:%S" ) ] ${manuscript} : trying to convert it in Markdown..." >> " $workingDir /$eventslog "
124132 # actual conversion with Pandoc
125- if pandoc --wrap=none --atx-headers -o " $tempdir /${manuscript% .${EXT2} } .md" " $manuscript " ; then
133+ if pandoc --wrap=none --markdown-headings=atx -o " $tempdir /${manuscript% .${EXT2} } .md" " $manuscript " ; then
126134 printf ' %b\n' " [$( date +" %Y-%m-%d %H:%M:%S" ) ] ... ${manuscript} was converted!" >> " $workingDir /$eventslog "
127135 # archive the processed manuscript
128136 mv " $manuscript " " $workingDir /archive/original-version/${manuscript% .${EXT2} } -$( date +" %Y-%m-%dT%H-%M-%S" ) .${EXT2} "
@@ -135,7 +143,7 @@ printf '%b\n' "[$(date +"%Y-%m-%d %H:%M:%S")] Starting conversion of manuscripts
135143 elif [ " ${manuscript} " != " ${manuscript% .${EXT3} } " ]; then
136144 printf ' %b\n' " [$( date +" %Y-%m-%d %H:%M:%S" ) ] ${manuscript} : trying to convert it in Markdown..." >> " $workingDir /$eventslog "
137145 # actual conversion with Pandoc
138- if pandoc --wrap=none --atx-headers -o " $tempdir /${manuscript% .${EXT3} } .md" " $manuscript " ; then
146+ if pandoc --wrap=none --markdown-headings=atx -o " $tempdir /${manuscript% .${EXT3} } .md" " $manuscript " ; then
139147 printf ' %b\n' " [$( date +" %Y-%m-%d %H:%M:%S" ) ] ... ${manuscript} was converted!" >> " $workingDir /$eventslog "
140148 # archive the processed manuscript
141149 mv " $manuscript " " $workingDir /archive/original-version/${manuscript% .${EXT3} } -$( date +" %Y-%m-%dT%H-%M-%S" ) .${EXT3} "
0 commit comments