The url-rewrite Reference Manual

This is the url-rewrite Reference Manual, version 0.1.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 07:01:53 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 url-rewrite

Version

0.1.1

Source

url-rewrite.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 url-rewrite/url-rewrite.asd

Source

url-rewrite.asd.

Parent Component

url-rewrite (system).

ASDF Systems

url-rewrite.


3.1.2 url-rewrite/packages.lisp

Source

url-rewrite.asd.

Parent Component

url-rewrite (system).

Packages

url-rewrite.


3.1.3 url-rewrite/specials.lisp

Dependency

packages.lisp (file).

Source

url-rewrite.asd.

Parent Component

url-rewrite (system).

Public Interface
Internals

3.1.4 url-rewrite/primitives.lisp

Dependency

specials.lisp (file).

Source

url-rewrite.asd.

Parent Component

url-rewrite (system).

Internals

3.1.5 url-rewrite/util.lisp

Dependency

primitives.lisp (file).

Source

url-rewrite.asd.

Parent Component

url-rewrite (system).

Internals

3.1.6 url-rewrite/url-rewrite.lisp

Dependency

util.lisp (file).

Source

url-rewrite.asd.

Parent Component

url-rewrite (system).

Public Interface

4 Packages

Packages are listed by definition order.


4.1 url-rewrite

Source

packages.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


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.

Special Variable: *url-rewrite-tags*

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

Package

url-rewrite.

Source

specials.lisp.


5.1.2 Ordinary 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.

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.

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.

Function: url-encode (string)

URL-encode a string.

Package

url-rewrite.

Source

url-rewrite.lisp.


5.2 Internals


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.

Special Variable: *hyperdoc-base-uri*
Package

url-rewrite.

Source

specials.lisp.

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

url-rewrite.

Source

specials.lisp.


5.2.2 Ordinary 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.

Function: hyperdoc-lookup (symbol type)
Package

url-rewrite.

Source

specials.lisp.

Function: letterp (c)

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

Package

url-rewrite.

Source

primitives.lisp.

Function: name-char-p (c)

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

Package

url-rewrite.

Source

primitives.lisp.

Function: peek-char* ()

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

Package

url-rewrite.

Source

primitives.lisp.

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.

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.

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.

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.

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.

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.

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.

Function: whitespacep (c)

Checks whether C is a whitespace character.

Package

url-rewrite.

Source

primitives.lisp.


Appendix A Indexes


A.1 Concepts


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: Public ordinary functions

C
comment-start-p: Private ordinary functions

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

H
hyperdoc-lookup: Private ordinary functions

L
letterp: Private ordinary functions

N
name-char-p: Private ordinary functions

P
peek-char*: Private ordinary functions

R
read-attribute: Private ordinary functions
read-delimited-string: Private ordinary functions
read-name: Private ordinary functions
read-until: Private ordinary functions
read-while: Private ordinary functions
rewrite-urls: Public ordinary functions

S
skip-comment: Private ordinary functions
skip-whitespace: Private ordinary functions
starts-with-scheme-p: Public ordinary functions

U
url-encode: Public ordinary functions

W
whitespacep: Private ordinary functions