From 052c10245a523aa714489bda59e18a6c1a4f473e Mon Sep 17 00:00:00 2001
From: Ludovic Courtes
Date: Mon, 31 Oct 2005 23:26:24 +0000
Subject: Installed Autoconf/Automake machinery. Fixed a few things.
* src/guile/skribilo/evaluator.scm (skribe-load): Search through
`%load-path' and try with a `.scm' extension (rather than the `.skr'
one provided by the user).
(skribe-include): Added a few debugging statements.
* src/guile/skribilo/lib.scm (fix-rest-arg): Handle the dot notation for
rest arguments.
* src/guile/skribilo/reader/skribe.scm (%make-skribe-reader): Use
SQUARE-BRACKET-FREE-SYMBOL-MISC-CHARS.
* src/guile/skribilo/skribe/index.scm: Use `define-public' instead of
`define'.
* src/guile/skribilo/packages/*.scm: Moved to `skribilo/package'.
* LICENSE: Removed.
* COPYING: New.
* AUTHORS: New.
* NEWS: New.
* ChangeLog: New.
* configure.ac: New.
* Makefile.am: New. In various directories.
git-archimport-id: lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-10
---
src/guile/skribilo/package/web-article.scm | 232 +++++++++++++++++++++++++++++
1 file changed, 232 insertions(+)
create mode 100644 src/guile/skribilo/package/web-article.scm
(limited to 'src/guile/skribilo/package/web-article.scm')
diff --git a/src/guile/skribilo/package/web-article.scm b/src/guile/skribilo/package/web-article.scm
new file mode 100644
index 0000000..6a480be
--- /dev/null
+++ b/src/guile/skribilo/package/web-article.scm
@@ -0,0 +1,232 @@
+;*=====================================================================*/
+;* serrano/prgm/project/skribe/skr/web-article.skr */
+;* ------------------------------------------------------------- */
+;* Author : Manuel Serrano */
+;* Creation : Sat Jan 10 09:09:43 2004 */
+;* Last change : Wed Mar 24 16:45:08 2004 (serrano) */
+;* Copyright : 2004 Manuel Serrano */
+;* ------------------------------------------------------------- */
+;* A Skribe style for producing web articles */
+;*=====================================================================*/
+
+(define-skribe-module (skribilo package web-article))
+
+;*---------------------------------------------------------------------*/
+;* &web-article-load-options ... */
+;*---------------------------------------------------------------------*/
+(define &web-article-load-options (skribe-load-options))
+
+;*---------------------------------------------------------------------*/
+;* web-article-body-width ... */
+;*---------------------------------------------------------------------*/
+(define (web-article-body-width e)
+ (let ((w (engine-custom e 'body-width)))
+ (if (or (number? w) (string? w)) w 98.)))
+
+;*---------------------------------------------------------------------*/
+;* html-document-title-web ... */
+;*---------------------------------------------------------------------*/
+(define (html-document-title-web n e)
+ (let* ((title (markup-body n))
+ (authors (markup-option n 'author))
+ (tbg (engine-custom e 'title-background))
+ (tfg (engine-custom e 'title-foreground))
+ (tfont (engine-custom e 'title-font)))
+ (printf "
\n"
+ (html-width (web-article-body-width e)))
+ (if (string? tbg)
+ (printf "" tbg)
+ (display " | "))
+ (if (string? tfg)
+ (printf "" tfg))
+ (if title
+ (begin
+ (display "")
+ (if (string? tfont)
+ (begin
+ (printf "" tfont)
+ (output title e)
+ (display ""))
+ (begin
+ (printf "")
+ (output title e)
+ (display "")))
+ (display "\n")))
+ (if (not authors)
+ (display "\n")
+ (html-title-authors authors e))
+ (if (string? tfg)
+ (display ""))
+ (display " |
\n")))
+
+;*---------------------------------------------------------------------*/
+;* web-article-css-document-title ... */
+;*---------------------------------------------------------------------*/
+(define (web-article-css-document-title n e)
+ (let* ((title (markup-body n))
+ (authors (markup-option n 'author))
+ (id (markup-ident n)))
+ ;; the title
+ (printf "\n"
+ (string-canonicalize id))
+ (output title e)
+ (display "
\n")
+ ;; the authors
+ (printf "\n"
+ (string-canonicalize id))
+ (for-each (lambda (a) (output a e))
+ (cond
+ ((is-markup? authors 'author)
+ (list authors))
+ ((list? authors)
+ authors)
+ (else
+ '())))
+ (display "
\n")))
+
+;*---------------------------------------------------------------------*/
+;* web-article-css-author ... */
+;*---------------------------------------------------------------------*/
+(define (web-article-css-author n e)
+ (let ((name (markup-option n :name))
+ (title (markup-option n :title))
+ (affiliation (markup-option n :affiliation))
+ (email (markup-option n :email))
+ (url (markup-option n :url))
+ (address (markup-option n :address))
+ (phone (markup-option n :phone))
+ (nfn (engine-custom e 'author-font))
+ (align (markup-option n :align)))
+ (when name
+ (printf ""
+ (string-canonicalize (markup-ident n)))
+ (output name e)
+ (display "\n"))
+ (when title
+ (printf ""
+ (string-canonicalize (markup-ident n)))
+ (output title e)
+ (display "\n"))
+ (when affiliation
+ (printf ""
+ (string-canonicalize (markup-ident n)))
+ (output affiliation e)
+ (display "\n"))
+ (when (pair? address)
+ (printf ""
+ (string-canonicalize (markup-ident n)))
+ (for-each (lambda (a)
+ (output a e)
+ (newline))
+ address)
+ (display "\n"))
+ (when phone
+ (printf ""
+ (string-canonicalize (markup-ident n)))
+ (output phone e)
+ (display "\n"))
+ (when email
+ (printf ""
+ (string-canonicalize (markup-ident n)))
+ (output email e)
+ (display "\n"))
+ (when url
+ (printf ""
+ (string-canonicalize (markup-ident n)))
+ (output url e)
+ (display "\n"))))
+
+;*---------------------------------------------------------------------*/
+;* HTML settings */
+;*---------------------------------------------------------------------*/
+(define (web-article-modern-setup he)
+ (let ((sec (markup-writer-get 'section he))
+ (ft (markup-writer-get '&html-footnotes he)))
+ ;; &html-document-title
+ (markup-writer '&html-document-title he
+ :action html-document-title-web)
+ ;; section
+ (markup-writer 'section he
+ :options 'all
+ :before "
"
+ :action (lambda (n e)
+ (let ((e1 (make-engine 'html-web :delegate e))
+ (bg (engine-custom he 'section-background)))
+ (markup-writer 'section e1
+ :options 'all
+ :action (lambda (n e2) (output n e sec)))
+ (skribe-eval
+ (center (color :width (web-article-body-width e)
+ :margin 5 :bg bg n))
+ e1))))
+ ;; &html-footnotes
+ (markup-writer '&html-footnotes he
+ :options 'all
+ :before "
"
+ :action (lambda (n e)
+ (let ((e1 (make-engine 'html-web :delegate e))
+ (bg (engine-custom he 'section-background))
+ (fg (engine-custom he 'subsection-title-foreground)))
+ (markup-writer '&html-footnotes e1
+ :options 'all
+ :action (lambda (n e2)
+ (invoke (writer-action ft) n e)))
+ (skribe-eval
+ (center (color :width (web-article-body-width e)
+ :margin 5 :bg bg :fg fg n))
+ e1))))))
+
+;*---------------------------------------------------------------------*/
+;* web-article-css-setup ... */
+;*---------------------------------------------------------------------*/
+(define (web-article-css-setup he)
+ (let ((sec (markup-writer-get 'section he))
+ (ft (markup-writer-get '&html-footnotes he)))
+ ;; &html-document-title
+ (markup-writer '&html-document-title he
+ :before (lambda (n e)
+ (printf "\n"
+ (string-canonicalize (markup-ident n))))
+ :action web-article-css-document-title
+ :after "
\n")
+ ;; author
+ (markup-writer 'author he
+ :options '(:name :title :affiliation :email :url :address :phone :photo :align)
+ :before (lambda (n e)
+ (printf "\n"
+ (string-canonicalize (markup-ident n))))
+ :action web-article-css-author
+ :after ""
+ (string-canonicalize (markup-ident n))))
+ :action (lambda (n e) (output n e sec))
+ :after "\n")
+ ;; &html-footnotes
+ (markup-writer '&html-footnotes he
+ :options 'all
+ :before (lambda (n e)
+ (printf "\n")))
+
+;*---------------------------------------------------------------------*/
+;* Setup ... */
+;*---------------------------------------------------------------------*/
+(let* ((opt &web-article-load-options)
+ (p (memq :style opt))
+ (css (memq :css opt))
+ (he (find-engine 'html)))
+ (cond
+ ((and (pair? p) (pair? (cdr p)) (eq? (cadr p) 'css))
+ (web-article-css-setup he))
+ ((and (pair? css) (pair? (cdr css)) (string? (cadr css)))
+ (engine-custom-set! he 'css (cadr css))
+ (web-article-css-setup he))
+ (else
+ (web-article-modern-setup he))))
--
cgit v1.2.3