;;; wikme.scm --- build a wiki from a folder of markdown --- executable (import (args) (chicken pathname) (chicken process-context) (chicken port)) (include "src/wikme") (define +opts+ (list (args:make-option (u base-url) (optional: "URL") "Base URL for the generated Wiki.") (args:make-option (s source) (optional: "DIRECTORY") "Directory containing source files (default: PWD).") (args:make-option (o out) (optional: "DIRECTORY") "Directory in which to place rendered files (default: PWD/out).") (args:make-option (t template) (optional: "FILE") "Template file for wiki pages (default: PWD/template.html)."))) (define (usage) (with-output-to-port (current-error-port) (lambda () (print "Usage: " (car (argv)) " [options...]") (newline) (print (args:usage +opts+)))) (exit 1)) (define (main args) (receive (options operands) (args:parse args +opts+) (render-wiki (directory->wiki (or (alist-ref 'source options) (current-directory)) #:base-url (or (alist-ref 'base-url options) "https://www.example.com") #:destination-directory (or (alist-ref 'out options) (make-pathname (current-directory) "out")) #:page-template (or (alist-ref 'template options) (make-pathname (current-directory "template.html"))))))) (main (command-line-arguments))