diff --git a/README.md b/README.md index cf267fc..af40924 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,14 @@ TODO ## todos -TODO +- ☐ nav link: License (look for LICENSE file) +- ☐ nav link: Contributors ## hopes +- ☐ clickable line numbers in source files +- ☐ render images +- ☐ make repos with more files and directories less daunting (recursively generate a files list page for each directory in a repo?) +- ☐ nav link: Releases + TODO diff --git a/main.scm b/main.scm index b65b899..7c7b99e 100644 --- a/main.scm +++ b/main.scm @@ -1,35 +1,3 @@ -;; how to use this script -;; 1. cd into a bare git repository -;; 2. run the following, changing any values you want: -;; export GIT_WWW=/var/www/git/ GIT_WWW_CLONE_URL=git://git.m455.casa GIT_WWW_TITLE=git.m455.casa GIT_WWW_DESCRIPTION="m455's git repositories" GIT_WWW_H1=git.m455.casa; csi -s ../main.scm -;; i figured i would use environment variables instead of a config file, -;; because folks are just going to run this as a post-receive hook anyway, so -;; why not all just configure it all in the post-receive hook like so? -;; (assuming git-www is in your $PATH, and assuming git-www is a compiled -;; version of git-www.scm): -;; --------------------------------- -;; #!/bin/sh -;; export GIT_WWW=/var/www/git/ -;; export GIT_WWW_CLONE_URL=git://git.m455.casa -;; export GIT_WWW_TITLE=git.m455.casa -;; export GIT_WWW_DESCRIPTION="m455's git repositories" -;; export GIT_WWW_H1=git.m455.casa -;; git-www -;; --------------------------------- - -;; TODO: -;; [x] replace all repository-name with *repository-name* -;; [x] replace all repository-directory with *repository-directory* -;; [x] remove all passed around parameters for repo name and directory -;; [x] move html-body-contents into final html-template format except use -;; string translate for named variables in the html-template -;; Nice-to-haves: -;; [ ] nav link: License (look for LICENSE file) -;; [ ] nav link: Contributors -;; [ ] nav link: Releases -;; [ ] clickable line numbers in source files -;; [ ] render images -;; [ ] make repos with more files and directories less daunting (recursively generate a files list page for each directory in a repo?) (import utf8 lowdown (chicken string) @@ -41,17 +9,15 @@ (chicken pathname) (chicken file)) -;; decided to make these two buggers globals because i passed them around -;; between functions so much -(define *repository-name* #f) -(define *repository-directory* #f) - (define WEB-DIRECTORY (or (get-environment-variable "GIT_WWW") "/var/www/git")) (define CLONE-URL (or (get-environment-variable "GIT_WWW_CLONE_URL") "git://git.example.com")) (define TITLE (or (get-environment-variable "GIT_WWW_TITLE") "my git repositories")) (define DESCRIPTION (or (get-environment-variable "GIT_WWW_DESCRIPTION") "my git repositories")) (define H1 (or (get-environment-variable "GIT_WWW_H1") "git.example.com")) +(define REPOSITORY-NAME (pathname-strip-directory (current-directory))) +(define REPOSITORY-DIRECTORY (make-pathname WEB-DIRECTORY REPOSITORY-NAME)) + (define (populate-html-template body) #<#string-block @@ -87,11 +53,11 @@ hr {
clone url: #{CLONE-URL}/#{*repository-name*}
+clone url: #{CLONE-URL}/#{REPOSITORY-NAME}