Skip to content

Commit

Permalink
♻ add parameter to output folder
Browse files Browse the repository at this point in the history
  • Loading branch information
MariteSomEnergia committed Jan 14, 2025
1 parent aeae889 commit bfad376
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions import_docx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ process() {
# fix lang code for ga -> gl
[ "$lang" = 'ga' ] && lang='gl'

step "Processing language $lang"
step "Processing language $lang in $2"

pandoc "$1" -o $lang.md --columns 80000 -t gfm-raw_html
pandoc "$1" -o "$2"/$lang.md --columns 80000 -t gfm-raw_html

# Break paragraphs by phrases
sed -i 's/\([^0-9]\.\) /\1\n/g' $lang.md
sed -i 's/\([^0-9]\.\) /\1\n/g' "$2"/$lang.md
# Fix subscripts
sed -i 's/_(\([^)][^)]*\))/~\1~/g' $lang.md
sed -i 's/_(\([^)][^)]*\))/~\1~/g' "$2"/$lang.md
}

for a in "$@"; do
process "$a"
done
process "$@"


0 comments on commit bfad376

Please sign in to comment.