uri-template

Introduction

uri-template is a Common Lisp implementation of the URI Template proposed standard draft version 01 as a reader macro, used for both creating and parsing (destructuring) URIs.

Although uri-template does not implement the operators introduced in the 02 and later drafts of the URI Template standard, it does allow arbitrary Lisp expressions in template placeholders, which gives simpler and more powerful templates.

Examples

Template interpolation:

(let ((foo 1))
  #Uhttps://www.example.com/widget/{foo}/parts)
=> "https://www.example.com/widget/1/parts"

Template destructuring:

(uri-template-bind (#Uhttps://www.example.com/{part}/{number})
    "https://www.example.com/widget/1"
  (list part (parse-integer number) %uri-host))
=> ("widget" 1 "www.example.com")

Download

The latest version of uri-template is 1.3.1, release on 2019-08-01, and can be downloaded here. Older versions can be downloaded from the release directory.

uri-template is available via Quicklisp: (ql:quickload :uri-template)

Documentation

Documentation is provided in the README file included with the distribution.

Source repository

https://gitlab.common-lisp.net/uri-template/uri-template.git

Parenscript integration

uri-template works with Parenscript to provide template interpolation for JavaScript. To enable this functionality, load Parenscript before loading uri-template. Note that destructuring is currently unsupported for Parenscript.

Mailing list

uri-template-devel@common-lisp.net
Subscription information and mailing list archives are available at: https://mailman.common-lisp.net/listinfo/uri-template-devel

Contributing

Please send patches and bug reports to the mailing list: uri-template-devel@common-lisp.net

Authorship

uri-template is authored by Vladimir Sedach.

License

uri-template is distributed under the terms of GNU Lesser General Public License version 3 or any later version.