This is the lowlight Reference Manual, version 0.99.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:54:29 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
lowlight
A simple and flexible syntax highlighter
Christoph Finkensiep <chfin@freenet.de>
MIT/X11
0.99.0
cl-ppcre
(system).
alexandria
(system).
spinneret
(system).
cl-who
(system).
graylex
(system).
yacc
(system).
package.lisp
(file).
common.lisp
(file).
simple.lisp
(file).
grammar.lisp
(file).
lowlight.lisp
(file).
style-lisp.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
lowlight/lowlight.asd
lowlight/package.lisp
lowlight/common.lisp
lowlight/simple.lisp
lowlight/grammar.lisp
lowlight/lowlight.lisp
lowlight/style-lisp.lisp
lowlight/common.lisp
package.lisp
(file).
lowlight
(system).
*debug*
(special variable).
*lexer-buffer-size*
(special variable).
style-classes
(generic function).
*styles*
(special variable).
get-style
(generic function).
process-style
(generic function).
style-name
(generic function).
lowlight/simple.lisp
common.lisp
(file).
lowlight
(system).
define-simple-style
(macro).
make-simple-style
(function).
style-classes
(method).
get-style
(method).
print-token
(function).
process-style
(method).
simple-style
(class).
style-name
(reader method).
style-rules
(reader method).
tokenize
(function).
lowlight/grammar.lisp
simple.lisp
(file).
lowlight
(system).
define-cfg-style
(macro).
make-cfg-style
(function).
*token-printer*
(special variable).
cfg-style
(class).
inject-ignorables
(function).
make-cfg-style%
(macro).
maprec
(function).
print-if
(function).
print-token*
(function).
process-style
(method).
rules-to-grammar
(function).
style-parser
(reader method).
tree-sub
(function).
lowlight/lowlight.lisp
grammar.lisp
(file).
lowlight
(system).
light
(function).
light-blocks
(function).
light-file
(function).
light-file-blocks
(function).
light-blocks%
(function).
light-blocks%*
(function).
make-blocks-regex
(function).
read-into-string
(function).
lowlight/style-lisp.lisp
lowlight.lisp
(file).
lowlight
(system).
*parser*
(special variable).
classify-symbol
(function).
print-define
(function).
print-setf-define
(function).
print-typedef
(function).
print-vardef
(function).
Packages are listed by definition order.
lowlight.1
lowlight
ll
ll1
common-lisp
.
*debug*
(special variable).
*lexer-buffer-size*
(special variable).
define-cfg-style
(macro).
define-simple-style
(macro).
light
(function).
light-blocks
(function).
light-file
(function).
light-file-blocks
(function).
make-cfg-style
(function).
make-simple-style
(function).
style-classes
(generic function).
*parser*
(special variable).
*styles*
(special variable).
*token-printer*
(special variable).
cfg-style
(class).
classify-symbol
(function).
get-style
(generic function).
inject-ignorables
(function).
light-blocks%
(function).
light-blocks%*
(function).
make-blocks-regex
(function).
make-cfg-style%
(macro).
maprec
(function).
print-define
(function).
print-if
(function).
print-setf-define
(function).
print-token
(function).
print-token*
(function).
print-typedef
(function).
print-vardef
(function).
process-style
(generic function).
read-into-string
(function).
rules-to-grammar
(function).
simple-style
(class).
style-name
(generic function).
style-parser
(generic reader).
style-rules
(generic reader).
tokenize
(function).
tree-sub
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
controls debug output (‘t‘ or ‘nil‘)
controlling knob for the graylex buffer size
Defines a cfg style with token rules ‘rules‘ and CFG productions ‘productions‘.
The resulting ‘cfg-style‘ object is registered under ‘name‘ which should be a keyword.
‘rules‘ is a list of token rules, each of the form ‘(regex class)‘,
where ‘regex‘ is either a string describing a regex or a list with such a string in ‘car‘.
In the latter case the string is taken as a control string for ‘format‘
and the rest of the list is given to it as arguments.
The result is then used as the regex.
‘class‘ can be a keyword or a function. If it is a function, it is called with the token
detected by ‘regex‘ and should return a keyword.
Rules may contain forms like ‘(:other-tokens ...)‘, each containing a list of keywords
that do not appear as a token keyword in other rules (e.g. ‘(:other-tokens :a :b :c)‘).
Those are added to the list of terminals for the production rules.
You should use this for token keywords that are generated by functions,
as described above.
‘productions‘ is a list of productions in cl-yacc syntax.
The productions may contain *one* form ‘(:toplevel ...)‘ containing a list of toplevel
non-terminals (e.g. ‘(:toplevel a b c)‘).
If no such form is given, all nontermials on the left-hand side of the given productions
will become toplevel.
Productions may also contain *one* form ‘(:ignore ...)‘ containing a list of ignorable tokens.
Those may occur at any positition (like whitespace and comments)
and are preserved, if all tokens are printed with ‘print-token*‘.
If no ‘:ignore‘ form is given, it defaults to ‘’(:default)‘.
Defines a simple style with the token rules ‘rules‘.
The resulting ‘simple-style‘ object is registered under ‘name‘ which should be a keyword.
‘rules‘ is a list of token rules, each of the form ‘(regex class)‘,
where ‘regex‘ is either a string describing a regex or a list with such a string in ‘car‘.
In the latter case the string is taken as a control string for ‘format‘
and the rest of the list is given to it as arguments.
The result is then used as the regex.
‘class‘ can be a keyword or a function. If it is a function, it is called with the token
detected by ‘regex‘ and should return a keyword.
=> a highlighted string or ‘t‘
Highlights ‘input‘ which can be either a stream or a string.
The used style is given by ‘style‘.
If ‘output‘ (a stream) is given, the result is printed on it,
otherwise the result is returned as a string.
=> a highlighted string or ‘t‘
Highlights all markdown code blocks in ‘input‘ with ‘style‘
and writes the result to ‘output‘ (or returns the result as a string,
if ‘output‘ is not given).
‘light-blocks‘ only hightlights blocks starting with a language name from ‘blocks‘ which defaults to the name of ‘style‘. So if you are using the style ‘:common-lisp‘ and want to highlight blocks starting with ‘ “‘common-lisp‘, then you may leave out ‘blocks‘. If you want blocks starting with ‘ “‘cl‘ to be highlighted as well, use ‘’(:common-lisp :cl)‘ for ‘blocks‘.
=> ‘t‘
Highlights the file given by ‘in‘.
The used style is denoted by ‘style‘.
If given, the result is written to the file ‘out‘,
otherwise ‘in‘ is used, with the file ending replaced by html.
If given, ‘css‘ is used as the href parameter to a css relation
and ‘title‘ is used as the page title.
If ‘raw‘ is ‘t‘ the highlighted code is *not* wrapped into a html skeleton.
=> ‘t‘
Highlights a file with ‘light-blocks‘.
‘in‘ denotes the input file, if ‘out‘ is given, it denotes the output file.
If not, ‘in‘ is used, with the file extension replaced by ‘.html‘,
so ‘foo.lisp‘ becomes ‘foo.html‘.
Be careful with files already ending on ‘.html‘ as they will not change.
=> a ‘cfg-style‘ object
Creates a new ‘cfg-style‘ with the name ‘name‘, the token rules ‘rules‘ and the
CFG productions ‘productions‘.
For the structure of ‘rules‘ and ‘productions‘ see ‘define-cfg-style‘.
=> a ‘simple-style‘ object
Creates a new ‘simple-style‘ with the name ‘name‘.
‘rules‘ is a list of token rules, each of the form described at ‘define-simple-style‘.
=> the set of token classes generated by ‘style‘
simple-style
)) ¶An alist mapping from style keywords to style definitions.
=> a list of productions
Takes a list of terminals, a list of ignorables, and a list of productions in cl-yacc syntax.
Transforms the productions to allow an arbitrary number of ignorables after each terminal.
highlight all blocks in input
=> a string containing the whole stream data from ‘in-stream‘ Taken from Alexandria’s ‘read-file-into-string.‘
=> an ignorable sensitive cl-yacc grammar
Takes style rules and productions and creates a cl-yacc grammar.
Rules may contain forms like ‘(:other-tokens ...)‘, each containing a list of keywords
that do not appear as a token keyword in other rules (e.g. ‘(:other-tokens :a :b :c)‘).
Those are added to the list of terminals for the production rules.
Productions may contain one form ‘(:toplevel ...)‘ containing a list of toplevel
non-terminals (e.g. ‘(:toplevel a b c)‘).
If no such form is given, all nontermials on the left-hand side of the given productions
will become toplevel.
Productions may also contain one form ‘(:ignore ...)‘ containing a list of ignorable tokens.
Those may occur at any positition and are preserved, if all tokens are printed with
‘print-token*‘.
If no ‘:ignore‘ form is given, it defaults to ‘’(:default)‘.
=> a style denoted by ‘style‘ being either a key or an actual style
simple-style
)) ¶simple-style
) input output) ¶Process a stream with a ‘simple-style‘.
=> the name of ‘style‘
simple-style
)) ¶automatically generated reader method
name
.
simple-style
)) ¶automatically generated reader method
:parser
This slot is read-only.
Jump to: | C D F G I L M P R S T |
---|
Jump to: | C D F G I L M P R S T |
---|
Jump to: | *
N P R S |
---|
Jump to: | *
N P R S |
---|
Jump to: | C F G L P S |
---|
Jump to: | C F G L P S |
---|