Skip to content

Commit

Permalink
feat(import): Setup DOCX import path
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Nov 7, 2024
1 parent bdd24e8 commit 5491eb0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/functions.zsh.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ function normalize_scrivener_mmd () {
sed -E 's/\.[  ]\.[  ]\./.../'
}

function normalize_docx () {
alias sed="${SED:-@SED@}"
cat -
}

function normalize_pandoc () {
alias pandoc="${PANDOC:-@PANDOC@}"
pandoc_args=(
Expand Down
8 changes: 8 additions & 0 deletions scripts/import.zsh.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ function import_scrivener-mmd () {
normalize_pandoc > $bookid.md
}

function import_docx () {
alias pandoc="${PANDOC:-@PANDOC@}"
: ${bookid:=$1}
: ${input:=$2}
pandoc $input ${pandoc_args[@]} |
normalize_pandoc > $bookid.md
}

remove_extant_bookid $bookid

# Restore meta-data just (maybe) nuked
Expand Down

0 comments on commit 5491eb0

Please sign in to comment.