diff options
| author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-07-03 21:13:11 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-07-03 21:13:11 -0700 |
| commit | ba27fd58baadc7c83276b5bf9af19c65744fff25 (patch) | |
| tree | 2b878cf29e217129f405b5264db724134527c168 /export.sh | |
| parent | 5619ad61667dd1a974bf491107b3e73ed333c358 (diff) | |
| download | simponic.xyz-main.tar.gz simponic.xyz-main.zip | |
Diffstat (limited to 'export.sh')
| -rwxr-xr-x | export.sh | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -1,10 +1,20 @@ #!/usr/bin/env bash shopt -s nullglob -for i in *.org; do - name="${i%%.*}" - echo $name - emacs "$i" --batch -f org-html-export-to-html --kill - tail -n +4 "$name.html" | tee "$name.php" - rm "$name.html" "$name.html~" -done + +export_org_php_monstrosity() { + name="${1%%.*}" + echo $name + emacs "$1" --batch -f org-html-export-to-html --kill + tail -n +4 "$name.html" | tee "$name.php" + rm "$name.html" "$name.html~" +} + +if [ -z "$1" ]; then + for i in *.org; do + export_org_php_monstrosity $i + done + exit +fi + +export_org_php_monstrosity $1 |
