Whitespace cosmetics

Replace tabs with spaces
Align some related lines
Remove trailing whitespace
This commit is contained in:
Geert Janssens 2014-12-18 16:47:20 +01:00 committed by Geert Janssens
parent 4f5658fc7a
commit 539ef52837

View File

@ -130,19 +130,19 @@
(define (gnc:html-document-render doc . rest) (define (gnc:html-document-render doc . rest)
(let ((stylesheet (gnc:html-document-style-sheet doc)) (let ((stylesheet (gnc:html-document-style-sheet doc))
(headers? (if (null? rest) #f (if (car rest) #t #f))) (headers? (if (null? rest) #f (if (car rest) #t #f)))
(style-text (gnc:html-document-style-text doc)) (style-text (gnc:html-document-style-text doc))
) )
(if stylesheet (if stylesheet
;; if there's a style sheet, let it do the rendering ;; if there's a style sheet, let it do the rendering
(gnc:html-style-sheet-render stylesheet doc headers?) (gnc:html-style-sheet-render stylesheet doc headers?)
;; otherwise, do the trivial render. ;; otherwise, do the trivial render.
(let* ((retval '()) (let* ((retval '())
(push (lambda (l) (set! retval (cons l retval)))) (push (lambda (l) (set! retval (cons l retval))))
(objs (gnc:html-document-objects doc)) (objs (gnc:html-document-objects doc))
(work-to-do (length objs)) (work-to-do (length objs))
(css? (gnc-html-engine-supports-css)) (css? (gnc-html-engine-supports-css))
(work-done 0) (work-done 0)
(title (gnc:html-document-title doc))) (title (gnc:html-document-title doc)))
;; compile the doc style ;; compile the doc style
(gnc:html-style-table-compile (gnc:html-document-style doc) (gnc:html-style-table-compile (gnc:html-document-style doc)
@ -160,9 +160,9 @@
(push "<head>\n") (push "<head>\n")
(push "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n") (push "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n")
(if css? (if css?
(if style-text (if style-text
(push (list "</style>" style-text "<style type=\"text/css\">\n")))) (push (list "</style>" style-text "<style type=\"text/css\">\n"))))
(let ((title (gnc:html-document-title doc))) (let ((title (gnc:html-document-title doc)))
(if title (if title
(push (list "</title>" title "<title>\n")))) (push (list "</title>" title "<title>\n"))))
@ -175,10 +175,10 @@
;; now render the children ;; now render the children
(for-each (for-each
(lambda (child) (lambda (child)
(begin (begin
(push (gnc:html-object-render child doc)) (push (gnc:html-object-render child doc))
(set! work-done (+ 1 work-done)) (set! work-done (+ 1 work-done))
(gnc:report-percent-done (* 100 (/ work-done work-to-do))))) (gnc:report-percent-done (* 100 (/ work-done work-to-do)))))
objs) objs)
(if (not (null? headers?)) (if (not (null? headers?))
@ -186,7 +186,7 @@
(push "</body>\n") (push "</body>\n")
(push "</html>\n"))) (push "</html>\n")))
(gnc:report-finished) (gnc:report-finished)
(gnc:html-document-pop-style doc) (gnc:html-document-pop-style doc)
(gnc:html-style-table-uncompile (gnc:html-document-style doc)) (gnc:html-style-table-uncompile (gnc:html-document-style doc))
@ -195,12 +195,12 @@
(define (gnc:html-document-push-style doc style) (define (gnc:html-document-push-style doc style)
(gnc:html-document-set-style-stack! (gnc:html-document-set-style-stack!
doc (cons style (gnc:html-document-style-stack doc)))) doc (cons style (gnc:html-document-style-stack doc))))
(define (gnc:html-document-pop-style doc) (define (gnc:html-document-pop-style doc)
(if (not (null? (gnc:html-document-style-stack doc))) (if (not (null? (gnc:html-document-style-stack doc)))
(gnc:html-document-set-style-stack! (gnc:html-document-set-style-stack!
doc (cdr (gnc:html-document-style-stack doc))))) doc (cdr (gnc:html-document-style-stack doc)))))
(define (gnc:html-document-add-object! doc obj) (define (gnc:html-document-add-object! doc obj)
(gnc:html-document-set-objects! (gnc:html-document-set-objects!
@ -215,32 +215,32 @@
(define (gnc:html-document-fetch-markup-style doc markup) (define (gnc:html-document-fetch-markup-style doc markup)
(let ((style-info #f) (let ((style-info #f)
(style-stack (gnc:html-document-style-stack doc))) (style-stack (gnc:html-document-style-stack doc)))
(if (not (null? style-stack)) (if (not (null? style-stack))
(set! style-info (set! style-info
(gnc:html-style-table-fetch (gnc:html-style-table-fetch
(car style-stack) (car style-stack)
(cdr style-stack) (cdr style-stack)
markup))) markup)))
(if (not style-info) (if (not style-info)
(gnc:make-html-markup-style-info) (gnc:make-html-markup-style-info)
style-info))) style-info)))
(define (gnc:html-document-fetch-data-style doc markup) (define (gnc:html-document-fetch-data-style doc markup)
(let ((style-info #f) (let ((style-info #f)
(style-stack (gnc:html-document-style-stack doc))) (style-stack (gnc:html-document-style-stack doc)))
(if (not (null? (gnc:html-document-style-stack doc))) (if (not (null? (gnc:html-document-style-stack doc)))
(set! style-info (set! style-info
(gnc:html-style-table-fetch (gnc:html-style-table-fetch
(car style-stack) (car style-stack)
(cdr style-stack) (cdr style-stack)
markup))) markup)))
(if (not style-info) (if (not style-info)
(gnc:make-html-data-style-info (gnc:make-html-data-style-info
(lambda (datum parms) (lambda (datum parms)
(sprintf #f "%a %a" markup datum)) (sprintf #f "%a %a" markup datum))
#f) #f)
style-info))) style-info)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; markup-rendering functions : markup-start and markup-end return ;; markup-rendering functions : markup-start and markup-end return
@ -273,11 +273,11 @@
(add-internal-tag (lambda (tag) (push "<") (push tag) (push ">"))) (add-internal-tag (lambda (tag) (push "<") (push tag) (push ">")))
(add-attribute (add-attribute
(lambda (key value prior) (lambda (key value prior)
(push " ") (push key) (push " ") (push key)
(if value (begin (push "=\"") (if value (begin (push "=\"")
(push value) (push value)
(push "\""))) (push "\"")))
#t)) #t))
(addextraatt (addextraatt
(lambda (attr) (lambda (attr)
(cond ((string? attr) (push " ") (push attr)) (cond ((string? attr) (push " ") (push attr))