aboutsummaryrefslogtreecommitdiff
path: root/src/guile
diff options
context:
space:
mode:
authorLudovic Courtès2009-05-27 22:23:08 +0200
committerLudovic Courtès2009-05-27 22:23:08 +0200
commit0c3e59a00b749e4b334bed984a72a68c9a3f8c46 (patch)
tree1cbd8be3b2c61c46f0210b261c571b60245ddf3c /src/guile
parentadfc4299a872d1bc571eb7d4be2db8bc010fb10a (diff)
downloadskribilo-0c3e59a00b749e4b334bed984a72a68c9a3f8c46.tar.gz
skribilo-0c3e59a00b749e4b334bed984a72a68c9a3f8c46.tar.lz
skribilo-0c3e59a00b749e4b334bed984a72a68c9a3f8c46.zip
pie: Move generic `sliceweight' writer in the right place.
* src/guile/skribilo/package/pie.scm (sliceweight): Add generic writer. * src/guile/skribilo/package/pie/lout.scm (sliceweight): Generic writer removed.
Diffstat (limited to 'src/guile')
-rw-r--r--src/guile/skribilo/package/pie.scm12
-rw-r--r--src/guile/skribilo/package/pie/lout.scm11
2 files changed, 8 insertions, 15 deletions
diff --git a/src/guile/skribilo/package/pie.scm b/src/guile/skribilo/package/pie.scm
index 2834076..3290665 100644
--- a/src/guile/skribilo/package/pie.scm
+++ b/src/guile/skribilo/package/pie.scm
@@ -300,10 +300,14 @@ the string \"hello\". Implement `sliceweight' markups too."
(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")))
+ ;; 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
+ (pie-sliceweight-value node pct?))
+ engine))))
;;;
diff --git a/src/guile/skribilo/package/pie/lout.scm b/src/guile/skribilo/package/pie/lout.scm
index 085cfc2..03d17fe 100644
--- a/src/guile/skribilo/package/pie/lout.scm
+++ b/src/guile/skribilo/package/pie/lout.scm
@@ -119,14 +119,3 @@
(output (markup-body node) engine)
(display " }\n")))
-(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
- (pie-sliceweight-value node pct?))
- engine))))
-
-;;; arch-tag: b5221e30-f80e-4b72-a281-83ce19ddb755