diff options
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | src/as/media-list.scm | 13 | ||||
-rw-r--r-- | src/as/media-uploader.scm | 13 | ||||
-rw-r--r-- | src/media-list.scm | 14 | ||||
-rw-r--r-- | src/media-uploader.scm | 9 |
5 files changed, 33 insertions, 26 deletions
@@ -21,18 +21,20 @@ The following script shows one way to do it: (define root (canonicalize-path (cadr (command-line)))) (define atom-feed (lambda () (atom:render (as 'atom root)))) -(define html-index (lambda () (html:render (as 'html root)))) - (atom-feed) ;; writes your feed to current-output-port + +(define html-index (lambda () (html:render (as 'html root)))) (html-index) ;; writes your html to current-output-port + +(define media-list (as 'media-list root)) ;; list of media files in your site ``` `(as 'atom root)` and `(as 'html root)` the scheme file in `root` and interpret it as atom and html respectively. From that, the result can be generated calling the `render` function of the modules as suggested in the example. -There's also a `media-uploader` module that would upload all the independent -media to the server, but it's still a WIP. +`(as 'media-list root)` returns an association list with the car set to the +path in the filesystem and the cdr to the uri of each media file. ## Format diff --git a/src/as/media-list.scm b/src/as/media-list.scm new file mode 100644 index 0000000..f5a1eb2 --- /dev/null +++ b/src/as/media-list.scm @@ -0,0 +1,13 @@ +(define-module (src as media-list) + #:use-module (src dates) + #:use-module (src media-list) + #:re-export (string/ISO->date) + #:export (main + post + person + media)) + +(define main media-list) +(define post ignore) +(define person ignore) +(define media add-to-list) diff --git a/src/as/media-uploader.scm b/src/as/media-uploader.scm deleted file mode 100644 index 3b21a8c..0000000 --- a/src/as/media-uploader.scm +++ /dev/null @@ -1,13 +0,0 @@ -(define-module (src as media-uploader) - #:use-module (src dates) - #:use-module (src media-uploader) - #:re-export (string/ISO->date) - #:export (main - post - person - media)) -(define main __ignore) -(define post __ignore) -(define person __ignore) -(define media upload) - diff --git a/src/media-list.scm b/src/media-list.scm new file mode 100644 index 0000000..115ae0a --- /dev/null +++ b/src/media-list.scm @@ -0,0 +1,14 @@ +(define-module (src media-list) + #:use-module (ice-9 format) + #:export (ignore + media-list + add-to-list)) + +(define %media '()) + +(define (ignore . rest) #f) + +(define* (add-to-list path #:key (uri "") #:allow-other-keys) + (set! %media (append! %media (list (cons path uri))))) + +(define (media-list . rest) %media) diff --git a/src/media-uploader.scm b/src/media-uploader.scm deleted file mode 100644 index 50b74c1..0000000 --- a/src/media-uploader.scm +++ /dev/null @@ -1,9 +0,0 @@ -(define-module (src media-uploader) - #:use-module (ice-9 format) - #:export (__ignore - upload)) - -(define (__ignore . rest) #f) -(define* (upload path #:key (uri "") - #:allow-other-keys) - (format #t "URI: ~a Path ~a~&" uri path)) |