diff --git a/blog.janet b/blog.janet index aa219b0..e36b899 100644 --- a/blog.janet +++ b/blog.janet @@ -1,12 +1,14 @@ #!/usr/bin/env janet (defn read-from-file [file-path] + "Read a file from string filepath" (let [f (file/open file-path :r) content (file/read f :all)] (file/close f) content)) (defn htmlspecialchars + "Convert html special chars from a string" [value] (string/replace-all "\"" """ (string/replace-all "'" "'" @@ -61,6 +63,7 @@ :main (some (* :block (? :end-of-line)))}) (defn ast-to-html + "Convert an AST to html" [ast] (string/join (map