The url-rewrite Reference Manual

Table of Contents

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

The url-rewrite Reference Manual

This is the url-rewrite Reference Manual, version 0.1.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:44:06 2018 GMT+0.


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

1 Introduction


URL-REWRITE - Rewrite (X)HTML attributes with Common Lisp

URL-REWRITE is a small package which can be used to programmatically rewrite (X)HTML documents such that certain attributes values are replaced by others. It was written to rewrite URLs (as in <a href="..."> or <img src="...">) for cookie-less session handling but maybe you'll find other uses for it.

Complete documentation for URL-REWRITE can be found in the docs directory or at the project site.


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 url-rewrite

Version

0.1.1

Source

url-rewrite.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 url-rewrite.asd

Location

url-rewrite.asd

Systems

url-rewrite (system)


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

3.1.2 url-rewrite/packages.lisp

Parent

url-rewrite (system)

Location

packages.lisp

Packages

url-rewrite


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

3.1.3 url-rewrite/specials.lisp

Dependency

packages.lisp (file)

Parent

url-rewrite (system)

Location

specials.lisp

Exported Definitions
Internal Definitions

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

3.1.4 url-rewrite/primitives.lisp

Dependency

specials.lisp (file)

Parent

url-rewrite (system)

Location

primitives.lisp

Internal Definitions

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

3.1.5 url-rewrite/util.lisp

Dependency

primitives.lisp (file)

Parent

url-rewrite (system)

Location

util.lisp

Internal Definitions

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

3.1.6 url-rewrite/url-rewrite.lisp

Dependency

util.lisp (file)

Parent

url-rewrite (system)

Location

url-rewrite.lisp

Exported Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 url-rewrite

Source

packages.lisp (file)

Use List

common-lisp

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 Special variables

Special Variable: *url-rewrite-fill-tags*

The tag/attribute combinations where URL-rewriting should optionally add an attribute.

Package

url-rewrite

Source

specials.lisp (file)

Special Variable: *url-rewrite-tags*

The tag/attribute combinations where URL-rewriting should happen.

Package

url-rewrite

Source

specials.lisp (file)


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

5.1.2 Functions

Function: add-get-param-to-url URL NAME VALUE

URL is assumed to be a http URL. The pair of NAME and VALUE will be added as a GET parameter to this URL. Assumes that there’s no other parameter of the same name. Only checks if #? is part of the string to decide how to attach the new parameter to the end of the string.

Package

url-rewrite

Source

url-rewrite.lisp (file)

Function: rewrite-urls REWRITE-FN &optional TEST-FN

Reads an (X)HTML document from *STANDARD-INPUT* and writes it back to *STANDARD-OUTPUT*. Any attribute value which is in one of the positions denoted by *URL-REWRITE-TAGS* is rewritten by REWRITE-FN if it passes the test denoted by the optional function TEST-FN which defaults to the complement of STARTS-WITH-SCHEME-P.

This function aims to yield correct results for correct (X)HTML input and it also tries hard to never signal an error although it may warn if it encounters syntax errors. It will NOT detect any possible error nor is there any warranty that it will work correctly with faulty input.

Package

url-rewrite

Source

url-rewrite.lisp (file)

Function: starts-with-scheme-p STRING

Checks whether the string STRING represents a URL which starts with a scheme, i.e. something like ’https://’ or ’mailto:’.

Package

url-rewrite

Source

url-rewrite.lisp (file)

Function: url-encode STRING

URL-encode a string.

Package

url-rewrite

Source

url-rewrite.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: *find-string-hash*

Hash tables used internally by READ-UNTIL to cache offset arrays.

Package

url-rewrite

Source

specials.lisp (file)

Special Variable: *hyperdoc-base-uri*
Package

url-rewrite

Source

specials.lisp (file)

Special Variable: *url-rewrite-base-directory*
Package

url-rewrite

Source

specials.lisp (file)


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

5.2.2 Functions

Function: comment-start-p ()

Checks whether *STANDARD-OUTPUT* currently ’looks at’ the string "–". Will move the position within the stream by one unless the first characters it sees is not a hyphen.

Package

url-rewrite

Source

primitives.lisp (file)

Function: hyperdoc-lookup SYMBOL TYPE
Package

url-rewrite

Source

specials.lisp (file)

Function: letterp C

Checks whether C is a character between A and Z (case-insensitive).

Package

url-rewrite

Source

primitives.lisp (file)

Function: name-char-p C

Checks whether C is a name constituent character in the sense of HTML.

Package

url-rewrite

Source

primitives.lisp (file)

Function: peek-char* ()

PEEK-CHAR with input stream bound to *STANDARD-INPUT* and returning NIL on EOF.

Package

url-rewrite

Source

primitives.lisp (file)

Function: read-attribute &key SKIP WRITE-THROUGH

Read characters from *STANDARD-INPUT* assuming that they constitue a SGML-style attribute/value pair. Returns three values - the name of the attribute, its value, and the whole string which was read. On EOF the string(s) read so far is/are returned. If SKIP is true NIL is returned. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true.

Package

url-rewrite

Source

util.lisp (file)

Function: read-delimited-string &key SKIP WRITE-THROUGH

Reads and returns as its first value a string from *STANDARD-INPUT*. The string is either delimited by ’ or " in which case the delimiters aren’t part of the string but the second return value is the delimiter character or it is assumed to extend to the next character which is not a name constituent (see NAME-CHAR-P). On EOF the string read so far is returned. If SKIP is true NIL is returned. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true.

Package

url-rewrite

Source

util.lisp (file)

Function: read-name &key SKIP WRITE-THROUGH

