The softdrink Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The softdrink Reference Manual

This is the softdrink Reference Manual, version 0.1.0, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:36:40 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

About Softdrink

Softdrink is a small toolkit to extract CSS from HTML or inline it. Softdrink relies on lQuery and LASS.

How To

Extracting style information happens with slurp.

(softdrink:slurp "<div><foo/><foo id=\"bla\" style=\"bar:baz;bluh: bbab\" /></div>")

Injecting CSS back in happens with mix. You can then prettify the output with pour.

(softdrink:pour (softdrink:mix "<foo><p/></foo>" '(p :text-decoration underline)))

Softdrink includes support for the LASS item-types :BLOCK and :PROPERTY. Any other type needs to be added with DEFINE-INLINER or DEFINE-MANIPULATOR.

See Also


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 softdrink

Maintainer

Nicolas Hafner <shinmera@tymoon.eu>

Author

Nicolas Hafner <shinmera@tymoon.eu>

Home Page

https://github.com/Shinmera/softdrink

License

Artistic

Description

Tools to inline or extract CSS into/from HTML.

Version

0.1.0

Dependencies
Source

softdrink.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 softdrink.asd

Location

softdrink.asd

Systems

softdrink (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 softdrink/package.lisp

Parent

softdrink (system)

Location

package.lisp

Packages

softdrink


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 softdrink/toolkit.lisp

Dependency

package.lisp (file)

Parent

softdrink (system)

Location

toolkit.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 softdrink/inline.lisp

Dependency

toolkit.lisp (file)

Parent

softdrink (system)

Location

inline.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.5 softdrink/extract.lisp

Dependency

inline.lisp (file)

Parent

softdrink (system)

Location

extract.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 softdrink

Source

package.lisp (file)

Nickname

org.tymoonnext.softdrink

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: define-inliner NAME (ROOT &rest ARGS) &body BODY

Defines a new inliner.

NAME — The inliner’s name, automatically converted to a keyword. ROOT — Symbol bound to the root node to process.
ARGS — Lambda-list for the manipulator arguments.

Package

softdrink

Source

inline.lisp (file)

Macro: define-manipulator NAME (ELEMENT &rest ARGS) &body BODY

Defines a new manipulator.

NAME — The manipulator’s name, automatically converted to a keyword. ELEMENT — Symbol bound to the element to process.
ARGS — Lambda-list for the manipulator arguments.

Package

softdrink

Source

inline.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: extract-sheet ROOT &key MODIFY

Extract style elements from ROOT into a LASS sheet.

If MODIFY is non-NIL the STYLE attributes are removed.

Returns two values: the LASS sheet and the ROOT.

Package

softdrink

Source

extract.lisp (file)

Function: inline-block ROOT BLOCK

Inlines the given LASS block into the ROOT node. Returns the ROOT.

Package

softdrink

Source

inline.lisp (file)

Function: inline-sheet LASS-SHEET ROOT

Inlines the given LASS-SHEET into the ROOT node. Returns the ROOT.

Package

softdrink

Source

inline.lisp (file)

Function: inliner TYPE

Returns a function to use as an inliner. The TYPE is automatically converted to a keyword. If no fitting function can be found, a noop-function is returned.

Package

softdrink

Source

inline.lisp (file)

Writer

(setf inliner) (function)

Function: (setf inliner) FUNCTION TYPE

Set a new inliner function. The TYPE is automatically converted to a keyword.

Package

softdrink

Source

inline.lisp (file)

Reader

inliner (function)

Function: manipulate NODE ITEM

Manipulate the NODE with the given ITEM. Returns the NODE.

Package

softdrink

Source

inline.lisp (file)

Function: manipulator TYPE

Returns a function to use as a manipulator. The TYPE is automatically converted to a keyword. If no fitting function can be found, a noop-function is returned.

Package

softdrink

Source

inline.lisp (file)

Writer

(setf manipulator) (function)

Function: (setf manipulator) FUNCTION TYPE

Set a new manipulator function. The TYPE is automatically converted to a keyword.

Package

softdrink

Source

inline.lisp (file)

Reader

manipulator (function)

Function: mix SOURCE &rest LASS-SHEET

Mixes the LASS-SHEET definition into the SOURCE. Returns a NODE.

Source can either be a NODE or something PARSEable.

See PLUMP:PARSE, LASS:COMPILE-SHEET

Package

softdrink

Source

inline.lisp (file)

Function: pour NODE &optional STREAM

Serializes NODE into STREAM.

STREAM can either be an object of type STREAM, NIL (to string), or T (to *standard-output*).

See PLUMP:SERIALIZE

Package

softdrink

Source

inline.lisp (file)

Function: slurp SOURCE &key STREAM PRETTY MODIFY

Slurp all style information from SOURCE into STREAM.

SOURCE — can be either a NODE or something PLUMP:PARSEable. STREAM — Where to output the CSS to. See LASS:WRITE-SHEET PRETTY — Whether to prettify CSS or not. See LASS:WRITE-SHEET MODIFY — Whether to modify the root or not. See EXTRACT-SHEET

Returns two values: The ourput of WRITE-SHEET and the ROOT.

Package

softdrink

Source

extract.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *inliners*
Package

softdrink

Source

inline.lisp (file)

Special Variable: *manipulators*
Package

softdrink

Source

inline.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: find-similar NODE
Package

softdrink

Source

extract.lisp (file)

Function: parse-style STYLE
Package

softdrink

Source

toolkit.lisp (file)

Function: read-property ()
Package

softdrink

Source

toolkit.lisp (file)

Function: selector CHILD

Returns a string that should (hopefully) uniquely identify the NODE.

Package

softdrink

Source

extract.lisp (file)

Function: to-keyword THING
Package

softdrink

Source

toolkit.lisp (file)

Function: unique-descriptor NODE
Package

softdrink

Source

extract.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, softdrink.asd: The softdrink<dot>asd file
File, Lisp, softdrink/extract.lisp: The softdrink/extract<dot>lisp file
File, Lisp, softdrink/inline.lisp: The softdrink/inline<dot>lisp file
File, Lisp, softdrink/package.lisp: The softdrink/package<dot>lisp file
File, Lisp, softdrink/toolkit.lisp: The softdrink/toolkit<dot>lisp file

L
Lisp File, softdrink.asd: The softdrink<dot>asd file
Lisp File, softdrink/extract.lisp: The softdrink/extract<dot>lisp file
Lisp File, softdrink/inline.lisp: The softdrink/inline<dot>lisp file
Lisp File, softdrink/package.lisp: The softdrink/package<dot>lisp file
Lisp File, softdrink/toolkit.lisp: The softdrink/toolkit<dot>lisp file

S
softdrink.asd: The softdrink<dot>asd file
softdrink/extract.lisp: The softdrink/extract<dot>lisp file
softdrink/inline.lisp: The softdrink/inline<dot>lisp file
softdrink/package.lisp: The softdrink/package<dot>lisp file
softdrink/toolkit.lisp: The softdrink/toolkit<dot>lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
D   E   F   I   M   P   R   S   T   U  
Index Entry  Section

(
(setf inliner): Exported functions
(setf manipulator): Exported functions

D
define-inliner: Exported macros
define-manipulator: Exported macros

E
extract-sheet: Exported functions

F
find-similar: Internal functions
Function, (setf inliner): Exported functions
Function, (setf manipulator): Exported functions
Function, extract-sheet: Exported functions
Function, find-similar: Internal functions
Function, inline-block: Exported functions
Function, inline-sheet: Exported functions
Function, inliner: Exported functions
Function, manipulate: Exported functions
Function, manipulator: Exported functions
Function, mix: Exported functions
Function, parse-style: Internal functions
Function, pour: Exported functions
Function, read-property: Internal functions
Function, selector: Internal functions
Function, slurp: Exported functions
Function, to-keyword: Internal functions
Function, unique-descriptor: Internal functions

I
inline-block: Exported functions
inline-sheet: Exported functions
inliner: Exported functions

M
Macro, define-inliner: Exported macros
Macro, define-manipulator: Exported macros
manipulate: Exported functions
manipulator: Exported functions
mix: Exported functions

P
parse-style: Internal functions
pour: Exported functions

R
read-property: Internal functions

S
selector: Internal functions
slurp: Exported functions

T
to-keyword: Internal functions

U
unique-descriptor: Internal functions

Jump to:   (  
D   E   F   I   M   P   R   S   T   U  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*inliners*: Internal special variables
*manipulators*: Internal special variables

S
Special Variable, *inliners*: Internal special variables
Special Variable, *manipulators*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S  
Index Entry  Section

P
Package, softdrink: The softdrink package

S
softdrink: The softdrink system
softdrink: The softdrink package
System, softdrink: The softdrink system

Jump to:   P   S