From 42474bb6c851314d804c89b1501b49eed0e6005f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Apr 2023 08:57:02 -0500 Subject: It builds now --- wikme.scm | 56 ++++---------------------------------------------------- 1 file changed, 4 insertions(+), 52 deletions(-) (limited to 'wikme.scm') diff --git a/wikme.scm b/wikme.scm index b0a5177..10b1a1a 100644 --- a/wikme.scm +++ b/wikme.scm @@ -1,52 +1,4 @@ -;;; wikme.scm --- build a wiki from a folder of markdown --- executable - -(import (args) - (chicken pathname) - (chicken process-context) - (chicken port)) - -(include "wikme-module") - - - -(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)) +(module wikme * + (import scheme + (chicken base)) + (include "wikme-impl.scm")) -- cgit 1.4.1-21-gabe81