11. Skribilo User Manual — Standard Packages
Contents↑ Skribilo User Manual

This chapter describes the standard packages that come with Skribilo. Additional packages may be found from the Skribe web page, but they may require slight modifications to work correctly with Skribilo.

In order to use the facilities described in the following sections, the Skribilo source file must contains statements such as:
(use-modules (skribilo package THE-PACKAGE))
where THE-PACKAGE is the desired package. GNU Guile users will recognize that this is Guile's standard way to use Scheme modules. The effect of the use-modules clause is to insert the bindings exported by THE-PACKAGE into the current module's name space. Note that third-party Skribilo packages can have arbitrary Guile module names. And of course, the use-modules clause can be used to import any Guile module, not just Skribilo packages.

11.1 Articles

11.1.1 acmproc

This package enables producing LaTeX documents conforming to the ACM proceeding (ACMPROC) style. It introduces the markup abstract:

prototype
(abstract :postscript [:class "abstract"])
optionenginesdescription
:classhtml lout latex context info xml The node class.
:postscripthtml lout latex context info xml The URL of the PostScript version of the paper.

11.1.2 jfp

This package enables producing LaTeX documents conforming to the Journal of Functional Programming (JFP) style. It introduces the markup abstract:

prototype
(abstract :postscript)
optionenginesdescription
:postscripthtml lout latex context info xml The URL of the PostScript version of the paper.

11.1.3 lncs

This package enables producing LaTeX documents conforming to the Lecture Notes on Computer Science (LNCS) style. It introduces the markups abstract and references:

prototype
(abstract :postscript)
optionenginesdescription
:postscripthtml lout latex context info xml The URL of the PostScript version of the paper.
prototype
(references [:sort])
optionenginesdescription
:sorthtml lout latex context info xml A sort procedure, as for the-bibliography.
See also
the-bibliography bib-sort/authors

11.2 Languages

Currently, native language support in Skribilo is rudimentary, limited to the following package. In the future, it should be possible to specify a document's language so that the output engine behaves accordingly, e.g., by choosing the right typographical rules and the right phrases.

11.2.1 french

Enables French typesetting and typographical rules.


11.3 letter

This package is to be used to authoring simple letters. It redefines the document markup.

prototype
(document :author :date :where [:class "letter"] [:ident])
optionenginesdescription
:identhtml lout latex context info xml The node identifier.
:classhtml lout latex context info xml The node class.
:wherehtml lout latex context info xml The location where the letter is posted.
:datehtml lout latex context info xml The date of the letter.
:authorhtml lout latex context info xml The author of the letter.

11.4 Web

11.4.1 web-book

This package provides a convenient mode for rendering books (i.e., documents made of chapters and sections) in HTML. It modifies the left-margin custom of the HTML engine (see HTML customs) such that the left margin of each HTML file produced contains a menu allowing for quick navigation within the HTML document.

11.4.2 web-book2

This package provides a different way to render books in HTML. Concretely, it prepends a small table of contents to each chapter, section, etc., that appears in an HTML file of its own, making it easy to move around the various HTML files of the document. Compared to web-book, it does not clutter the left margin of the HTML pages.

Unlike web-book, this package is ``purely functional'' in that it does not modify the HTML engine customs and writers.

11.4.3 html-navtabs

The html-navtabs package enables quick navigation inside HTML documents by means of tabs. The produced HTML code uses CSS declarations. The html-navtabs package does not introduce any new markups. It is configured via additional engine customs.

11.4.3.1 HTML Engine Customization

html-navtabs is to be used in conjunction with the html-engine engine. Specifically, it adds the following new customization to this engine:

customdefaultdescription
html-navtabs
Containers whose option :file is #t
The tabs.
html-navtabs-padding20.0Padding above tabs.
html-navtabs-bar-background#fBar background color.

11.4.3.2 Additional Container Options

html-navtabs introduces two new containers (i.e., a document chapter section, ...) attributes: :html-tabs-bar and :no-tabs. The attribute :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 :no-tabs disable tabs for this container.

11.4.3.3 Example

Below is a full example using html-navtabs.

;*---------------------------------------------------------------------*/
;*    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-line 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 ":-)")))
      

(made with skribilo)