diff --git a/main.scm b/main.scm index f1d2161..29543f7 100755 --- a/main.scm +++ b/main.scm @@ -15,6 +15,7 @@ srfi-1 ;; list utils srfi-13 ;; string utils srfi-14 ;; charsets + symbol-utils ;; (unspecified-value) ) (define CLONE-URL (or (get-environment-variable "REPO2HTML_CLONE_URL") "git://git.example.com")) @@ -124,13 +125,13 @@ (h2 ,repository-name) (p "clone url:" ,CLONE-URL "/" ,repository-name) (nav - ,(if readme-file - `(a (@ href ,relative-root "index.html") "about") "") + ,(when readme-file + `(a (@ href ,relative-root "index.html") "about")) (a (@ href ,relative-root "files.html") "files") - ,(if license-file - `(a (@ href ,relative-root ,license-file ".html") "license") "") - ,(if issues-present? - `(a (@ href ,relative-root "ISSUES.html") "issues") "") + ,(when license-file + `(a (@ href ,relative-root ,license-file ".html") "license")) + ,(when issues-present? + `(a (@ href ,relative-root "ISSUES.html") "issues")) (a (@ href ,relative-root "commits.html") "commits") (a (@ href ,relative-root "contributors.html") "contributors"))) (hr) @@ -241,7 +242,14 @@ (with-output-to-file (make-pathname html-repo-path filename) (lambda () (display "\n") - (SXML->HTML (template-wrap->sxml filename sxml))))) + (SXML->HTML + (pre-post-order* + (template-wrap->sxml filename sxml) + `((*text* . ,(lambda (trigger str) + (if (equal? str (unspecified-value)) + "" + ((alist-ref '*text* alist-conv-rules*) trigger str)))) + ,@alist-conv-rules*)))))) (create-directory html-repo-path #t) ;; special files