Browse Source

blep

main
Jesse Laprade 2 months ago
parent
commit
de7a891e92
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      wg.fnl

+ 4
- 4
wg.fnl View File

@ -224,10 +224,10 @@
(let [source (.. dir "/" v)] ;; source will build up a long path through each recur, creating something like `convert/path/to/some/file.md`
(if (and (file-exists? source)
(string.match source ".md")) ;; Only try to convert files with a .md suffix
(let [destination-dir-pre (string.gsub source "(.*/).*.md" "%1") ;; returns convert/some/path/
destination-dir (string.gsub destination-dir-pre "^convert/" "build/") ;; returns build/some/path/
destination-pre (string.gsub source ".md" ".html") ;; returns convert/some/path/file.html
destination (string.gsub destination-pre "^convert/" "build/")] ;; returns build/some/path/file.html
(let [destination-dir-pre (string.gsub source "(.*/).*.md" "%1") ;; returns convert/some/path/
destination-dir (string.gsub destination-dir-pre "^convert/" "build/") ;; returns build/some/path/
destination-pre (string.gsub source ".md" ".html") ;; returns convert/some/path/file.html
destination (string.gsub destination-pre "^convert/" "build/")] ;; returns build/some/path/file.html
;; This (directory-create ...) is here, so Pandoc doesn't try
;; to create files in directories that don't exist yet.
(when (not (directory-exists? destination-dir))

Loading…
Cancel
Save