Read characters from *STANDARD-INPUT* as long as they are name constituents. Returns the string which was read unless SKIP is true. On EOF the string read so far is returned. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true.

Package

url-rewrite

Source

util.lisp (file)

Function: read-until STRING &key SKIP WRITE-THROUGH

Reads characters from *STANDARD-INPUT* up to and including STRING. Return the string which was read (excluding STRING) unless SKIP is true. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true. On EOF the string read so far is returned.

Package

url-rewrite

Source

primitives.lisp (file)

Function: read-while PREDICATE &key SKIP WRITE-THROUGH

Reads characters from *STANDARD-INPUT* while PREDICATE returns a true value for each character. Returns the string which was read unless SKIP is true. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true. On EOF the string read so far is returned.

Package

url-rewrite

Source

primitives.lisp (file)

Function: skip-comment ()

Skip SGML comment from *STANDARD-INPUT*, i.e. a string enclosed in ’–’ on both sides. Returns no values. Writes all characters read to *STANDARD-OUTPUT*. This function assumes (without checking) that the current position of *STANDARD-INPUT* is at the beginning of a comment, after the first hyphen - see COMMENT-START-P.

Package

url-rewrite

Source

util.lisp (file)

Function: skip-whitespace &key SKIP WRITE-THROUGH

Read characters from *STANDARD-INPUT* as long as they are whitespace. Returns the string which was read unless SKIP is true. On EOF the string read so far is returned. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true.

Package

url-rewrite

Source

util.lisp (file)

Function: whitespacep C

Checks whether C is a whitespace character.

Package

url-rewrite

Source

primitives.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   U  
Index Entry  Section

F
File, Lisp, url-rewrite.asd: The url-rewrite<dot>asd file
File, Lisp, url-rewrite/packages.lisp: The url-rewrite/packages<dot>lisp file
File, Lisp, url-rewrite/primitives.lisp: The url-rewrite/primitives<dot>lisp file
File, Lisp, url-rewrite/specials.lisp: The url-rewrite/specials<dot>lisp file
File, Lisp, url-rewrite/url-rewrite.lisp: The url-rewrite/url-rewrite<dot>lisp file
File, Lisp, url-rewrite/util.lisp: The url-rewrite/util<dot>lisp file

L
Lisp File, url-rewrite.asd: The url-rewrite<dot>asd file
Lisp File, url-rewrite/packages.lisp: The url-rewrite/packages<dot>lisp file
Lisp File, url-rewrite/primitives.lisp: The url-rewrite/primitives<dot>lisp file
Lisp File, url-rewrite/specials.lisp: The url-rewrite/specials<dot>lisp file
Lisp File, url-rewrite/url-rewrite.lisp: The url-rewrite/url-rewrite<dot>lisp file
Lisp File, url-rewrite/util.lisp: The url-rewrite/util<dot>lisp file

U
url-rewrite.asd: The url-rewrite<dot>asd file
url-rewrite/packages.lisp: The url-rewrite/packages<dot>lisp file
url-rewrite/primitives.lisp: The url-rewrite/primitives<dot>lisp file
url-rewrite/specials.lisp: The url-rewrite/specials<dot>lisp file
url-rewrite/url-rewrite.lisp: The url-rewrite/url-rewrite<dot>lisp file
url-rewrite/util.lisp: The url-rewrite/util<dot>lisp file

Jump to:   F   L   U  

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

A.2 Functions

Jump to:   A   C   F   H   L   N   P   R   S   U   W  
Index Entry  Section

A
add-get-param-to-url: Exported functions

C
comment-start-p: Internal functions

F
Function, add-get-param-to-url: Exported functions
Function, comment-start-p: Internal functions
Function, hyperdoc-lookup: Internal functions
Function, letterp: Internal functions
Function, name-char-p: Internal functions
Function, peek-char*: Internal functions
Function, read-attribute: Internal functions
Function, read-delimited-string: Internal functions
Function, read-name: Internal functions
Function, read-until: Internal functions
Function, read-while: Internal functions
Function, rewrite-urls: Exported functions
Function, skip-comment: Internal functions
Function, skip-whitespace: Internal functions
Function, starts-with-scheme-p: Exported functions
Function, url-encode: Exported functions
Function, whitespacep: Internal functions

H
hyperdoc-lookup: Internal functions

L
letterp: Internal functions

N
name-char-p: Internal functions

P
peek-char*: Internal functions

R
read-attribute: Internal functions
read-delimited-string: Internal functions
read-name: Internal functions
read-until: Internal functions
read-while: Internal functions
rewrite-urls: Exported functions

S
skip-comment: Internal functions
skip-whitespace: Internal functions
starts-with-scheme-p: Exported functions

U
url-encode: Exported functions

W
whitespacep: Internal functions

Jump to:   A   C   F   H   L   N   P   R   S   U   W  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*find-string-hash*: Internal special variables
*hyperdoc-base-uri*: Internal special variables
*url-rewrite-base-directory*: Internal special variables
*url-rewrite-fill-tags*: Exported special variables
*url-rewrite-tags*: Exported special variables

S
Special Variable, *find-string-hash*: Internal special variables
Special Variable, *hyperdoc-base-uri*: Internal special variables
Special Variable, *url-rewrite-base-directory*: Internal special variables
Special Variable, *url-rewrite-fill-tags*: Exported special variables
Special Variable, *url-rewrite-tags*: Exported special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   P   S   U  
Index Entry  Section

P
Package, url-rewrite: The url-rewrite package

S
System, url-rewrite: The url-rewrite system

U
url-rewrite: The url-rewrite system
url-rewrite: The url-rewrite package

Jump to:   P   S   U