Changeset 20465 in project


Ignore:
Timestamp:
09/23/10 22:41:22 (10 years ago)
Author:
Jim Ursetto
Message:

chicken-doc: add chicken-doc-warnings param (default #f); make repository-base internal

Location:
release/4/chicken-doc/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/chicken-doc/trunk/chicken-doc-cmd.scm

    r17835 r20465  
    111111  (usage))
    112112
    113 (unless (verify-repository)
    114   (fprintf (current-error-port) "No repository found at ~a\n"
    115            (repository-base))
    116   (exit 1))
     113(verify-repository)
    117114
    118115(wrap-column (determine-wrap-column))
     116(chicken-doc-warnings
     117 (get-environment-variable "CHICKEN_DOC_WARNINGS"))
    119118
    120119(with-output-to-pager
  • release/4/chicken-doc/trunk/chicken-doc-text.scm

    r20075 r20465  
    1515;; us obtain the current stylesheet bindings, so we must approximate
    1616;; them with a letrec
    17 (define (make-text-stylesheet doc #!key (wrap 78))
     17(define (make-text-stylesheet doc #!key (wrap 78) (warnings #f))
    1818  (define (flatten-frags frags)
    1919    (with-output-to-string (lambda () (SRV:send-reply frags))))
     
    7676  ;(define (fill char) (lambda (st) ((pad-char char (pad/both (fmt-width st))) st)))
    7777  (define (drop-tag . x) '())
     78  (define (text-warning . args)
     79    (when warnings (apply warning args)))
     80  (define (drop-tag-noisily tag . body)
     81    (text-warning "dropped" (cons tag body))
     82    '())
    7883                           
    7984  (let* ((wrap (and wrap (not (zero? wrap)) (max wrap 0)))
     
    8388        ((default-elts
    8489          `((*text* . ,(lambda (tag text) text))
    85             (*default* . ,(lambda (tag . body) (warning "dropped" (cons tag body)) '()))))
     90            (*default* . ,drop-tag-noisily)))
    8691         (inline-elts
    8792          `((b . ,(lambda (tag . body) `("_" ,body "_")))
     
    283288      ss)))
    284289
    285 (define (write-sxml-as-text doc wrap-col)
     290(define (write-sxml-as-text doc wrap-col #!key (warnings #f))
    286291  (SRV:send-reply
    287292   (pre-post-order doc
    288                    (make-text-stylesheet doc wrap: wrap-col))))
     293                   (make-text-stylesheet doc
     294                                         wrap: wrap-col
     295                                         warnings: warnings))))
    289296
    290297)
  • release/4/chicken-doc/trunk/chicken-doc.scm

    r19974 r20465  
    77(verify-repository
    88 open-repository close-repository locate-repository current-repository
    9  repository-base
    109 describe-signatures
    1110 search-only
     
    1413 doc-dwim
    1514;; Used additionally by chicken-doc-admin.  Somewhat internal, but exported.
    16  repository-information repository-root open-repository*
     15 repository-information repository-root repository-base open-repository*
    1716 repository-magic +repository-version+
    1817 repository-id-cache set-repository-id-cache!
     
    4241;; Parameters
    4342 wrap-column
     43 chicken-doc-warnings
    4444 )
    4545
     
    5454(define wrap-column
    5555  (make-parameter 76))   ; 0 or #f for no wrapping
     56(define chicken-doc-warnings
     57  (make-parameter #f))
    5658
    5759;;; Lowlevel
     
    376378  (cond ((node-sxml node)
    377379         => (lambda (doc)
    378               (write-sxml-as-text doc (wrap-column))))
     380              (write-sxml-as-text doc (wrap-column)
     381                                  warnings: (chicken-doc-warnings))))
    379382        (else
    380383         (error "No such identifier"
Note: See TracChangeset for help on using the changeset viewer.