summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtes2006-01-31 23:23:15 +0000
committerLudovic Courtes2006-01-31 23:23:15 +0000
commit09039355539a79187669b688ff6a03c8a74e2099 (patch)
tree2ebc062ab5556609394a350880fb7ee5c69e0642
parent66e42310c0d6518abb39d52553286b5253bba6fd (diff)
downloadskribilo-09039355539a79187669b688ff6a03c8a74e2099.tar.gz
skribilo-09039355539a79187669b688ff6a03c8a74e2099.tar.lz
skribilo-09039355539a79187669b688ff6a03c8a74e2099.zip
First time the user manual is compiled to HTML.
* doc/skr/api.skr (make-engine?): Fixed. (make-engine-custom): Likewise. * doc/skr/manual.skr (the-index): Don't pass `:&skribe-eval-location'. * doc/user/emacs.skb: Fixed typo. * doc/user/htmle.skb: Documented the `file-name-proc' custom. * doc/user/package.skb: Fixed the `prgm' example there. * doc/user/skribe-config.skb: Commented out the `OPTIONS' section. * doc/user/skribec.skb: Likewise. * doc/user/slide.skb: Don't refer to HTML-ENGINE, use `find-engine' instead. * doc/user/src/slides.skb: Don't pass `:slide' to `toc'. * doc/user/toc.skb: Commented the `:subsubsection' argument. * doc/user/user.skb (Index): Set `:indent' to "Index". * src/guile/skribilo.scm (skribilo-options): Added `--image-path'. (skribilo): Handle it. * src/guile/skribilo/ast.scm (ast->file-location): Exported. * src/guile/skribilo/engine/base.scm (the-index): Don't pass `:&skribe-eval-location'. * src/guile/skribilo/engine/html.scm: Export `html-width' and `html-title-authors'. * src/guile/skribilo/engine/lout.scm (lout-width): Don't use `flonum?'. * src/guile/skribilo/evaluator.scm (load-document): Added `:allow-other-keys' so that the optional parameters may contain keywords, too. * src/guile/skribilo/package/slide.scm: Use `(skribilo engine html)'. * src/guile/skribilo/skribe/api.scm (toc): Added `subsubsection'. git-archimport-id: lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-31
-rw-r--r--ChangeLog66
-rw-r--r--doc/skr/api.skr34
-rw-r--r--doc/skr/manual.skr8
-rw-r--r--doc/user/emacs.skb2
-rw-r--r--doc/user/htmle.skb3
-rw-r--r--doc/user/package.skb2
-rw-r--r--doc/user/skribe-config.skb22
-rw-r--r--doc/user/skribec.skb8
-rw-r--r--doc/user/slide.skb3
-rw-r--r--doc/user/src/slides.skb4
-rw-r--r--doc/user/toc.skb1
-rw-r--r--doc/user/user.skb4
-rw-r--r--src/guile/skribilo.scm4
-rw-r--r--src/guile/skribilo/ast.scm2
-rw-r--r--src/guile/skribilo/engine/base.scm8
-rw-r--r--src/guile/skribilo/engine/html.scm6
-rw-r--r--src/guile/skribilo/engine/lout.scm2
-rw-r--r--src/guile/skribilo/evaluator.scm3
-rw-r--r--src/guile/skribilo/package/slide.scm4
-rw-r--r--src/guile/skribilo/skribe/api.scm4
20 files changed, 142 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
index fb6c7ed..a4d8ec6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,72 @@
# arch-tag: automatic-ChangeLog--lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2
#
+2006-01-31 23:23:15 GMT Ludovic Courtes <ludovic.courtes@laas.fr> patch-31
+
+ Summary:
+ First time the user manual is compiled to HTML.
+ Revision:
+ skribilo--devel--1.2--patch-31
+
+ * doc/skr/api.skr (make-engine?): Fixed.
+ (make-engine-custom): Likewise.
+
+ * doc/skr/manual.skr (the-index): Don't pass `:&skribe-eval-location'.
+
+ * doc/user/emacs.skb: Fixed typo.
+
+ * doc/user/htmle.skb: Documented the `file-name-proc' custom.
+
+ * doc/user/package.skb: Fixed the `prgm' example there.
+
+ * doc/user/skribe-config.skb: Commented out the `OPTIONS' section.
+
+ * doc/user/skribec.skb: Likewise.
+
+ * doc/user/slide.skb: Don't refer to HTML-ENGINE, use `find-engine'
+ instead.
+
+ * doc/user/src/slides.skb: Don't pass `:slide' to `toc'.
+
+ * doc/user/toc.skb: Commented the `:subsubsection' argument.
+
+ * doc/user/user.skb (Index): Set `:indent' to "Index".
+
+ * src/guile/skribilo.scm (skribilo-options): Added `--image-path'.
+ (skribilo): Handle it.
+
+ * src/guile/skribilo/ast.scm (ast->file-location): Exported.
+
+ * src/guile/skribilo/engine/base.scm (the-index): Don't pass
+ `:&skribe-eval-location'.
+
+ * src/guile/skribilo/engine/html.scm: Export `html-width' and
+ `html-title-authors'.
+
+ * src/guile/skribilo/engine/lout.scm (lout-width): Don't use `flonum?'.
+
+ * src/guile/skribilo/evaluator.scm (load-document): Added
+ `:allow-other-keys' so that the optional parameters may contain
+ keywords, too.
+
+ * src/guile/skribilo/package/slide.scm: Use `(skribilo engine html)'.
+
+ * src/guile/skribilo/skribe/api.scm (toc): Added `subsubsection'.
+
+ modified files:
+ ChangeLog doc/skr/api.skr doc/skr/manual.skr
+ doc/user/emacs.skb doc/user/htmle.skb doc/user/package.skb
+ doc/user/skribe-config.skb doc/user/skribec.skb
+ doc/user/slide.skb doc/user/src/slides.skb doc/user/toc.skb
+ doc/user/user.skb src/guile/skribilo.scm
+ src/guile/skribilo/ast.scm src/guile/skribilo/engine/base.scm
+ src/guile/skribilo/engine/html.scm
+ src/guile/skribilo/engine/lout.scm
+ src/guile/skribilo/evaluator.scm
+ src/guile/skribilo/package/slide.scm
+ src/guile/skribilo/skribe/api.scm
+
+
2006-01-25 22:57:34 GMT Ludovic Courtes <ludovic.courtes@laas.fr> patch-30
Summary:
diff --git a/doc/skr/api.skr b/doc/skr/api.skr
index 00c6a38..a86e745 100644
--- a/doc/skr/api.skr
+++ b/doc/skr/api.skr
@@ -121,16 +121,21 @@
;* make-engine? ... */
;*---------------------------------------------------------------------*/
(define (make-engine? id o)
+ ;(format #t "make-engine? ~a ~a~%" id o)
(match o
- (((or 'make-engine 'copy-engine)
- (quote (? (lambda (x) (eq? x id)))) _)
- o)
- ((`_)
- #f)
- ((_)
- #f)
- ((a d)
- (or (make-engine? id a) (make-engine? id d)))
+ (((or 'make-engine 'copy-engine) ('quote sym) . rest)
+ (if (eq? sym id)
+ o
+ #f))
+ ((exp ___)
+ (let loop ((exp exp))
+ (cond ((null? exp)
+ #f)
+ ((pair? exp)
+ (or (make-engine? id (car exp))
+ (make-engine? id (cdr exp))))
+ (else
+ (make-engine? id exp)))))
(else
#f)))
@@ -138,13 +143,14 @@
;* make-engine-custom ... */
;*---------------------------------------------------------------------*/
(define (make-engine-custom def)
- (match (memq :custom def)
- ((:custom `custom _)
+ (let ((customs (memq :custom def)))
+ (match (if customs (cdr customs) #f)
+ ((((or 'quote 'quasiquote) custom) _ ___)
custom)
- ((:custom custom _)
- (eval custom))
+ (((custom) _ ___)
+ (primitive-eval custom))
(else
- '())))
+ '()))))
(define (sym/kw? x)
(or (symbol? x) (keyword? x)))
diff --git a/doc/skr/manual.skr b/doc/skr/manual.skr
index 30b2fcd..e6b7d64 100644
--- a/doc/skr/manual.skr
+++ b/doc/skr/manual.skr
@@ -248,14 +248,18 @@
(nc (markup-option n :column))
(pref (eq? (engine-custom e 'index-page-ref) #t))
(loc (ast-loc n))
+ ;; FIXME: Since we don't support
+ ;; `:&skribe-eval-location', we could set up a
+ ;; `parameterize' thing around `skribe-eval' to provide
+ ;; it with the right location information.
(t (cond
((null? ie)
"")
((or (not (integer? nc)) (= nc 1))
- (table :width 100. :&skribe-eval-location loc
+ (table :width 100. ;;:&skribe-eval-location loc
(make-column ie pref)))
(else
- (table :width 100. :&skribe-eval-location loc
+ (table :width 100. ;;:&skribe-eval-location loc
(make-sub-tables ie nc pref))))))
(output (skribe-eval t e) e))))
diff --git a/doc/user/emacs.skb b/doc/user/emacs.skb
index 742fa87..a526790 100644
--- a/doc/user/emacs.skb
+++ b/doc/user/emacs.skb
@@ -52,7 +52,7 @@ The ,(code "skribe") mode is a minor mode. It is intended to be used with
a Lisp or Scheme mode. Hence, to use the ,(code "skribe") mode you will
have to use the following Emacs commands:])
-,(disp :vert #t (source :language lisp [
+,(disp :verb #t (source :language lisp [
ESC-x: scheme-mode
ESC-x: skribe-mode
]))]))
diff --git a/doc/user/htmle.skb b/doc/user/htmle.skb
index 5e556cc..90343b9 100644
--- a/doc/user/htmle.skb
+++ b/doc/user/htmle.skb
@@ -65,6 +65,9 @@ the document.])
(title-background "The title background color.")
(title-foreground "The title foreground color.")
(file-title-separator "A text to be inserted in between the document title and the chapter or section title when the chapter or section is rendered in a separate file.")
+ (file-name-proc "A two-argument procedure that should return
+a string. This procedure is to be passed a node and an engine and
+should return a file name for the HTML page corresponding to this node.")
;; index configuration
(index-header-font-size "The index header font size.")
;; chapter configuration
diff --git a/doc/user/package.skb b/doc/user/package.skb
index b3fe6c3..19c99c9 100644
--- a/doc/user/package.skb
+++ b/doc/user/package.skb
@@ -25,7 +25,7 @@ Skribe distribution.])
In order to use the facilities described in the following sections, the
Skribe source file must contains expressions such as:])
-(prgm [(skribe-load ,(it "package.skr") ...)])
+(prgm "(skribe-load \"package.skr\" ...)")
[where ,(it (tt "package.skr")) is the described package.]
diff --git a/doc/user/skribe-config.skb b/doc/user/skribe-config.skb
index 956af63..e96e35b 100644
--- a/doc/user/skribe-config.skb
+++ b/doc/user/skribe-config.skb
@@ -29,16 +29,18 @@ The ,(code "skribe-config") gives information about the Skribe configuration.
This information can be the directories used to install Skribe, the Scheme
implementation used for compiling Skribe, etc.])
-;; Options
-(section :title "OPTIONS" :number #f [
-,(pre (let* ((proc (run-process "../etc/skribe-config" "--help" error: pipe:))
- (port (process-error-port proc)))
- (let loop ((line (read-line port))
- (lines '()))
- (if (eof-object? line)
- (reverse! lines)
- (begin
- (loop (read-line port) (cons* line "\n" lines)))))))]))
+;; Options (FIXME)
+; (section :title "OPTIONS" :number #f [
+; ,(pre (let* ((proc (run-process "../etc/skribe-config" "--help" error: pipe:))
+; (port (process-error-port proc)))
+; (let loop ((line (read-line port))
+; (lines '()))
+; (if (eof-object? line)
+; (reverse! lines)
+; (begin
+; (loop (read-line port) (cons* line "\n" lines)))))))])
+
+)
diff --git a/doc/user/skribec.skb b/doc/user/skribec.skb
index 0f00632..cad8f35 100644
--- a/doc/user/skribec.skb
+++ b/doc/user/skribec.skb
@@ -43,10 +43,10 @@ its possible targets which one to choose. These suffixes are:
(item :key (it ".tex") [a ,(it "TeX") target file.])
(item :key (it ".sui") [a ,(it "Skribe url index") file.]))])
-;; Options
-(section :title "OPTIONS" :number #f [
-,(mark "skribe compiler option")
-,(compiler-options *skribe-bin*)])
+;; Options (FIXME)
+;;(section :title "OPTIONS" :number #f [
+;;,(mark "skribe compiler option")
+;;,(compiler-options *skribe-bin*)])
;; Environment variables
(section :title "ENVIRONMENT VARIABLES" :number #f [
diff --git a/doc/user/slide.skb b/doc/user/slide.skb
index 0137e84..aff8ab5 100644
--- a/doc/user/slide.skb
+++ b/doc/user/slide.skb
@@ -101,7 +101,8 @@ output format does not support embedded application.]))
(p [Here is a complete example of Skribe slides:])
(if (and (engine-format? "html")
- (not (equal? (engine-custom html-engine 'html-variant) "html4")))
+ (not (equal? (engine-custom (find-engine 'html) 'html-variant)
+ "html4")))
;; Show the example and its result
(example-produce
(example :legend "Example of Skribe slides"
diff --git a/doc/user/src/slides.skb b/doc/user/src/slides.skb
index ac584d1..1606e91 100644
--- a/doc/user/src/slides.skb
+++ b/doc/user/src/slides.skb
@@ -7,8 +7,8 @@
(if (engine-format? "html")
(slide :title "Table of contents" :number #f :toc #f
- (toc :chapter #f :section #f :subsection #f :subsubsection #f
- :slide #t)))
+ (toc :chapter #f :section #f :subsection #f :subsubsection #f)))
+;;; :slide #t)))
(slide :title "X11 client" :toc #t :vspace 0.3
diff --git a/doc/user/toc.skb b/doc/user/toc.skb
index aa6c0dc..657ed7c 100644
--- a/doc/user/toc.skb
+++ b/doc/user/toc.skb
@@ -21,6 +21,7 @@
inclusion of chapters in the table of contents.])
(:section [A boolean controlling sections.])
(:subsection [A boolean controlling subsections.])
+ (:subsubsection [A boolean controlling subsubsections.])
(#!rest handle [An optional handle pointing to the node from
which the table of contents if computed.]))
:see-also '(document chapter section resolve handle))
diff --git a/doc/user/user.skb b/doc/user/user.skb
index d5ed06b..0c74e66 100644
--- a/doc/user/user.skb
+++ b/doc/user/user.skb
@@ -146,12 +146,12 @@ as HTML, Info pages, man pages, Postscript, etc.]))))
(begin
(chapter :title "Table of contents"
(toc :chapter #t :section #t :subsection #t))
- (section :title "Index" :number #f
+ (section :title "Index" :number #f :ident "Index"
(mark "global index")
(the-index :column (if (engine-format? "latex") 2 3)
*markup-index* *custom-index* *function-index* *package-index*
(default-index))))
- (chapter :title "Index"
+ (chapter :title "Index" :ident "Index"
(mark "global index")
(the-index :column (if (engine-format? "latex") 2 3)
*markup-index* *custom-index* *function-index* *package-index*
diff --git a/src/guile/skribilo.scm b/src/guile/skribilo.scm
index 285a92d..f683080 100644
--- a/src/guile/skribilo.scm
+++ b/src/guile/skribilo.scm
@@ -92,7 +92,7 @@ specifications."
(skribe-bib-path-set! (cons path (skribe-bib-path))))
(("source-path" :alternate "S" :arg path :help "adds <path> to source path")
(skribe-source-path-set! (cons path (skribe-source-path))))
- (("P" :arg path :help "adds <path> to image path")
+ (("image-path" :alternate "P" :arg path :help "adds <path> to image path")
(skribe-image-path-set! (cons path (skribe-image-path))))
(("split-chapters" :alternate "C" :arg chapter
:help "emit chapter's sections in separate files")
@@ -396,6 +396,7 @@ Processes a Skribilo/Skribe source file and produces its output.
(load-path (option-ref options 'load-path "."))
(bib-path (option-ref options 'bib-path "."))
(source-path (option-ref options 'source-path "."))
+ (image-path (option-ref options 'image-path "."))
(preload '())
(variants '())
@@ -426,6 +427,7 @@ Processes a Skribilo/Skribe source file and produces its output.
(*source-path* (cons source-path
(append %load-path
(*source-path*))))
+ (*image-path* (cons image-path (*image-path*)))
(*warning* (string->number warning-level))
(*verbose* (let ((v (option-ref options
'verbose 0)))
diff --git a/src/guile/skribilo/ast.scm b/src/guile/skribilo/ast.scm
index ab56442..ff61ff7 100644
--- a/src/guile/skribilo/ast.scm
+++ b/src/guile/skribilo/ast.scm
@@ -24,7 +24,7 @@
:autoload (skribilo location) (location?)
:use-module (skribilo utils syntax)
:export (<ast> ast? ast-loc ast-loc-set!
- ast-parent ast->string
+ ast-parent ast->string ast->file-location
<command> command? command-fmt command-body
<unresolved> unresolved? unresolved-proc
diff --git a/src/guile/skribilo/engine/base.scm b/src/guile/skribilo/engine/base.scm
index ed15da4..1d04e1d 100644
--- a/src/guile/skribilo/engine/base.scm
+++ b/src/guile/skribilo/engine/base.scm
@@ -418,14 +418,18 @@
(t (cond
((null? ie)
"")
+ ;; FIXME: Since we don't support
+ ;; `:&skribe-eval-location', we could set up a
+ ;; `parameterize' thing around `skribe-eval' to
+ ;; provide it with the right location information.
((or (not (integer? nc)) (= nc 1))
(table :width 100.
- :&skribe-eval-location loc
+ ;;:&skribe-eval-location loc
:class "index-table"
(make-column ie pref)))
(else
(table :width 100.
- :&skribe-eval-location loc
+ ;;:&skribe-eval-location loc
:class "index-table"
(make-sub-tables ie nc pref))))))
(output (skribe-eval t e) e))))
diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm
index 5165258..1ad86e9 100644
--- a/src/guile/skribilo/engine/html.scm
+++ b/src/guile/skribilo/engine/html.scm
@@ -531,7 +531,7 @@
;*---------------------------------------------------------------------*/
;* html-width ... */
;*---------------------------------------------------------------------*/
-(define (html-width width)
+(define-public (html-width width)
(cond
((and (integer? width) (exact? width))
(format #f "~A" width))
@@ -545,7 +545,7 @@
;*---------------------------------------------------------------------*/
;* html-class ... */
;*---------------------------------------------------------------------*/
-(define (html-class m)
+(define-public (html-class m)
(if (markup? m)
(let ((c (markup-class m)))
(if (or (string? c) (symbol? c) (number? c))
@@ -926,7 +926,7 @@
;*---------------------------------------------------------------------*/
;* html-title-authors ... */
;*---------------------------------------------------------------------*/
-(define (html-title-authors authors e)
+(define-public (html-title-authors authors e)
(define (html-authorsN authors cols first)
(define (make-row authors . opt)
(tr (map (lambda (v)
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index d01b547..c2339ca 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -876,7 +876,7 @@
;* lout-width ... */
;*---------------------------------------------------------------------*/
(define (lout-width width)
- (cond ((flonum? width) ;; a relative size
+ (cond ((inexact? width) ;; a relative size (XXX: was `flonum?')
;; FIXME: Hack ahead: assuming A4 with a 2.5cm margin
;; on both sides
(let* ((orientation (let ((lout (find-engine 'lout)))
diff --git a/src/guile/skribilo/evaluator.scm b/src/guile/skribilo/evaluator.scm
index df5e6a7..b47f821 100644
--- a/src/guile/skribilo/evaluator.scm
+++ b/src/guile/skribilo/evaluator.scm
@@ -118,7 +118,8 @@
;; List of the names of files already loaded.
(define *loaded-files* (make-parameter '()))
-(define* (load-document file :key (engine #f) (path #f) :rest opt)
+(define* (load-document file :key (engine #f) (path #f) :allow-other-keys
+ :rest opt)
(with-debug 4 'skribe-load
(debug-item " engine=" engine)
(debug-item " path=" path)
diff --git a/src/guile/skribilo/package/slide.scm b/src/guile/skribilo/package/slide.scm
index f5f0011..ddbbd1d 100644
--- a/src/guile/skribilo/package/slide.scm
+++ b/src/guile/skribilo/package/slide.scm
@@ -9,7 +9,9 @@
;* Skribe style for slides */
;*=====================================================================*/
-(define-skribe-module (skribilo package slide))
+(define-skribe-module (skribilo package slide)
+ :autoload (skribilo engine html) (html-width html-title-authors))
+
;*---------------------------------------------------------------------*/
;* slide-options */
diff --git a/src/guile/skribilo/skribe/api.scm b/src/guile/skribilo/skribe/api.scm
index c9606a0..2cd8b2e 100644
--- a/src/guile/skribilo/skribe/api.scm
+++ b/src/guile/skribilo/skribe/api.scm
@@ -102,7 +102,8 @@
opts
#!key
(ident #f) (class "toc")
- (chapter #t) (section #t) (subsection #f))
+ (chapter #t) (section #t) (subsection #f)
+ (subsubsection #f))
(let ((body (the-body opts)))
(new container
(markup 'toc)
@@ -112,6 +113,7 @@
(options `((:chapter ,chapter)
(:section ,section)
(:subsection ,subsection)
+ (:subsubsection ,subsubsection)
,@(the-options opts :ident :class)))
(body (cond
((null? body)