feat: add script
This commit is contained in:
parent
aada9c9725
commit
c103b964f0
1 changed files with 19 additions and 0 deletions
19
gen.sh
Normal file
19
gen.sh
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
shopt -s nullglob # Makes the loop work even if there are no files
|
||||||
|
|
||||||
|
cd public
|
||||||
|
|
||||||
|
for file in ./documents/*.md; do
|
||||||
|
# Extract filename without extension
|
||||||
|
filename="${file%.md}"
|
||||||
|
|
||||||
|
# Build the output filename
|
||||||
|
output_file="./${filename}.docx"
|
||||||
|
|
||||||
|
# Run the pandoc command with dynamic variables
|
||||||
|
pandoc \
|
||||||
|
--reference-doc ./documents/ref.docx \
|
||||||
|
--data-dir ./images \
|
||||||
|
-o "$output_file" "$file"
|
||||||
|
done
|
||||||
Loading…
Add table
Add a link
Reference in a new issue