aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLudovic Court`es2007-08-20 16:25:39 +0000
committerLudovic Court`es2007-08-20 16:25:39 +0000
commitec5596d48ae42a7b2f883f5c1086a69494aa27d1 (patch)
treeedf3b7b57ed5d0733b153e59f6dc58303a9e0789 /doc
parentf5ff21312a22ec043bec6885e64fbcc65ce37621 (diff)
parentaf8c534f411ef0671f43fda1017f42fcd28a29fa (diff)
downloadskribilo-ec5596d48ae42a7b2f883f5c1086a69494aa27d1.tar.gz
skribilo-ec5596d48ae42a7b2f883f5c1086a69494aa27d1.tar.lz
skribilo-ec5596d48ae42a7b2f883f5c1086a69494aa27d1.zip
Merge from skribilo@sv.gnu.org--2006
Patches applied: * lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2 (patch 122-127) * skribilo@sv.gnu.org--2006/skribilo--devo--1.2 (patch 138-143) - sui: Small autoload fix. - `outline' reader: Fixed `append-trees'. - Added `html-navtabs' by Manuel Serrano. - html-navtabs: Permit disabling of CSS output. - Allow arbitrary keyword arguments in `define-markup'. - Documented `html-navtabs'. git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-88
Diffstat (limited to 'doc')
-rw-r--r--doc/user/package.skb51
-rw-r--r--doc/user/src/html-navtabs.skb118
2 files changed, 166 insertions, 3 deletions
diff --git a/doc/user/package.skb b/doc/user/package.skb
index 997e263..dba26b3 100644
--- a/doc/user/package.skb
+++ b/doc/user/package.skb
@@ -1,7 +1,7 @@
;;; package.skb -- Packages
;;;
-;;; Copyright 2004, 2005 Manuel Serrano
-;;; Copyright 2007 Ludovic Courtès <ludovic.courtes@laas.fr>
+;;; Copyright 2001, 2004, 2005 Manuel Serrano
+;;; Copyright 2007 Ludovic Courtès <ludo@gnu.org>
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
@@ -155,7 +155,52 @@ The ,(param :css) is a shorthand for ,(param :style). For instance:])
(index :index *package-index* "web-book.skr" :note "package")
(p [
A convenient mode for rendering books (i.e., documents made of
-chapters and sections) in HTML.]))))
+chapters and sections) in HTML.]))
+
+ (subsection :title [HTML Navigation Tabs]
+
+ (p [The ,(tt [html-navtabs]) package enables quick navigation
+inside HTML documents by means of tabs. The produced HTML code uses CSS
+declarations. The ,(tt [html-navtabs]) package does not introduce any
+new markups. It is configured via additional ,(ref :text [engine
+customs.] :chapter "Engines")])
+
+ (subsubsection :title [HTML Engine Customization]
+
+ (p [,(tt [html-navtabs]) is to be used in conjunction with the
+,(ref :text (code "html-engine") :mark "html-engine")
+engine. Specifically, it adds the following new customization to this
+engine:])
+
+ (doc-engine 'html
+ `((html-navtabs [The tabs.])
+ (html-navtabs-padding [Padding above tabs.])
+ (html-navtabs-bar-background [Bar background color.]))
+ :def `(make-engine 'html
+ :custom '((html-navtabs ,(it [Containers whose
+ option ,(param :file) is ,(code "#t")]))
+ (html-navtabs-padding 20.)
+ (html-navtabs-bar-background
+ ,(engine-custom (find-engine 'html)
+ 'left-margin-background))))))
+
+ (subsubsection :title [Additional Container Options]
+
+ (p [,(tt [html-navtabs]) introduces two new ,(ref :text
+"containers" :section "Sectioning") (i.e., a ,(ref :text (code
+"document") :mark "document") ,(ref :text (code "chapter") :mark
+"chapter") ,(ref :text (code "section") :mark "subsection"), ...)
+attributes: ,(param :html-tabs-bar) and ,(param :no-tabs). The
+attribute ,(param :html-tabs-bar) may contain any Skribe expression. It
+controls the content of the navtabs sub-bar (i.e., a small line above
+the tabs). The attribute ,(param :no-tabs) disable tabs for this
+container.]))
+
+ (subsubsection :title [Example]
+
+ (p [Below is a full example using ,(tt [html-navtabs]).])
+
+ (prgm :file "src/html-navtabs.skb")))))
;*---------------------------------------------------------------------*/
;* Emacs indentation */
diff --git a/doc/user/src/html-navtabs.skb b/doc/user/src/html-navtabs.skb
new file mode 100644
index 0000000..27701d4
--- /dev/null
+++ b/doc/user/src/html-navtabs.skb
@@ -0,0 +1,118 @@
+;*---------------------------------------------------------------------*/
+;* Skribilo's `html-navtabs' package */
+;*---------------------------------------------------------------------*/
+(use-modules (skribilo package html-navtabs)
+ (srfi srfi-1))
+
+;*---------------------------------------------------------------------*/
+;* HTML customization */
+;*---------------------------------------------------------------------*/
+(let* ((he (find-engine 'html))
+ (oldh (markup-writer-get '&html-chapter-header he))
+ (colors (circular-list "#ffb643" "#de8bff")))
+ ;; re-bindings
+ (markup-writer '&html-chapter-header he
+ :options 'all
+ :predicate (lambda (n e)
+ (is-markup? (ast-parent n) 'chapter))
+ :action (lambda (n e)
+ (engine-custom-set! e 'left-margin-background (car colors))
+ (set! colors (cdr colors))
+ (output n e oldh))))
+
+;*---------------------------------------------------------------------*/
+;* menu ... */
+;*---------------------------------------------------------------------*/
+(define-markup (menu e #!rest opt #!key title)
+ (table :width 95. :border 1 :cellpadding 0 :cellspacing 0
+ :class "menu"
+ (tr :bg (engine-custom e 'title-background)
+ (th (color :fg (engine-custom e 'background) (bold title))))
+ (tr :bg (engine-custom e 'background)
+ (td (the-body opt)))))
+
+;*---------------------------------------------------------------------*/
+;* linux */
+;*---------------------------------------------------------------------*/
+(define (linux n e)
+ (menu e
+ :title "Linux"
+ (apply table :width 100. :border 0 :class "linux"
+ (tr (td :align 'left :valign 'top (bold "Linux")))
+ (map (lambda (l)
+ (tr (td :align 'left :valign 'top l)))
+ (list (ref :url "http://www.kernel.org/"
+ :text "Linux kernel")
+ (ref :url "http://www.gentoo.org/"
+ :text "Gentoo")
+ (ref :url "http://www.debian.org/"
+ :text "Debian")
+ (ref :url "http://www.redhat.org/"
+ :text "Red Hat")
+ (ref :url "http://www.mandrake.org/"
+ :text "Mandrake"))))))
+
+;*---------------------------------------------------------------------*/
+;* HTML customizations */
+;*---------------------------------------------------------------------*/
+(let ((he (find-engine 'html)))
+ (engine-custom-set! he 'favicon "icons/serrano.gif")
+ (engine-custom-set! he 'left-margin-size 25.)
+ (engine-custom-set! he 'left-margin
+ (lambda (n e)
+ (list (center (linux n e)))))
+ (engine-custom-set! he 'javascript #t)
+ (engine-custom-set! he 'head "div.skribetitle {
+ padding-top: 40;
+ }
+ div.skribetitle td {
+ font-size: xx-large;
+ font-weight: bold;
+ font-style: oblique;
+ }
+ body {
+ border: 1px;
+ border-color: black;
+ border-style: inset;
+ margin: 0;
+ padding: 0;
+ }
+ div.navtabs-bar form {
+ border: 0 0 0 0;
+ padding: 2px 2px 2px 2px;
+ margin: 2px 2px 2px 2px;
+ clear: none;
+ display: inline;
+ }
+ div.navtabs-bar select {
+ margin: 2px 2px 2px 2px;
+ font-family: Arial,Helvetica,sans-serif;
+ font-size: small;
+ }
+"))
+
+;*---------------------------------------------------------------------*/
+;* The title */
+;*---------------------------------------------------------------------*/
+(define title
+ (table :width 100. :cellpadding 10.
+ (tr (td :align 'center (image :file "linux.png"))
+ (td :align 'left [Skribilo ,(tt [html-navtabs]) Sample]))))
+
+;*---------------------------------------------------------------------*/
+;* The document */
+;*---------------------------------------------------------------------*/
+(document :title title :html-title "html-navtabs"
+ :html-tabs-bar
+ (table (tr (td :align 'right "a two-lines table"))
+ (tr (td :align 'right "yep")))
+
+ (section :title "Foo" :number #f (p [The in-line foo section]))
+
+ (chapter :title "Bar" :file #t
+ :html-tabs-bar [This is the bar chapter]
+ (p [Yehhh.]))
+ (chapter :title "Gee" :file #t
+ :html-tabs-bar [This is the gee chapter]
+ (p ":-)")))
+