Skip to content

Commit

Permalink
Add IN-file->OUT defuns to defconv
Browse files Browse the repository at this point in the history
Also, update convert-file/3 and clean up convert-file/2 docstring.
  • Loading branch information
yurrriq committed Feb 20, 2016
1 parent 1f5f7e9 commit 2ccbdb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions include/conversions.lfe
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
(defun ,(list_to_atom (++ input "->" output)) (string _options)
(convert-string string ,input ,output))
(defun ,(list_to_atom (++ input "->" output)) (string)
(,(list_to_atom (++ input "->" output)) string []))
(defun ,(list_to_atom (++ input "-file->" output)) (string _options)
(convert-file string ,input ,output))
(defun ,(list_to_atom (++ input "-file->" output)) (string)
(,(list_to_atom (++ input "->" output)) string []))))

(defmacro defconversions ()
Expand Down
8 changes: 5 additions & 3 deletions src/levaindoc.lfe
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ and return `` `#(ok ,output) ``."
`#(ok ,output)))))

(defun convert-file (file)
"Equivalent to `(`[[convert-file/3]]` file \"markdown_github\" \"html\")`."
(convert-file file "markdown" "html"))
"Equivalent to `markdown_github-file->html/1`, which calls [[convert-file/3]].
See [conversions](conversions.html) and [levaindoc-util](levaindoc-util.html)."
(markdown_github-file->html file))

(defun convert-file (file from to)
"Equivalent to `(`[[convert-file/4]]` file from to [])`."
"Equivalent to `(`[[convert-file/4]] `file from to [])`."
(convert-file file from to []))

(defun convert-file (file from to _options)
Expand Down

0 comments on commit 2ccbdb0

Please sign in to comment.