summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Court`es2007-09-20 09:33:28 +0000
committerLudovic Court`es2007-09-20 09:33:28 +0000
commitd558e816b374367b40c6880f2f8eb9bcb6044113 (patch)
tree9bd952c270ced69300e76d3850b95517aea8c611
parent11789ba0f936f6d4095cd1b761817557cf69ba3f (diff)
downloadskribilo-d558e816b374367b40c6880f2f8eb9bcb6044113.tar.gz
skribilo-d558e816b374367b40c6880f2f8eb9bcb6044113.tar.lz
skribilo-d558e816b374367b40c6880f2f8eb9bcb6044113.zip
lout: New `:word' option for `chapter' et al.
* src/guile/skribilo/engine/lout.scm (lout-block-before): Handle the `:word' option (note `@BypassWord' should be added in Lout 3.37). (chapter, section, subsection, subsubsection): Mark `:word' as supported. (ref): Sanity-check IDENT. git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-106
-rw-r--r--src/guile/skribilo/engine/lout.scm19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index 1aefe5c..49df54d 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -1359,6 +1359,7 @@
(let ((lout-markup (lout-structure-markup (markup-markup n) e))
(title (markup-option n :title))
(number (markup-option n :number))
+ (word (markup-option n :word))
(ident (markup-ident n)))
(if (not lout-markup)
@@ -1380,6 +1381,12 @@
(markup-number-string n))
(display " @BypassNumber { } # unnumbered\n"))
+ (if (and word
+ (eq? (engine-custom e 'document-type)
+ 'book))
+ (format #t " @BypassWord { ~a }~%"
+ word))
+
(cond ((string? ident)
(begin
(display " @Tag { ")
@@ -1485,7 +1492,7 @@
;* section ... .. @label chapter@ */
;*---------------------------------------------------------------------*/
(markup-writer 'chapter
- :options '(:title :number :toc :file :env)
+ :options '(:title :number :toc :file :env :word)
:validate (lambda (n e)
(document? (ast-parent n)))
@@ -1503,7 +1510,7 @@
;* section ... . @label section@ */
;*---------------------------------------------------------------------*/
(markup-writer 'section
- :options '(:title :number :toc :file :env)
+ :options '(:title :number :toc :file :env :word)
:validate (lambda (n e)
(is-markup? (ast-parent n) 'chapter))
:before lout-start-large-scale-structure
@@ -1513,7 +1520,7 @@
;* subsection ... @label subsection@ */
;*---------------------------------------------------------------------*/
(markup-writer 'subsection
- :options '(:title :number :toc :file :env)
+ :options '(:title :number :toc :file :env :word)
:validate (lambda (n e)
(is-markup? (ast-parent n) 'section))
:before lout-start-large-scale-structure
@@ -1523,7 +1530,7 @@
;* subsubsection ... @label subsubsection@ */
;*---------------------------------------------------------------------*/
(markup-writer 'subsubsection
- :options '(:title :number :toc :file :env)
+ :options '(:title :number :toc :file :env :word)
:validate (lambda (n e)
(is-markup? (ast-parent n) 'subsection))
:before lout-start-large-scale-structure
@@ -2488,7 +2495,7 @@
(if text (output text e))
;; Marks don't have a number
- (if (eq? kind 'mark)
+ (if (and ident (eq? kind 'mark))
(format #t (lout-page-of ident))
(begin
;; Don't output a section/whatever number
@@ -2504,7 +2511,7 @@
(markup-number-string target))))
(display " ")
(display number))
- (if show-page-num?
+ (if (and ident show-page-num?)
(format #t (lout-page-of ident))))))))))
;*---------------------------------------------------------------------*/