Commits

evhan  committed 4acc89d

Import reorganization and documentation tweaks

  • Participants
  • Parent commits 3426770

Comments (0)

Files changed (10)

 
 ## Requirements
 
-  * [CHICKEN](http://call-cc.org)
+All libraries and most programs work in any R7RS Scheme.
+
+`schematic-docco(1)` requires [CHICKEN](http://call-cc.org) with the
+following extensions:
+
   * [fmt](http://wiki.call-cc.org/egg/fmt) (for ANSI output)
   * [sxml-transforms](http://wiki.call-cc.org/egg/sxml-transforms) (for HTML output)
   * [colorize](http://wiki.call-cc.org/egg/colorize) (for syntax highlighting)
 
-## Install
+## Installation
+
+When installing for CHICKEN, use `chicken-install(1)`:
 
     $ git clone --recursive git://bitbucket.com/evhan/schematic.git
     $ cd schematic
     $ chicken-install
 
-Support for UTF-8 input can be added by installing the
-[utf8](http://wiki.call-cc.org/egg/utf8) extension and compiling with
-`CSC_OPTIONS="-R utf8"`.
+Other Schemes can install the Schematic libraries by placing all
+directories in `src/` and `lib/*/src/` on the system's load path.
 
 ## Usage
 
-Three programs are provided, `schematic-docco`, `schematic-format` and
-`schematic-markdown`.
+On CHICKEN, three programs are included: `schematic-docco(1)`,
+`schematic-format(1)` and `schematic-markdown(1)`. Other Schemes can run
+these programs as scripts from the project directory, or after
+installing the Schematic libraries.
 
-Refer to `schematic-docco.1.md`, `schematic-format.1.md` and
-`schematic-markdown.1.md` for each program's usage details.
+Refer to the manual pages for each program, or `schematic-docco.1.md`,
+`schematic-format.1.md` and `schematic-markdown.1.md`, for usage
+details.
 
 ## License
 

Submodule lib/foldling

-Subproject commit c5be0e24ba66b051f19c57c3cb59a03a37426c8b
+Subproject commit 4c5921b2cedbda641abf593e926d3e29961783e1

File schematic-docco.scm

         (fmt)
         (foldling command-line)
         (foldling command-line getopt-long)
+        (schematic read)
         (sxml-transforms))
 
-(include "src/schematic/read.sld")
-(import (schematic read))
-
 ;;;
 ;;; Program options & usage.
 ;;;

File schematic-format.scm

  (lambda (option)
    (cond
      ((member option '("-v" "--version"))
-      (for-each display (list program-version #\newline))
+      (display program-version)
+      (newline)
       (exit))
      ((member option '("-h" "--help"))
-      (for-each display (list "Usage: " (car (command-line)) " [indent-file]" #\newline))
+      (display "Usage: ")
+      (display (car (command-line)))
+      (display " [indent-file]")
+      (newline)
       (exit))
      (else
       (with-exception-handler error-exit

File schematic-markdown.scm

 ;;;
 ;;; schematic-markdown.scm
 ;;;
-;;; This script converts program source to markdown.
+;;; This script converts Scheme source to markdown text.
 ;;;
 ;;; It should run in any R7RS-compatible Scheme, so long as this
-;;; project's "src" and "lib" directories are added to the include path.
-;;; In Chibi Scheme, for example, that's done with the -I flag.
+;;; project's "src" and "lib/*/src" directories are added to the include
+;;; path. In Chibi Scheme, for example, that's done with the -I flag.
 ;;;
 ;;; See this project's README for more information.
 ;;;

File schematic.setup

   (map (lambda (b) (make-pathname #f b "1")) bin))
 
 (define flags
-  '(-O3 -d0 -I src/schematic -R r7rs -specialize))
+  '(-O3 -d0 -I src -R r7rs -specialize))
 
 (for-each
  (lambda (dir)

File src/schematic/format.scm

 ;;; See LICENSE for details.
 ;;;
 
-(import (scheme base)
-        (scheme case-lambda)
-        (scheme char)
-        (scheme read)
-        (scheme write))
-
 ;; Perform body `b`, returning the result of `e` on _any_ error.
 (define-syntax guard/value
   (syntax-rules ()

File src/schematic/format.sld

 ;;;
 
 (define-library (schematic format)
-  (import (scheme base))
+  (import (scheme base)
+          (scheme case-lambda)
+          (scheme char)
+          (scheme read)
+          (scheme write))
   (export format-scheme keyword-indent)
   (include "format.scm"))

File src/schematic/read.scm

 ;;; schematic/read.scm
 ;;;
 ;;; This is a line-based source reader. It provides a procedure,
-;;; `make-source-section-reader`, that, given a line comment prefix and
-;;; port, returns a generator that yields documentation and source code
-;;; for each commented block of code read from the input.
-;;;
-;;; It should work in any R7RS-compatible Scheme, given the following
-;;; imports:
-;;;
-;;;     (import (scheme base)
-;;;             (scheme case-lambda)
-;;;             (scheme char)
-;;;             (scheme write))
+;;; `port-fold-source-sections`, that folds over each commented block of
+;;; code read from an input port yielding comment/source code pairs.
 ;;;
 ;;; See this project's README for more information, or
 ;;; schematic-markdown.scm for a simple usage example.
 ;;; See LICENSE for details.
 ;;;
 
-(import (scheme base)
-        (scheme case-lambda)
-        (scheme char)
-        (scheme write))
-
 ;;;
 ;;; SRFI-1-ish.
 ;;;
     (any (lambda (p) (string-prefix? p str)) prefixes)))
 
 ;; Creates a procedure that returns the documentation part of a line
-;; comment, or an empty string if there is none.
+;; comment, or an empty string if there isn't one.
 ;;
-;; The documentation part of a line comment is the text following a line
-;; comment prefix from `prefixes` and a single whitespace character. For
-;; example, given the lone comment prefix `(";;")`:
+;; The documentation part of a line comment is the text following a
+;; prefix in `prefixes` and a single whitespace character. For example,
+;; given the comment prefix list `(";;")`:
 ;;
 ;;     "foo"     => ""
 ;;     ";;"      => ""

File src/schematic/read.sld

 ;;;
 
 (define-library (schematic read)
-  (import (scheme base))
+  (import (scheme base)
+          (scheme case-lambda)
+          (scheme char)
+          (scheme write))
   (export port-fold-source-sections)
   (include "read.scm"))