The ten Reference Manual

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

The ten Reference Manual

This is the ten Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed Jun 15 05:58:11 2022 GMT+0.

Table of Contents


1 Introduction

TEN

Build Status Quicklisp MIT License

Yet another template system for Common Lisp.

TEN is a fork of ECO template system by Fernando Borretti.

Like ECO, TEN compiles templates to Lisp code, but has some differences:

My reasons for writing yet another template system for Common Lisp is to combine the simplicity and usability of ECO (the whole Lisp language at your disposal for writing the templates), with features available in more complex template systems like Djula that makes things easier for web development (inheritance, dot syntax, etc.).

Usage

A TEN template looks like this:

{% template ex1 () (user enabled &key items) %}
<html>
  <head>
  </head>
  <body>

    {{ user.name | string-capitalize }}

    {% if enabled %}
    Enabled
    {% else %}
    Disabled
    {% end %}

    {% when items %}
    <ul>
      {% loop for item in items do %}
      <li>{{ item }}</li>
      {% end %}
    </ul>
    {% end %}

    {% when (not items) %}
    There are no items
    {% end %}    
  </body>
</html>
{% end %}

These are the types of tags:

Control tags control which parts of the tamplate are rendered; their return value is ignored.

The value returned by output tags are interpolated into the template. The function called can be any Lisp function, or another template (because templates are compiled to functions).

For example:

The if tag is a special case: it supports using an else tag to separate the true and false branches. For example:

{% if posts %}
  <h1>Recent Posts</h1>
  ... loop over posts ...
{% else %}
  No recent posts.
{% end %}

Also, more advanced control expressions are possible, like let, case, cond, etc.

Template definition

Templates are defined with the following syntax:

{% template name (&rest options) (&rest args) %}
  ... body ...
{% end %}

Template options are:

Template compilation

For manually compiling templates, use ten:compile-template function.

But more useful is to include them in the ASDF system definition of your project.

First, add :ten as ASDF system definition dependency:

:defsystem-depends-on (:ten)

Then, use :ten-template in to include the template files:

(:ten-template "filename")

The default file extension is "ten", but another can be specified via the :file-extension option; and the template package can be specified with the :package option. Look at ten.examples ASDF system for an example.

You can also compile all the templates in some directory using this ASDF recipe:

