diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-01-11 18:18:48 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-01-11 18:18:48 +0100 |
| commit | d3c3ae47a2937bf0ace994a4bc9928cd2f3605de (patch) | |
| tree | f13e8c98e973b9c6534c477c3f2829e87e23d0dc /builtin.lisp | |
| parent | 82b803603f519bcd91eb4a2fbc9bb5c2bfa6e168 (diff) | |
| download | temper-d3c3ae47a2937bf0ace994a4bc9928cd2f3605de.tar.gz temper-d3c3ae47a2937bf0ace994a4bc9928cd2f3605de.tar.bz2 temper-d3c3ae47a2937bf0ace994a4bc9928cd2f3605de.zip | |
Added make-index builtin
Diffstat (limited to 'builtin.lisp')
| -rw-r--r-- | builtin.lisp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/builtin.lisp b/builtin.lisp new file mode 100644 index 0000000..3da200e --- /dev/null +++ b/builtin.lisp @@ -0,0 +1,18 @@ +(load "/home/charles/.clisprc.lisp") +(ql:quickload "uiop") + + +(defun make-index (dirname &key (item-tag "li") (surrounding-tag "ul") (include-date nil)) + (setf filepaths (uiop:directory-files dirname)) + ; (when test (delete-if #'(lambda (x) (not (test x))) filenames)) + (format nil "<~A>~A</~A>" + surrounding-tag + (format nil "~{~A~%~}" + (mapcar #'(lambda (filepath) + (let* ((filename (file-namestring filepath)) + (name filename)) + (format nil "<~A><a href=\"~A/~A\">~A</a></~A>" item-tag dirname filename name item-tag))) + filepaths)) + surrounding-tag)) + +; (uiop:run-program (list "seq" "10" "20") :output t) |
