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 URIs.

Example use explains the concept best:

(let ((foo 1))
          #Uhttp://www.example.com/widget/{foo}/parts)

          => "http://www.example.com/widget/1/parts"

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

          => ("widget" 1 "www.example.com")
      

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.

Download

The latest version of uri-template is 1.3, 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/vsedach/uri-template

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://common-lisp.net/cgi-bin/mailman/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.