summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Court`es2007-09-20 14:14:45 +0000
committerLudovic Court`es2007-09-20 14:14:45 +0000
commit46b3f874e91db7d8a82a2f15bdea57fb4a6152b9 (patch)
tree7150efb36bed12716a467b88687bdb6c4281334a
parent8c3ac87055e188b2818a7d1d8c0cb7bf4eec8e8e (diff)
parentd558e816b374367b40c6880f2f8eb9bcb6044113 (diff)
downloadskribilo-46b3f874e91db7d8a82a2f15bdea57fb4a6152b9.tar.gz
skribilo-46b3f874e91db7d8a82a2f15bdea57fb4a6152b9.tar.lz
skribilo-46b3f874e91db7d8a82a2f15bdea57fb4a6152b9.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: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-164
-rw-r--r--ChangeLog20
-rw-r--r--src/guile/skribilo/engine/lout.scm19
2 files changed, 33 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 8725b73..8075616 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,26 @@
 # arch-tag: automatic-ChangeLog--skribilo@sv.gnu.org--2006/skribilo--devo--1.2
 #
 
+2007-09-20 14:14:45 GMT	Ludovic Court`es <ludovic.courtes@laas.fr>	patch-164
+
+    Summary:
+      lout: New `:word' option for `chapter' et al.
+    Revision:
+      skribilo--devo--1.2--patch-164
+
+    * 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.
+
+    modified files:
+     ChangeLog src/guile/skribilo/engine/lout.scm
+
+    new patches:
+     lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-106
+
+
 2007-09-03 17:23:55 GMT	Ludovic Court`es <ludovic.courtes@laas.fr>	patch-163
 
     Summary:
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))))))))))
 
 ;*---------------------------------------------------------------------*/