add comment
Signed-off-by: Superkooka <aymeric.gueracague@gmail.com>
This commit is contained in:
parent
e77693ea96
commit
9d01f74cd5
|
|
@ -1,12 +1,14 @@
|
||||||
#!/usr/bin/env janet
|
#!/usr/bin/env janet
|
||||||
|
|
||||||
(defn read-from-file [file-path]
|
(defn read-from-file [file-path]
|
||||||
|
"Read a file from string filepath"
|
||||||
(let [f (file/open file-path :r)
|
(let [f (file/open file-path :r)
|
||||||
content (file/read f :all)]
|
content (file/read f :all)]
|
||||||
(file/close f)
|
(file/close f)
|
||||||
content))
|
content))
|
||||||
|
|
||||||
(defn htmlspecialchars
|
(defn htmlspecialchars
|
||||||
|
"Convert html special chars from a string"
|
||||||
[value]
|
[value]
|
||||||
(string/replace-all "\"" """
|
(string/replace-all "\"" """
|
||||||
(string/replace-all "'" "'"
|
(string/replace-all "'" "'"
|
||||||
|
|
@ -61,6 +63,7 @@
|
||||||
:main (some (* :block (? :end-of-line)))})
|
:main (some (* :block (? :end-of-line)))})
|
||||||
|
|
||||||
(defn ast-to-html
|
(defn ast-to-html
|
||||||
|
"Convert an AST to html"
|
||||||
[ast]
|
[ast]
|
||||||
(string/join
|
(string/join
|
||||||
(map
|
(map
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue