9. Skribe User Manual -- Engines

When Skribe produces a document in a given format, it uses a specialize engine. For instance, when a Web page is made from a Skribe document, the HTML engine is used. The engines provided by Skribe are given below:

9.1 Functions dealing with engines

9.1.1 Creating engines

The function make-engine creates a brand new engine.

prototype
(make-engine [:version #unspecified] [:format "raw"] [:filter] [:delegate] [:symbol-table '()] [:custom '()] [:info '()] ident)
optionenginesdescription
versionThe version number.
formatThe output format (a string) of this engine.
filterA string filter (a function).
delegateA delegate engine.
symbol-tableThe engine symbol table.
customThe engine custom list.
infoMiscellaneous.
argumentdescription
identThe name (a symbol) of the new engine.

The function copy-engine duplicates an existing engine.

prototype
(copy-engine [:version #unspecified] [:filter] [:delegate] [:symbol-table] [:custom] ident e)
optionenginesdescription
versionThe version number.
filterA string filter (a function).
delegateA delegate engine.
symbol-tableThe engine symbol table.
customThe engine custom list.
argumentdescription
identThe name (a symbol) of the new engine.
eThe old engine to be duplicated.

9.1.2 Retrieving engines

The find-engine function searches in the list of defined engines. It returns an engine object on success and #f on failure.

prototype
(find-engine [:version #unspecified] id)
optionenginesdescription
versionAn optional version number for the searched engine.
argumentdescription
idThe name (a symbol) of the engine to be searched.

9.1.3 Engine accessors

The predicate engine? returns #t if its argument is an engine. Otherwise, it returns #f. In other words, engine? returns #t for objects created by make-engine, copy-engine, and find-engine.

prototype
(engine? obj)
argumentdescription
objThe checked object.

The following functions return information about engines.

prototype
(engine-ident obj)
(engine-format obj)
(engine-customs obj)
(engine-filter obj)
(engine-symbol-table obj)
argumentdescription
objThe engine.

9.1.4 Engine customs

Engine customs are locations where dynamic informations relative to engines can be stored. Engine custom can be seen a global variables that are specific to engines. The function engine-custom returns the value of a custom or #f if that custom is not defined. The function engine-custom-set! defines or sets a new value for a custom.

prototype
(engine-custom e id)
argumentdescription
eThe engine (as returned by find-engine).
idThe name of the custom.
prototype
(engine-custom-set! e id val)
argumentdescription
eThe engine (as returned by find-engine).
idThe name of the custom.
valThe new value of the custom.


This Html page has been produced by Skribe.
Last update Tue Jun 29 09:37:13 2010.