diff options
author | Ludovic Courtès | 2009-05-27 22:20:56 +0200 |
---|---|---|
committer | Ludovic Courtès | 2009-05-27 22:20:56 +0200 |
commit | adfc4299a872d1bc571eb7d4be2db8bc010fb10a (patch) | |
tree | 55fb7b75cd0131e98b61d1cb2244aa58137160f5 /src | |
parent | c9157a3905fc17a70d36ec46db809efb91c14887 (diff) | |
download | skribilo-adfc4299a872d1bc571eb7d4be2db8bc010fb10a.tar.gz skribilo-adfc4299a872d1bc571eb7d4be2db8bc010fb10a.tar.lz skribilo-adfc4299a872d1bc571eb7d4be2db8bc010fb10a.zip |
doc: Document `pie' markups.
* doc/user/pie.skb (Syntax): Document markups.
* src/guile/skribilo/package/pie.scm (pie, slice, sliceweight): Add
`:class' option.
(pie, slice, sliceweight)[writers]: Add `:options'.
Diffstat (limited to 'src')
-rw-r--r-- | src/guile/skribilo/package/pie.scm | 11 | ||||
-rw-r--r-- | src/guile/skribilo/package/pie/lout.scm | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/guile/skribilo/package/pie.scm b/src/guile/skribilo/package/pie.scm index f99c725..2834076 100644 --- a/src/guile/skribilo/package/pie.scm +++ b/src/guile/skribilo/package/pie.scm @@ -44,7 +44,7 @@ ;;; (define-markup (pie :rest opts - :key (ident #f) (title "Pie Chart") + :key (ident #f) (class "pie") (title "Pie Chart") (initial-angle 0) (total #f) (radius 3) (fingers? #t) (labels 'outside) (class "pie")) @@ -56,7 +56,8 @@ (body (the-body opts)))) (define-markup (slice :rest opts - :key (ident #f) (weight 1) (color "white") (detach? #f)) + :key (ident #f) (class "pie-slice") + (weight 1) (color "white") (detach? #f)) (new container (markup 'slice) (ident (or ident (symbol->string (gensym "slice")))) @@ -68,7 +69,8 @@ (body (the-body opts)))) (define-markup (sliceweight :rest opts - :key (ident #f) (percentage? #f)) + :key (ident #f) (class "pie-sliceweight") + (percentage? #f)) (new markup (markup 'sliceweight) (ident (or ident (symbol->string (gensym "sliceweight")))) @@ -251,6 +253,7 @@ the string \"hello\". Implement `sliceweight' markups too." `("colors: " ,@colors "\n"))))) (markup-writer 'pie (find-engine 'base) + :options '(:title :initial-angle :total :radius :labels) :action (lambda (node engine) (let* ((fmt (select-output-format engine)) (pie-file (string-append (markup-ident node) "." @@ -291,11 +294,13 @@ the string \"hello\". Implement `sliceweight' markups too." engine)))) (markup-writer 'slice (find-engine 'base) + :options '(:weight :color :detach?) :action (lambda (node engine) ;; Nothing to do here (error "slice: this writer should never be invoked"))) (markup-writer 'sliceweight (find-engine 'base) + :options '(:percentage?) :action (lambda (node engine) ;; Nothing to do here. (error "sliceweight: this writer should never be invoked"))) diff --git a/src/guile/skribilo/package/pie/lout.scm b/src/guile/skribilo/package/pie/lout.scm index fe3c674..085cfc2 100644 --- a/src/guile/skribilo/package/pie/lout.scm +++ b/src/guile/skribilo/package/pie/lout.scm @@ -1,6 +1,6 @@ ;;; lout.scm -- Lout implementation of the `pie' package. ;;; -;;; Copyright 2005, 2006, 2007 Ludovic Courtès <ludovic.courtes@laas.fr> +;;; Copyright 2005, 2006, 2007, 2009 Ludovic Courtès <ludo@gnu.org> ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -49,6 +49,7 @@ ;;; (markup-writer 'pie (find-engine 'lout) + :options '(:title :initial-angle :total :radius :labels :fingers?) :before (lambda (node engine) (let* ((weights (map (lambda (slice) (markup-option slice :weight)) @@ -121,6 +122,7 @@ (markup-writer 'sliceweight (find-engine 'base) ;; This writer should work for every engine, provided the `pie' markup has ;; a proper `&total-weight' option. + :options '(:percentage?) :action (lambda (node engine) (let ((pct? (markup-option node :percentage?))) (output (number->string |