:perform (asdf:compile-op :after (o c)
               (dolist (template (uiop:directory-files (asdf:system-relative-pathname :my-app "templates/*.ten")))
               (uiop:symbol-call :ten 'compile-template template)))

Templates are compiled into functions and exported in the indicated package. The default package is ten-templates, but that can be changed from either the ASDF system definition, the ten:compile-template parameters, or the {% template %} options.

When developing your project it is useful to be able to compile templates in an interactive way. If you are using Emacs + SLIME, load ten.el file.

Then use M-X ten-compile-template when on the template buffer to compile templates. Note that you may want to have :package option specified in the template so that it gets compiled into the correct package.

For debugging, you can inspect the expanded template using ten:expand-template function. In Emacs, go to template buffer an do M-x ten-expand-template.

If you enable ten minor mode, template compilation gets conveniently bound to C-c C-c, and template expansion to C-c RET. Best is to automatically enable the minor mode for template files adding something like (add-hook 'web-mode-hook 'ten-mode) to your .emacs initialization file.

Inheritance

To make a template inherit from anohter, use the :extends option in template definition.

Templates are organized in sections. sections are the parts of the templates that are inherited.

Use {{super}} inside a section to render the parent section.

TEN leverages CLOS for implementing template inheritance. Templates are compiled to classes and generic functions render-template and render-section.

Have a look at some examples of template inheritance.

Includes

To include other templates, just use the output tag with the name of the included template. Remember that templates are compiled to functions; just call those functions from the template to include them.

Have a look at an example.

Dot syntax

When dot syntax is enabled (it is, by default), it is possible to conveniently access objects with dot syntax in templates:

{{ object.key1.key2 }}

that gets translated by access library to:

(access:accesses obj 'key1 'key2)

Have a look at an example.

Filters

TEN implements some convenient syntax for filters.

{{ value | func1 arg1 .. argN| func2 arg1 .. argN| .. | funcN arg1 .. argN}}

Filters are just normal functions that get applied to the value.

Filters are translated to functions application like this:

(funcN (.. (func2 (func1 value arg1 .. argN) arg1 .. argN))) arg1 .. argN)

In general, filter functions are expected to receive the value to be filtered as first parameter. But, for several Lisp functions that's not the case. In those cases, it is possible to use _ to indicate where the filter function should receive the value.

For example, string-trim receives the string to trim as second value, so, to apply it as filter we do:

{{str | string-trim '(#\%) _}}

Filters syntax is completly optional, you can disregard it and just apply functions instead:

{{ string-trim '(#\%) (string-capitalize str) }}

Have a look at some examples of filters.

Examples

Load and have a look at the examples.

(require :ten.examples)

Example templates get compiled and exported to ten/examples package.

Troubleshooting

  1. When specifying a template package other than ten-templates, if the package specified doesn't :use ten or ten-template packages, then you may run into problems trying to compile your templates. That may be because the template and section macros are not found in the specified package. In that case, make sure to prefix your template and section declarations with ten:, like:
{% ten:template my-template (:package my-package) %}
{% ten:section my-section %}
{% end %}
{% end %}
  1. Some "complex" expressions, like cond and case, require that you turn :output-whitespace to NIL. Otherwise, template compilation puts write-string expressions right in the middle of the case and cond bodies. Have a look at this template.

License

MIT


2 Systems

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


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

2.1 ten

Template System for Common Lisp

Author

Mariano Montone <marianomontone@gmail.com>

Home Page

https://github.com/mmontone/ten

License

MIT

Long Description

# TEN

[![Build Status](https://travis-ci.org/mmontone/ten.svg?branch=master)](https://travis-ci.org/mmontone/ten)
[![Quicklisp](http://quickdocs.org/badge/ten.svg)](http://quickdocs.org/ten/)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)

Yet another template system for Common Lisp.

TEN is a fork of [ECO template system](https://github.com/eudoxia0/eco) by Fernando Borretti.

Like ECO, TEN compiles templates to Lisp code, but has some differences:
- Two types of tags only. Control and output.
- Support for templates inheritance.
- Dot syntax for accessing template data.
- Convenient syntax for applying filters.
- Configurable syntax delimiters (planned, not done yet).

My reasons for writing yet another template system for Common Lisp is to combine the simplicity and usability of ECO (the whole Lisp language at your disposal for writing the templates), with features available in more complex template systems like [Djula](https://mmontone.github.io/djula/) that makes things easier for web development (inheritance, dot syntax, etc.).

## Usage

A TEN template looks like this:

“‘jinja
{% template ex1 () (user enabled &key items) %}
<html>
<head>
</head>
<body>

{{ user.name | string-capitalize }}

{% if enabled %}
Enabled
{% else %}
Disabled
{% end %}

{% when items %}
<ul>
{% loop for item in items do %}
<li>{{ item }}</li>
{% end %}
</ul>
{% end %}

{% when (not items) %}
There are no items
{% end %}
</body>
</html>
{% end %}

“‘

These are the types of tags:
- *Output tags*: ‘{{ <var> }}‘, becomes ‘<var>‘, and ‘{{ <fn> &rest args }}‘, that becomes ‘(fn arg1 arg2 .. argn)‘.
- *Control tags*: ‘{% <expr> %} body {% end %}‘, becomes ‘(<expr> body)‘.
- *Comments tags*: Use ‘{#‘ and ‘#}‘ to comment out a piece of template.

Control tags control which parts of the tamplate are rendered; their return value is ignored.

The value returned by output tags are interpolated into the template. The function called can be any
Lisp function, or another template (because templates are compiled to functions).

For example:

* ‘{{ user }}‘ => ‘user‘
* ‘{{ name user }}‘ => ‘(name user)‘
* ‘{% when (name user) %} ... {% end %}‘ => ‘(when (name user) ...)‘

The ‘if‘ tag is a special case: it supports using an ‘else‘ tag to separate the true and
false branches. For example:

“‘lisp
{% if posts %}
<h1>Recent Posts</h1>
... loop over posts ...
{% else %}
No recent posts.
{% end %}
“‘

Also, more [advanced control expressions](https://github.com/mmontone/ten/blob/master/examples/control.html) are possible, like ‘let‘, ‘case‘, ‘cond‘, etc.

## Template definition

Templates are defined with the following syntax:

“‘
{% template name (&rest options) (&rest args) %}
... body ...
{% end %}
“‘

Template options are:
- ‘:extends‘ : The template to extend from.
- ‘:dot-syntax‘: If T, templates are compiled with dot syntax enabled. Dot syntax is implemented via the Lisp library ‘access‘. Default is T.
- ‘:package‘: The package in which to compile and export the template. By default, templates are compiled and exported in ‘TEN-TEMPLATES‘ package.
- ‘:export‘: When T, export the generated template function. Otherwise, the template is not exported. Default is T.
- ‘:escape-html‘: Whether to escape html in output tags. Default is T.
- ‘:output-whitespace‘. Default is T. When NIL, expressions that just spit whitespace are discarded.

## Template compilation

For manually compiling templates, use ‘ten:compile-template‘ function.

But more useful is to include them in the ASDF system definition of your project.

First, add ‘:ten‘ as ASDF system definition dependency:

‘:defsystem-depends-on (:ten)‘

Then, use ‘:ten-template‘ in to include the template files:

“‘lisp
(:ten-template "filename")
“‘

The default file extension is "ten", but another can be specified via the ‘:file-extension‘ option; and the template package can be specified with the ‘:package‘ option. Look at [ten.examples ASDF system](https://github.com/mmontone/ten/blob/master/ten.examples.asd) for an example.

You can also compile all the templates in some directory using this ASDF recipe:

“‘lisp
:perform (asdf:compile-op :after (o c)
(dolist (template (uiop:directory-files (asdf:system-relative-pathname :my-app "templates/*.ten")))
(uiop:symbol-call :ten ’compile-template template)))
“‘

Templates are compiled into functions and exported in the indicated package. The default package is ‘ten-templates‘, but that can be changed from either the ASDF system definition, the ‘ten:compile-template‘ parameters, or the ‘{% template %}‘ options.

When developing your project it is useful to be able to compile templates in an interactive way.
If you are using Emacs + SLIME, load ‘ten.el‘ file.

Then use ‘M-X ten-compile-template‘ when on the template buffer to compile templates. Note that you may want to have ‘:package‘ option specified in the template so that it gets compiled into the correct package.

For debugging, you can inspect the expanded template using ‘ten:expand-template‘ function. In Emacs, go to template buffer an do ‘M-x ten-expand-template‘.

If you enable ‘ten‘ minor mode, template compilation gets conveniently bound to ‘C-c C-c‘, and template expansion to ‘C-c RET‘. Best is to automatically enable the minor mode for template files adding something like ‘(add-hook ’web-mode-hook ’ten-mode)‘ to your ‘.emacs‘ initialization file.

## Inheritance

To make a template inherit from anohter, use the ‘:extends‘ option in template definition.

Templates are organized in ‘sections‘. ‘sections‘ are the parts of the templates that are inherited.

Use ‘{{super}}‘ inside a ‘section‘ to render the parent ‘section‘.

TEN leverages CLOS for implementing template inheritance. Templates are compiled to classes and generic functions ‘render-template‘ and ‘render-section‘.

Have a look at some [examples of template inheritance](https://github.com/mmontone/ten/blob/master/examples/inheritance.html).

## Includes

To include other templates, just use the output tag with the name of the included template. Remember that templates are compiled to functions; just call those functions from the template to include them.

Have a look at [an example](https://github.com/mmontone/ten/blob/master/examples/include.html).

## Dot syntax

When dot syntax is enabled (it is, by default), it is possible to conveniently access objects with dot syntax in templates:

‘{{ object.key1.key2 }}‘

that gets translated by [access](https://github.com/AccelerationNet/access) library to:

‘(access:accesses obj ’key1 ’key2)‘

Have a look at [an example](https://github.com/mmontone/ten/blob/master/examples/dot-syntax.html).

## Filters

TEN implements some convenient syntax for filters.

‘{{ value | func1 arg1 .. argN| func2 arg1 .. argN| .. | funcN arg1 .. argN}}‘

Filters are just normal functions that get applied to the value.

Filters are translated to functions application like this:

‘(funcN (.. (func2 (func1 value arg1 .. argN) arg1 .. argN))) arg1 .. argN)‘

In general, filter functions are expected to receive the value to be filtered as first parameter.
But, for several Lisp functions that’s not the case. In those cases, it is possible to use ‘_‘ to indicate where the filter function should receive the value.

For example, ‘string-trim‘ receives the string to trim as second value, so, to apply it as filter we do:

‘{{str | string-trim ’(#\%) _}}‘

Filters syntax is completly optional, you can disregard it and just apply functions instead:

‘{{ string-trim ’(#\%) (string-capitalize str) }}‘

Have a look at some [examples of filters](https://github.com/mmontone/ten/tree/master/examples/filters.html).

## Examples

Load and have a look at the [examples](https://github.com/mmontone/ten/tree/master/examples).

“‘lisp
(require :ten.examples)
“‘

Example templates get compiled and exported to ‘ten/examples‘ package.

## Troubleshooting

1) When specifying a template package other than ‘ten-templates‘, if the package specified doesn’t ‘:use‘ ‘ten‘ or ‘ten-template‘ packages, then you may run into problems trying to compile your templates. That may be because the ‘template‘ and ‘section‘ macros are not found in the specified package. In that case, make sure to prefix your ‘template‘ and ‘section‘ declarations with ‘ten:‘, like:

“‘django
{% ten:template my-template (:package my-package) %}
{% ten:section my-section %}
{% end %}
{% end %}
“‘

2) Some "complex" expressions, like ‘cond‘ and ‘case‘, require that you turn ‘:output-whitespace‘ to ‘NIL‘. Otherwise, template compilation puts ‘write-string‘ expressions right in the middle of the ‘case‘ and ‘cond‘ bodies. Have a look at [this template](https://github.com/mmontone/ten/blob/master/examples/control.html).

## License

MIT

Version

0.0.1

Dependencies
  • access (system).
  • esrap (system).
  • cl-who (system).
  • split-sequence (system).
Source

ten.asd.

Child Components

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   [Contents][Index]

3.1.1 ten/ten.asd

Source

ten.asd.

Parent Component

ten (system).

ASDF Systems

ten.


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

3.1.2 ten/package.lisp

Source

ten.asd.

Parent Component

ten (system).

Packages

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

3.1.3 ten/parser.lisp

Dependency

package.lisp (file).

Source

ten.asd.

Parent Component

ten (system).

Public Interface
Internals

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

3.1.4 ten/template.lisp

Dependency

parser.lisp (file).

Source

ten.asd.

Parent Component

ten (system).

Public Interface
Internals

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

3.1.5 ten/compiler.lisp

Dependency

template.lisp (file).

Source

ten.asd.

Parent Component

ten (system).

Public Interface
Internals

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

3.1.6 ten/asdf.lisp

Dependency

compiler.lisp (file).

Source

ten.asd.

Parent Component

ten (system).


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

3.1.7 ten/i18n.lisp

Dependency

asdf.lisp (file).

Source

ten.asd.

Parent Component

ten (system).

Public Interface

_ (function).

Internals

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

3.1.8 ten/ten.lisp

Dependency

i18n.lisp (file).

Source

ten.asd.

Parent Component

ten (system).

Public Interface

4 Packages

Packages are listed by definition order.


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

4.1 ten-templates

Source

package.lisp.

Use List

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

4.2 ten

Source

package.lisp.

Use List

common-lisp.

Public Interface

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

4.3 ten/compiler

Source

package.lisp.

Use List
Public Interface
Internals

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

4.4 ten/parser

Source

package.lisp.

Use List
  • common-lisp.
  • esrap.
Used By List

ten/compiler.

Public Interface
Internals

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

4.5 ten/template

Source

package.lisp.

Use List

common-lisp.

Used By List
Public Interface
Internals

5 Definitions

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


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

5.1 Public Interface


5.1.1 Special variables

Special Variable: *create-stream-writing-functions*
Package

ten/template.

Source

template.lisp.

Special Variable: *create-string-writing-functions*
Package

ten/template.

Source

template.lisp.

Special Variable: *dot-syntax*
Package

ten/template.

Source

template.lisp.

Special Variable: *escape-html*
Package

ten/template.

Source

template.lisp.

Special Variable: *template-output*
Package

ten/template.

Source

template.lisp.

Special Variable: *template-package*

The package where template expressions are evaluated and the template function is exported

Package

ten/compiler.

Source

compiler.lisp.


5.1.2 Symbol macros

Symbol Macro: super
Package

ten/template.

Source

template.lisp.


5.1.3 Macros

Macro: begin-raw (&body body)
Package

ten/template.

Source

template.lisp.

Macro: begin-verb (&body body)
Package

ten/template.

Source

template.lisp.

Macro: begin-verbatim (&body body)
Package

ten/template.

Source

template.lisp.

Macro: comment (&body body)
Package

ten/template.

Source

template.lisp.

Macro: template (name (&key extends package escape-html export dot-syntax output-whitespace create-string-writing-function create-stream-writing-function) args &rest body)

The main template creation macro.

Arguments:

- EXTENDS: the name of the template to extend from.
- PACKAGE: the package within which the compiled template is to be defined.
- EXPORT: when T, the generated template function is exported.
- ESCAPE-HTML: whether to escape HTML or not. Default is controlled by *ESCAPE-HTML*, which is true by default.
- OUTPUT-WHITESPACE: whether to output whitespaces or not. Default is controlled by *OUTPUT-WHITESPACE*, which is true by default.
- CREATE-STRING-WRITING-FUNCTION: controls whether a function that writes the template to a string should be created. Default is T.
- CREATE-STREAM-WRITING-FUNCTION: controls whether a function that writes the template to *TEMPLATE-OUTPUT* stream should be created. Default is false.

IMPORTANT: some of this macro arguments are processed by CALL-WITH-TEMPLATE-HEADER-OPTIONS, not here. That’s why we declare some of them as ignored.

Package

ten/template.

Source

template.lisp.


5.1.4 Ordinary functions

Function: _ (string &rest args)
Package

ten/template.

Source

i18n.lisp.

Function: compile-template (string-or-pathname &optional package-name)

Compile a template. If a pathname is given, compiles the file content. Otherwise, compiles the given string.

Package

ten.

Source

ten.lisp.

Function: compile-template (elements &optional package-name)
Package

ten/compiler.

Source

compiler.lisp.

Function: esc (string)

Escape a string.

Package

ten/template.

Source

template.lisp.

Function: expand-template (string-or-pathname &optional package-name)

Expand a template to Lisp code. Useful for debugging.

Package

ten.

Source

ten.lisp.

Function: parse-template (string-or-pathname)
Package

ten/parser.

Source

parser.lisp.

Function: raw (str)
Package

ten/template.

Source

template.lisp.

Function: verb (str)
Package

ten/template.

Source

template.lisp.

Function: verbatim (str)
Package

ten/template.

Source

template.lisp.


5.1.5 Generic functions

Generic Reader: body (object)
Package

ten/parser.

Methods
Reader Method: body ((<control-tag> <control-tag>))

automatically generated reader method

Source

parser.lisp.

Target Slot

body.

Generic Reader: code (object)
Package

ten/parser.

Methods
Reader Method: code ((<control-tag> <control-tag>))

automatically generated reader method

Source

parser.lisp.

Target Slot

code.

Reader Method: code ((<output-tag> <output-tag>))

automatically generated reader method

Source

parser.lisp.

Target Slot

code.


5.1.6 Standalone methods

Method: print-object ((tag <output-tag>) stream)
Source

parser.lisp.

Method: print-object ((tag <control-tag>) stream)
Source

parser.lisp.


5.1.7 Classes

Class: <control-tag>
Package

ten/parser.

Source

parser.lisp.

Direct superclasses

<tag>.

Direct methods
Direct slots
Slot: code
Initargs

:code

Readers

code.

Writers

This slot is read-only.

Slot: body
Initargs

:body

Readers

body.

Writers

This slot is read-only.

Class: <else-tag>
Package

ten/parser.

Source

parser.lisp.

Direct superclasses

<tag>.

Class: <output-tag>
Package

ten/parser.

Source

parser.lisp.

Direct superclasses

<tag>.

Direct subclasses
Direct methods
Direct slots
Slot: code
Initargs

:code

Readers

code.

Writers

This slot is read-only.

Class: template
Package

ten/template.

Source

template.lisp.


5.2 Internals


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

5.2.1 Special variables

Special Variable: *compiling-template*
Package

ten/compiler.

Source

compiler.lisp.

Special Variable: *compiling-template*
Package

ten/template.

Source

template.lisp.

Special Variable: *current-language*
Package

ten/template.

Source

i18n.lisp.

Special Variable: *default-language*
Package

ten/template.

Source

i18n.lisp.

Special Variable: *export-template*

Export the templates by default

Package

ten/template.

Source

template.lisp.

Special Variable: *output-whitespace*
Package

ten/compiler.

Source

compiler.lisp.

Special Variable: *output-whitespace*
Package

ten/template.

Source

template.lisp.

Special Variable: *sections*
Package

ten/compiler.

Source

compiler.lisp.

Special Variable: *translation-backend*

The translation backend.

Package

ten/template.

Source

i18n.lisp.

Special Variable: *untranslated-messages*
Package

ten/template.

Source

i18n.lisp.

Special Variable: *warn-on-untranslated-messages*
Package

ten/template.

Source

i18n.lisp.

Special Variable: +end-control-delimiter+
Package

ten/parser.

Source

parser.lisp.

Special Variable: +end-output-delimiter+
Package

ten/parser.

Source

parser.lisp.

Special Variable: +start-comment-delimiter
Package

ten/parser.

Source

parser.lisp.

Special Variable: +start-control-delimiter+
Package

ten/parser.

Source

parser.lisp.

Special Variable: +start-output-delimiter+
Package

ten/parser.

Source

parser.lisp.

Special Variable: +stop-comment-delimiter
Package

ten/parser.

Source

parser.lisp.

Special Variable: +whitespace+
Package

ten/parser.

Source

parser.lisp.


5.2.2 Ordinary functions

Function: apply-filters (code filters)
Package

ten/compiler.

Source

compiler.lisp.

Function: call-with-template-header-options (header func)
Package

ten/compiler.

Source

compiler.lisp.

Function: control-element-p (element)
Package

ten/compiler.

Source

compiler.lisp.

Function: def-control-without-body (symbol)
Package

ten/parser.

Source

parser.lisp.

Function: else-tag-p (element)
Package

ten/compiler.

Source

compiler.lisp.

Function: extract-filters (string)
Package

ten/compiler.

Source

compiler.lisp.

Function: finish-template-compilation (template-name result)
Package

ten/compiler.

Source

compiler.lisp.

Function: format-translation (string &rest args)
Package

ten/template.

Source

i18n.lisp.

Function: lambda-list-slots (args)
Package

ten/template.

Source

template.lisp.

Function: parse-tokens (tokens)
Package

ten/parser.

Source

parser.lisp.

Function: read-template-expressions (string)
Package

ten/compiler.

Source

compiler.lisp.

Function: start-template-compilation (template-name)
Package

ten/compiler.

Source

compiler.lisp.

Function: stream-writing-function-name (name)
Package

ten/template.

Source

template.lisp.

Function: string-writing-function-name (name)
Package

ten/template.

Source

template.lisp.

Function: tokenize-template (string)
Package

ten/parser.

Source

parser.lisp.

Function: translate (string &optional args language backend)
Package

ten/template.

Source

i18n.lisp.

Function: trim-whitespace (str)
Package

ten/parser.

Source

parser.lisp.

Function: whitespacep (char)
Package

ten/parser.

Source

parser.lisp.


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

5.2.3 Generic functions

Generic Function: backend-translate (backend string language &rest args)
Package

ten/template.

Source

i18n.lisp.

Methods
Method: backend-translate ((backend null) string language &rest args)
Method: backend-translate (backend string language &rest args)
Generic Function: emit (str)
Package

ten/compiler.

Methods
Method: emit ((tag <control-tag>))
Source

compiler.lisp.

Method: emit ((tag <output-tag>))
Source

compiler.lisp.

Method: emit ((vec vector))
Source

compiler.lisp.

Method: emit ((str string))
Source

compiler.lisp.

Generic Function: render-section (section-name template stream)
Package

ten/compiler.

Source

compiler.lisp.

Generic Function: render-template (template stream)
Package

ten/template.

Source

template.lisp.


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

5.2.4 Classes

Class: <end-tag>
Package

ten/parser.

Source

parser.lisp.

Direct superclasses

<tag>.

Class: <fcall-tag>
Package

ten/parser.

Source

parser.lisp.

Direct superclasses

<output-tag>.

Class: <tag>
Package

ten/parser.

Source

parser.lisp.

Direct subclasses
Class: <var-tag>
Package

ten/parser.

Source

parser.lisp.

Direct superclasses

<output-tag>.


Appendix A Indexes


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

A.1 Concepts


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

A.2 Functions

Jump to:   _  
A   B   C   D   E   F   G   L   M   P   R   S   T   V   W  
Index Entry  Section

_
_: Public ordinary functions

A
apply-filters: Private ordinary functions

B
backend-translate: Private generic functions
backend-translate: Private generic functions
backend-translate: Private generic functions
begin-raw: Public macros
begin-verb: Public macros
begin-verbatim: Public macros
body: Public generic functions
body: Public generic functions

C
call-with-template-header-options: Private ordinary functions
code: Public generic functions
code: Public generic functions
code: Public generic functions
comment: Public macros
compile-template: Public ordinary functions
compile-template: Public ordinary functions
control-element-p: Private ordinary functions

D
def-control-without-body: Private ordinary functions

E
else-tag-p: Private ordinary functions
emit: Private generic functions
emit: Private generic functions
emit: Private generic functions
emit: Private generic functions
emit: Private generic functions
esc: Public ordinary functions
expand-template: Public ordinary functions
extract-filters: Private ordinary functions

F
finish-template-compilation: Private ordinary functions
format-translation: Private ordinary functions
Function, apply-filters: Private ordinary functions
Function, call-with-template-header-options: Private ordinary functions
Function, compile-template: Public ordinary functions
Function, compile-template: Public ordinary functions
Function, control-element-p: Private ordinary functions
Function, def-control-without-body: Private ordinary functions
Function, else-tag-p: Private ordinary functions
Function, esc: Public ordinary functions
Function, expand-template: Public ordinary functions
Function, extract-filters: Private ordinary functions
Function, finish-template-compilation: Private ordinary functions
Function, format-translation: Private ordinary functions
Function, lambda-list-slots: Private ordinary functions
Function, parse-template: Public ordinary functions
Function, parse-tokens: Private ordinary functions
Function, raw: Public ordinary functions
Function, read-template-expressions: Private ordinary functions
Function, start-template-compilation: Private ordinary functions
Function, stream-writing-function-name: Private ordinary functions
Function, string-writing-function-name: Private ordinary functions
Function, tokenize-template: Private ordinary functions
Function, translate: Private ordinary functions
Function, trim-whitespace: Private ordinary functions
Function, verb: Public ordinary functions
Function, verbatim: Public ordinary functions
Function, whitespacep: Private ordinary functions
Function, _: Public ordinary functions

G
Generic Function, backend-translate: Private generic functions
Generic Function, body: Public generic functions
Generic Function, code: Public generic functions
Generic Function, emit: Private generic functions
Generic Function, render-section: Private generic functions
Generic Function, render-template: Private generic functions

L
lambda-list-slots: Private ordinary functions

M
Macro, begin-raw: Public macros
Macro, begin-verb: Public macros
Macro, begin-verbatim: Public macros
Macro, comment: Public macros
Macro, template: Public macros
Method, backend-translate: Private generic functions
Method, backend-translate: Private generic functions
Method, body: Public generic functions
Method, code: Public generic functions
Method, code: Public generic functions
Method, emit: Private generic functions
Method, emit: Private generic functions
Method, emit: Private generic functions
Method, emit: Private generic functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods

P
parse-template: Public ordinary functions
parse-tokens: Private ordinary functions
print-object: Public standalone methods
print-object: Public standalone methods

R
raw: Public ordinary functions
read-template-expressions: Private ordinary functions
render-section: Private generic functions
render-template: Private generic functions

S
start-template-compilation: Private ordinary functions
stream-writing-function-name: Private ordinary functions
string-writing-function-name: Private ordinary functions

T
template: Public macros
tokenize-template: Private ordinary functions
translate: Private ordinary functions
trim-whitespace: Private ordinary functions

V
verb: Public ordinary functions
verbatim: Public ordinary functions

W
whitespacep: Private ordinary functions

Jump to:   _  
A   B   C   D   E   F   G   L   M   P   R   S   T   V   W  

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

A.3 Variables

Jump to:   *   +  
B   C   S  
Index Entry  Section

*
*compiling-template*: Private special variables
*compiling-template*: Private special variables
*create-stream-writing-functions*: Public special variables
*create-string-writing-functions*: Public special variables
*current-language*: Private special variables
*default-language*: Private special variables
*dot-syntax*: Public special variables
*escape-html*: Public special variables
*export-template*: Private special variables
*output-whitespace*: Private special variables
*output-whitespace*: Private special variables
*sections*: Private special variables
*template-output*: Public special variables
*template-package*: Public special variables
*translation-backend*: Private special variables
*untranslated-messages*: Private special variables
*warn-on-untranslated-messages*: Private special variables

+
+end-control-delimiter+: Private special variables
+end-output-delimiter+: Private special variables
+start-comment-delimiter: Private special variables
+start-control-delimiter+: Private special variables
+start-output-delimiter+: Private special variables
+stop-comment-delimiter: Private special variables
+whitespace+: Private special variables

B
body: Public classes

C
code: Public classes
code: Public classes

S
Slot, body: Public classes
Slot, code: Public classes
Slot, code: Public classes
Special Variable, *compiling-template*: Private special variables
Special Variable, *compiling-template*: Private special variables
Special Variable, *create-stream-writing-functions*: Public special variables
Special Variable, *create-string-writing-functions*: Public special variables
Special Variable, *current-language*: Private special variables
Special Variable, *default-language*: Private special variables
Special Variable, *dot-syntax*: Public special variables
Special Variable, *escape-html*: Public special variables
Special Variable, *export-template*: Private special variables
Special Variable, *output-whitespace*: Private special variables
Special Variable, *output-whitespace*: Private special variables
Special Variable, *sections*: Private special variables
Special Variable, *template-output*: Public special variables
Special Variable, *template-package*: Public special variables
Special Variable, *translation-backend*: Private special variables
Special Variable, *untranslated-messages*: Private special variables
Special Variable, *warn-on-untranslated-messages*: Private special variables
Special Variable, +end-control-delimiter+: Private special variables
Special Variable, +end-output-delimiter+: Private special variables
Special Variable, +start-comment-delimiter: Private special variables
Special Variable, +start-control-delimiter+: Private special variables
Special Variable, +start-output-delimiter+: Private special variables
Special Variable, +stop-comment-delimiter: Private special variables
Special Variable, +whitespace+: Private special variables
super: Public symbol macros
Symbol Macro, super: Public symbol macros

Jump to:   *   +  
B   C   S  

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

A.4 Data types

Jump to:   <  
A   C   F   I   P   S   T  
Index Entry  Section

<
<control-tag>: Public classes
<else-tag>: Public classes
<end-tag>: Private classes
<fcall-tag>: Private classes
<output-tag>: Public classes
<tag>: Private classes
<var-tag>: Private classes

A
asdf.lisp: The ten/asdf․lisp file

C
Class, <control-tag>: Public classes
Class, <else-tag>: Public classes
Class, <end-tag>: Private classes
Class, <fcall-tag>: Private classes
Class, <output-tag>: Public classes
Class, <tag>: Private classes
Class, <var-tag>: Private classes
Class, template: Public classes
compiler.lisp: The ten/compiler․lisp file

F
File, asdf.lisp: The ten/asdf․lisp file
File, compiler.lisp: The ten/compiler․lisp file
File, i18n.lisp: The ten/i18n․lisp file
File, package.lisp: The ten/package․lisp file
File, parser.lisp: The ten/parser․lisp file
File, template.lisp: The ten/template․lisp file
File, ten.asd: The ten/ten․asd file
File, ten.lisp: The ten/ten․lisp file

I
i18n.lisp: The ten/i18n․lisp file

P
Package, ten: The ten package
Package, ten-templates: The ten-templates package
Package, ten/compiler: The ten/compiler package
Package, ten/parser: The ten/parser package
Package, ten/template: The ten/template package
package.lisp: The ten/package․lisp file
parser.lisp: The ten/parser․lisp file

S
System, ten: The ten system

T
template: Public classes
template.lisp: The ten/template․lisp file
ten: The ten system
ten: The ten package
ten-templates: The ten-templates package
ten.asd: The ten/ten․asd file
ten.lisp: The ten/ten․lisp file
ten/compiler: The ten/compiler package
ten/parser: The ten/parser package
ten/template: The ten/template package

Jump to:   <  
A   C   F   I   P   S   T