summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo/Makefile.am4
-rw-r--r--src/guile/skribilo/engine/html.scm63
-rw-r--r--src/guile/skribilo/module.scm6
-rw-r--r--src/guile/skribilo/source/Makefile.am (renamed from src/guile/skribilo/coloring/Makefile.am)6
-rw-r--r--src/guile/skribilo/source/c-lex.l (renamed from src/guile/skribilo/coloring/c-lex.l)0
-rw-r--r--src/guile/skribilo/source/c-lex.scm (renamed from src/guile/skribilo/coloring/c-lex.scm)4
-rw-r--r--src/guile/skribilo/source/c.scm (renamed from src/guile/skribilo/coloring/c.scm)6
-rw-r--r--src/guile/skribilo/source/lisp-lex.l (renamed from src/guile/skribilo/coloring/lisp-lex.l)0
-rw-r--r--src/guile/skribilo/source/lisp-lex.scm (renamed from src/guile/skribilo/coloring/lisp-lex.scm)5
-rw-r--r--src/guile/skribilo/source/lisp.scm (renamed from src/guile/skribilo/coloring/lisp.scm)6
-rw-r--r--src/guile/skribilo/source/parameters.scm (renamed from src/guile/skribilo/coloring/parameters.scm)2
-rw-r--r--src/guile/skribilo/source/xml-lex.l (renamed from src/guile/skribilo/coloring/xml-lex.l)0
-rw-r--r--src/guile/skribilo/source/xml-lex.scm (renamed from src/guile/skribilo/coloring/xml-lex.scm)5
-rw-r--r--src/guile/skribilo/source/xml.scm (renamed from src/guile/skribilo/coloring/xml.scm)4
-rw-r--r--src/guile/skribilo/sui.scm81
15 files changed, 102 insertions, 90 deletions
diff --git a/src/guile/skribilo/Makefile.am b/src/guile/skribilo/Makefile.am
index f25b08e..029d4f2 100644
--- a/src/guile/skribilo/Makefile.am
+++ b/src/guile/skribilo/Makefile.am
@@ -6,8 +6,8 @@ dist_guilemodule_DATA = biblio.scm color.scm config.scm \
reader.scm resolve.scm \
source.scm parameters.scm verify.scm \
writer.scm ast.scm location.scm \
- condition.scm
+ condition.scm sui.scm
-SUBDIRS = utils reader engine package coloring biblio
+SUBDIRS = utils reader engine package source biblio
include $(top_srcdir)/guile-lint.am
diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm
index a16f01f..b6ab8a7 100644
--- a/src/guile/skribilo/engine/html.scm
+++ b/src/guile/skribilo/engine/html.scm
@@ -35,13 +35,14 @@
:autoload (skribilo evaluator) (evaluate-document)
:autoload (skribilo output) (output)
:autoload (skribilo debug) (*debug*)
+ :autoload (skribilo sui) (document-sui)
:autoload (ice-9 rdelim) (read-line)
:autoload (ice-9 regex) (regexp-substitute/global)
:use-module (srfi srfi-13)
:use-module (srfi srfi-14)
:use-module ((srfi srfi-19) :renamer (symbol-prefix-proc 's19:))
- :export (html-engine
+ :export (html-engine html-title-engine html-file
html-width html-class html-markup-class
html-title-authors))
@@ -995,66 +996,6 @@
(html-title-authors (list authors) e))))
;*---------------------------------------------------------------------*/
-;* document-sui ... */
-;*---------------------------------------------------------------------*/
-(define (document-sui n e)
- (define (sui)
- (display "(sui \"")
- (evaluate-document (markup-option n :title) html-title-engine)
- (display "\"\n")
- (format #t " :file ~s\n" (sui-referenced-file n e))
- (sui-marks n e)
- (sui-blocks 'chapter n e)
- (sui-blocks 'section n e)
- (sui-blocks 'subsection n e)
- (sui-blocks 'subsubsection n e)
- (display " )\n"))
- (if (string? (*destination-file*))
- (let ((f (format #f "~a.sui" (file-prefix (*destination-file*)))))
- (with-output-to-file f sui))
- (sui)))
-
-;*---------------------------------------------------------------------*/
-;* sui-referenced-file ... */
-;*---------------------------------------------------------------------*/
-(define (sui-referenced-file n e)
- (let ((file (html-file n e)))
- (if (member (file-suffix file) '("skb" "sui" "skr" "html"))
- (string-append (strip-ref-base (file-prefix file)) ".html")
- file)))
-
-;*---------------------------------------------------------------------*/
-;* sui-marks ... */
-;*---------------------------------------------------------------------*/
-(define (sui-marks n e)
- (display " (marks")
- (for-each (lambda (m)
- (format #t "\n (~s" (markup-ident m))
- (format #t " :file ~s" (sui-referenced-file m e))
- (format #t " :mark ~s" (markup-ident m))
- (when (markup-class m)
- (format #t " :class ~s" (markup-class m)))
- (display ")"))
- (search-down (lambda (n) (is-markup? n 'mark)) n))
- (display ")\n"))
-
-;*---------------------------------------------------------------------*/
-;* sui-blocks ... */
-;*---------------------------------------------------------------------*/
-(define (sui-blocks kind n e)
- (format #t " (~as" kind)
- (for-each (lambda (chap)
- (display "\n (\"")
- (evaluate-document (markup-option chap :title) html-title-engine)
- (format #t "\" :file ~s" (sui-referenced-file chap e))
- (format #t " :mark ~s" (markup-ident chap))
- (when (markup-class chap)
- (format #t " :class ~s" (markup-class chap)))
- (display ")"))
- (container-search-down (lambda (n) (is-markup? n kind)) n))
- (display ")\n"))
-
-;*---------------------------------------------------------------------*/
;* author ... */
;*---------------------------------------------------------------------*/
(markup-writer 'author
diff --git a/src/guile/skribilo/module.scm b/src/guile/skribilo/module.scm
index 81d2a16..4e47192 100644
--- a/src/guile/skribilo/module.scm
+++ b/src/guile/skribilo/module.scm
@@ -75,9 +75,9 @@
((skribilo source) . (source-read-lines source-fontify
language? language-extractor
language-fontifier source-fontify))
- ((skribilo coloring lisp) . (skribe scheme lisp))
- ((skribilo coloring xml) . (xml))
- ((skribilo coloring c) . (c java))
+ ((skribilo source lisp) . (skribe scheme stklos bigloo lisp))
+ ((skribilo source xml) . (xml))
+ ((skribilo source c) . (c java))
((skribilo prog) . (make-prog-body resolve-line))
((skribilo color) .
(skribe-color->rgb skribe-get-used-colors skribe-use-color!))
diff --git a/src/guile/skribilo/coloring/Makefile.am b/src/guile/skribilo/source/Makefile.am
index 5073575..4c961cf 100644
--- a/src/guile/skribilo/coloring/Makefile.am
+++ b/src/guile/skribilo/source/Makefile.am
@@ -1,4 +1,4 @@
-guilemoduledir = $(GUILE_SITE)/skribilo/coloring
+guilemoduledir = $(GUILE_SITE)/skribilo/source
dist_guilemodule_DATA = parameters.scm c.scm lisp.scm xml.scm \
lisp-lex.scm xml-lex.scm c-lex.scm
@@ -14,9 +14,9 @@ EXTRA_DIST = lisp-lex.l xml-lex.l c-lex.l
$(GUILE) -L $(top_srcdir)/src/guile/silex \
-c '(load-from-path "lex.scm") (lex "$^" "$@")' && \
mv "$@" "$@.tmp" && \
- echo '(define-module (skribilo coloring $(^:%.l=%))' > "$@" && \
+ echo '(define-module (skribilo source $(^:%.l=%))' > "$@" && \
echo ' :use-module (skribilo lib)' >> "$@" && \
- echo ' :use-module (skribilo coloring parameters)' \
+ echo ' :use-module (skribilo source parameters)' \
>> "$@" && \
echo ' :use-module (srfi srfi-1)' >> "$@" && \
echo ' :export (lexer-init lexer' >> "$@" && \
diff --git a/src/guile/skribilo/coloring/c-lex.l b/src/guile/skribilo/source/c-lex.l
index b28a91a..b28a91a 100644
--- a/src/guile/skribilo/coloring/c-lex.l
+++ b/src/guile/skribilo/source/c-lex.l
diff --git a/src/guile/skribilo/coloring/c-lex.scm b/src/guile/skribilo/source/c-lex.scm
index 162c0c2..72c4929 100644
--- a/src/guile/skribilo/coloring/c-lex.scm
+++ b/src/guile/skribilo/source/c-lex.scm
@@ -1,6 +1,6 @@
-(define-module (skribilo coloring c-lex)
+(define-module (skribilo source c-lex)
:use-module (skribilo lib)
- :use-module (skribilo coloring parameters)
+ :use-module (skribilo source parameters)
:use-module (srfi srfi-1)
:export (lexer-init lexer
lexer-get-func-column
diff --git a/src/guile/skribilo/coloring/c.scm b/src/guile/skribilo/source/c.scm
index 0d94307..a0d04e0 100644
--- a/src/guile/skribilo/coloring/c.scm
+++ b/src/guile/skribilo/source/c.scm
@@ -19,11 +19,11 @@
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;; USA.
-(define-module (skribilo coloring c)
+(define-module (skribilo source c)
:use-module (skribilo lib)
:use-module (skribilo utils syntax)
- :use-module (skribilo coloring c-lex) ;; SILex generated
- :use-module (skribilo coloring parameters)
+ :use-module (skribilo source c-lex) ;; SILex generated
+ :use-module (skribilo source parameters)
:use-module (srfi srfi-39)
:export (c c-language java))
diff --git a/src/guile/skribilo/coloring/lisp-lex.l b/src/guile/skribilo/source/lisp-lex.l
index 30b6a44..30b6a44 100644
--- a/src/guile/skribilo/coloring/lisp-lex.l
+++ b/src/guile/skribilo/source/lisp-lex.l
diff --git a/src/guile/skribilo/coloring/lisp-lex.scm b/src/guile/skribilo/source/lisp-lex.scm
index f68f320..3b47d95 100644
--- a/src/guile/skribilo/coloring/lisp-lex.scm
+++ b/src/guile/skribilo/source/lisp-lex.scm
@@ -1,6 +1,7 @@
-(define-module (skribilo coloring lisp-lex)
+(define-module (skribilo source lisp-lex)
:use-module (skribilo lib)
- :use-module (skribilo coloring parameters)
+ :use-module (skribilo source parameters)
+ :use-module (srfi srfi-1)
:export (lexer-init lexer
lexer-get-func-column
lexer-get-func-offset
diff --git a/src/guile/skribilo/coloring/lisp.scm b/src/guile/skribilo/source/lisp.scm
index 46e8c59..77f1c9b 100644
--- a/src/guile/skribilo/coloring/lisp.scm
+++ b/src/guile/skribilo/source/lisp.scm
@@ -20,15 +20,15 @@
;;; USA.
-(define-module (skribilo coloring lisp)
+(define-module (skribilo source lisp)
:use-module (skribilo utils syntax)
:use-module (skribilo source)
- :use-module (skribilo coloring parameters)
+ :use-module (skribilo source parameters)
:use-module (skribilo lib)
:use-module (srfi srfi-39)
:use-module (ice-9 match)
:autoload (skribilo reader) (make-reader)
- :autoload (skribilo coloring lisp-lex) (lexer-init)
+ :autoload (skribilo source lisp-lex) (lexer-init)
:export (skribe scheme stklos bigloo lisp))
diff --git a/src/guile/skribilo/coloring/parameters.scm b/src/guile/skribilo/source/parameters.scm
index cb4e9bb..9bcb8e6 100644
--- a/src/guile/skribilo/coloring/parameters.scm
+++ b/src/guile/skribilo/source/parameters.scm
@@ -18,7 +18,7 @@
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;; USA.
-(define-module (skribilo coloring parameters)
+(define-module (skribilo source parameters)
:use-module (srfi srfi-39)
:export (*bracket-highlight* *class-highlight* *the-keys*))
diff --git a/src/guile/skribilo/coloring/xml-lex.l b/src/guile/skribilo/source/xml-lex.l
index aa7d312..aa7d312 100644
--- a/src/guile/skribilo/coloring/xml-lex.l
+++ b/src/guile/skribilo/source/xml-lex.l
diff --git a/src/guile/skribilo/coloring/xml-lex.scm b/src/guile/skribilo/source/xml-lex.scm
index d14aa5d..3ec6668 100644
--- a/src/guile/skribilo/coloring/xml-lex.scm
+++ b/src/guile/skribilo/source/xml-lex.scm
@@ -1,6 +1,7 @@
-(define-module (skribilo coloring xml-lex)
+(define-module (skribilo source xml-lex)
:use-module (skribilo lib)
- :use-module (skribilo coloring parameters)
+ :use-module (skribilo source parameters)
+ :use-module (srfi srfi-1)
:export (lexer-init lexer
lexer-get-func-column
lexer-get-func-offset
diff --git a/src/guile/skribilo/coloring/xml.scm b/src/guile/skribilo/source/xml.scm
index f6d69fd..05eac17 100644
--- a/src/guile/skribilo/coloring/xml.scm
+++ b/src/guile/skribilo/source/xml.scm
@@ -1,6 +1,6 @@
;;; xml.scm -- XML syntax highlighting.
;;;
-;;; Copyright 2005 Ludovic Courtès <ludovic.courtes@laas.fr>
+;;; Copyright 2005, 2007 Ludovic Courtès <ludovic.courtes@laas.fr>
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@
;;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-(define-module (skribilo coloring xml)
+(define-module (skribilo source xml)
:export (xml)
:use-module (skribilo lib)
:use-module (ice-9 regex))
diff --git a/src/guile/skribilo/sui.scm b/src/guile/skribilo/sui.scm
index e0a9b19..6535c66 100644
--- a/src/guile/skribilo/sui.scm
+++ b/src/guile/skribilo/sui.scm
@@ -1,7 +1,7 @@
;;; sui.scm
;;;
;;; Copyright 2003, 2004 Manuel Serrano
-;;; Copyright 2005, 2006 Ludovic Courtès <ludovic.courtes@laas.fr>
+;;; Copyright 2005, 2006, 2007 Ludovic Courtès <ludovic.courtes@laas.fr>
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
@@ -20,15 +20,23 @@
;;; USA.
(define-module (skribilo sui)
- :use-module (skribilo utils syntax)
:use-module (skribilo lib)
- :use-module (ice-9 match)
- :use-module (srfi srfi-1)
+ :use-module (skribilo ast)
:autoload (skribilo parameters) (*verbose*)
:autoload (skribilo reader) (make-reader)
+ :autoload (skribilo engine) (find-engine)
+ :autoload (skribilo evaluator) (evaluate-document)
+ :autoload (skribilo engine html)(html-file)
+ :use-module (skribilo utils strings)
+ :use-module (skribilo utils syntax)
+ :use-module (skribilo utils files)
+
+ :use-module (ice-9 match)
+ :use-module (srfi srfi-1)
:export (load-sui sui-ref->url sui-title sui-file sui-key
- sui-find-ref sui-search-ref sui-filter))
+ sui-find-ref sui-search-ref sui-filter
+ document-sui sui-referenced-file sui-marks sui-blocks))
(fluid-set! current-reader %skribilo-module-reader)
@@ -190,10 +198,71 @@
(let loop ((refs refs)
(res '()))
(if (pair? refs)
- (if (and (pred1 (car refs)))
+ (if (pred1 (car refs))
(loop (cdr refs)
(cons (filter pred2 (cdar refs)) res))
(loop (cdr refs) res))
(reverse! res))))
(else
(skribe-error 'sui-filter "Illegal `sui' format" sui))))
+
+;*---------------------------------------------------------------------*/
+;* document-sui ... */
+;*---------------------------------------------------------------------*/
+(define (document-sui n e)
+ (define (sui)
+ (display "(sui \"")
+ (evaluate-document (markup-option n :title) (find-engine 'html))
+ (display "\"\n")
+ (format #t " :file ~s\n" (sui-referenced-file n e))
+ (sui-marks n e)
+ (sui-blocks 'chapter n e)
+ (sui-blocks 'section n e)
+ (sui-blocks 'subsection n e)
+ (sui-blocks 'subsubsection n e)
+ (display " )\n"))
+ (if (string? (*destination-file*))
+ (let ((f (format #f "~a.sui" (file-prefix (*destination-file*)))))
+ (with-output-to-file f sui))
+ (sui)))
+
+;*---------------------------------------------------------------------*/
+;* sui-referenced-file ... */
+;*---------------------------------------------------------------------*/
+(define (sui-referenced-file n e)
+ (let ((file (html-file n e)))
+ (if (member (file-suffix file) '("skb" "sui" "skr" "html"))
+ (string-append (strip-ref-base (file-prefix file)) ".html")
+ file)))
+
+;*---------------------------------------------------------------------*/
+;* sui-marks ... */
+;*---------------------------------------------------------------------*/
+(define (sui-marks n e)
+ (display " (marks")
+ (for-each (lambda (m)
+ (format #t "\n (~s" (markup-ident m))
+ (format #t " :file ~s" (sui-referenced-file m e))
+ (format #t " :mark ~s" (markup-ident m))
+ (when (markup-class m)
+ (format #t " :class ~s" (markup-class m)))
+ (display ")"))
+ (search-down (lambda (n) (is-markup? n 'mark)) n))
+ (display ")\n"))
+
+;*---------------------------------------------------------------------*/
+;* sui-blocks ... */
+;*---------------------------------------------------------------------*/
+(define (sui-blocks kind n e)
+ (format #t " (~as" kind)
+ (for-each (lambda (chap)
+ (display "\n (\"")
+ (evaluate-document (markup-option chap :title)
+ (find-engine 'html))
+ (format #t "\" :file ~s" (sui-referenced-file chap e))
+ (format #t " :mark ~s" (markup-ident chap))
+ (when (markup-class chap)
+ (format #t " :class ~s" (markup-class chap)))
+ (display ")"))
+ (container-search-down (lambda (n) (is-markup? n kind)) n))
+ (display ")\n"))