add comment

Signed-off-by: Superkooka <aymeric.gueracague@gmail.com>
This commit is contained in:
Aymeric GUERACAGUE 2023-12-19 18:04:31 +01:00
parent e77693ea96
commit 9d01f74cd5
1 changed files with 3 additions and 0 deletions

View File

@ -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 "\"" "&quot;" (string/replace-all "\"" "&quot;"
(string/replace-all "'" "&apos;" (string/replace-all "'" "&apos;"
@ -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