The json-template Reference Manual

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

The json-template Reference Manual

This is the json-template Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:45:08 2022 GMT+0.

Table of Contents


1 Introduction

JSON Template for Common Lisp

Summary

An implementation of JSON Template in Common Lisp.

Implementation Features

Missing Things

Examples

JSON-TEMPLATE> (defparameter *tmpl* (parse-template-string "
<h1>{title|html}</h1>
{.section people}
<ul>
{.repeated section @}
  <li>{name} ({age} years)</li>
{.end}
</ul>
{.or}
<p>No one's registered.</p>
{.end}"))
*TMPL*
JSON-TEMPLATE> (expand-template *tmpl*
                                '(:title "<Registered People>"
                                  :people ((:name "Nathalie" :age 24)
                                           (:name "Heinrich" :age 28)
                                           (:name "Hans"     :age 25))))
"
<h1>&#60;Registered People&#62;</h1>
<ul>
  <li>Nathalie (24 years)</li>
  <li>Heinrich (28 years)</li>
  <li>Hans (25 years)</li>
</ul>
"
JSON-TEMPLATE> (expand-template *tmpl*
                                '(:title "<Registered People>"
                                  :people ()))
"
<h1>&#60;Registered People&#62;</h1>
<p>No one's registered.</p>
"

2 Systems

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


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

2.1 json-template

An implementation of a subset of the JSON Template language.

Author

Matthias Andreas Benkard

License

Apache License, version 2.0

Version

0.1.0

Source

json-template.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


3.1.1 json-template/json-template.asd

Source

json-template.asd.

Parent Component

json-template (system).

ASDF Systems

json-template.


3.1.2 json-template/json-template.lisp

Source

json-template.asd.

Parent Component

json-template (system).

Packages

json-template.

Public Interface
Internals

3.1.3 json-template/formatters.lisp

Dependency

json-template.lisp (file).

Source

json-template.asd.

Parent Component

json-template (system).

Public Interface

*template-formatters* (special variable).

Internals

4 Packages

Packages are listed by definition order.


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

4.1 json-template

Source

json-template.lisp.

Use List

common-lisp.

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: *template-formatters*
Package

json-template.

Source

formatters.lisp.


5.1.2 Ordinary functions

Function: expand-template (template context)
Package

json-template.

Source

json-template.lisp.

Function: parse-template-string (string)
Package

json-template.

Source

json-template.lisp.


5.2 Internals


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

5.2.1 Constants

Constant: +not-found+
Package

json-template.

Source

json-template.lisp.


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

5.2.2 Ordinary functions

Function: escape-for-uri (string)
Package

json-template.

Source

formatters.lisp.

Function: expand-template-to-stream (template contexts stream)
Package

json-template.

Source

json-template.lisp.

Function: expand-things-to-stream (template contexts stream)
Package

json-template.

Source

json-template.lisp.

Function: getcontext (context key)
Package

json-template.

Source

json-template.lisp.

Function: listify-key (key &optional start)
Package

json-template.

Source

json-template.lisp.

Function: lookup-context (contexts key)
Package

json-template.

Source

json-template.lisp.

Function: make-escaper (replacements)
Package

json-template.

Source

formatters.lisp.

Function: parse-directive (string)
Package

json-template.

Source

json-template.lisp.

Function: parse-raw-tokens (tokens)
Package

json-template.

Source

json-template.lisp.

Function: parse-token (token)
Package

json-template.

Source

json-template.lisp.

Function: parse-tokens (tokens)
Package

json-template.

Source

json-template.lisp.

Function: parse-variable (string)
Package

json-template.

Source

json-template.lisp.

Function: tokenize-template-string (string)
Package

json-template.

Source

json-template.lisp.


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

5.2.3 Generic functions

Generic Reader: template-things (object)
Package

json-template.

Methods
Reader Method: template-things ((template template))

automatically generated reader method

Source

json-template.lisp.

Target Slot

things.

Generic Writer: (setf template-things) (object)
Package

json-template.

Methods
Writer Method: (setf template-things) ((template template))

automatically generated writer method

Source

json-template.lisp.

Target Slot

things.


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

5.2.4 Classes

Class: template
Package

json-template.

Source

json-template.lisp.

Direct methods
Direct slots
Slot: things
Initargs

:things

Readers

template-things.

Writers

(setf template-things).


Appendix A Indexes


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

A.1 Concepts


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

A.2 Functions

Jump to:   (  
E   F   G   L   M   P   T  
Index Entry  Section

(
(setf template-things): Private generic functions
(setf template-things): Private generic functions

E
escape-for-uri: Private ordinary functions
expand-template: Public ordinary functions
expand-template-to-stream: Private ordinary functions
expand-things-to-stream: Private ordinary functions

F
Function, escape-for-uri: Private ordinary functions
Function, expand-template: Public ordinary functions
Function, expand-template-to-stream: Private ordinary functions
Function, expand-things-to-stream: Private ordinary functions
Function, getcontext: Private ordinary functions
Function, listify-key: Private ordinary functions
Function, lookup-context: Private ordinary functions
Function, make-escaper: Private ordinary functions
Function, parse-directive: Private ordinary functions
Function, parse-raw-tokens: Private ordinary functions
Function, parse-template-string: Public ordinary functions
Function, parse-token: Private ordinary functions
Function, parse-tokens: Private ordinary functions
Function, parse-variable: Private ordinary functions
Function, tokenize-template-string: Private ordinary functions

G
Generic Function, (setf template-things): Private generic functions
Generic Function, template-things: Private generic functions
getcontext: Private ordinary functions

L
listify-key: Private ordinary functions
lookup-context: Private ordinary functions

M
make-escaper: Private ordinary functions
Method, (setf template-things): Private generic functions
Method, template-things: Private generic functions

P
parse-directive: Private ordinary functions
parse-raw-tokens: Private ordinary functions
parse-template-string: Public ordinary functions
parse-token: Private ordinary functions
parse-tokens: Private ordinary functions
parse-variable: Private ordinary functions

T
template-things: Private generic functions
template-things: Private generic functions
tokenize-template-string: Private ordinary functions

Jump to:   (  
E   F   G   L   M   P   T