Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the uri-template Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 15:25:12 2020 GMT+0.
• Introduction | What uri-template is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
uri-template is an implementation of the URI Template proposed standard draft version 01 (https://tools.ietf.org/html/draft-gregorio-uritemplate-01) as a reader macro, used for both creating and parsing 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. Example use: 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") Template desctructuring also binds several handy standard components to anaphoric variables: (uri-template-bind (#U{uri}) "https://user@www.foo.com:8080/dir/abc?bar=baz&xyz=1#hash" (list %uri-scheme => ("http" %uri-authority "user@www.foo.com:8080" %uri-user "user" %uri-host "www.foo.com" %uri-port "8080" %uri-path "/dir/abc" %uri-directory "/dir/" %uri-file "abc" %uri-query "bar=baz&xyz=1" %uri-fragment "hash" %uri-head "https://user@www.foo.com:8080" %uri-tail)) "/dir/abc?bar=baz&xyz=1#hash") More examples can be found in the uri-template-test.lisp file. uri-templates can be enabled by calling enable-uri-template-syntax, or by merging or using the uri-template:uri-template readtable via the named-readtables library: https://common-lisp.net/project/named-readtables/ Function reference: enable-uri-template-syntax (function) Binds the #U dispatch character to read a URI template. read-uri-template (function) A function suitable for inserting into the readtable so you can read URI templates from your own dispatch character. uri-decode? (special variable) Controls whether URI decoding/unescaping is done on the templated value when destructuring. True by default. uri-encode? (special variable) Controls whether URI encoding/escaping is done on the templated value. True by default. uri-decode (function) Decodes URI encoded/escaped characters in the given string. uri-encode (function) URI encodes/escapes the given string. uri-template (symbol) The car of the list that the URI template reader produces. A function or macro. This symbol also names the named-readtables readtable that provides the #U dispatch macro. uri-template-bind (macro) Binds URI template placeholders (which must be symbols) in given URI, as well as attempting to bind a set of standard URI components to their respective parts of the given URI. Body executes only if all explicitly specified URI template placeholders can be bound. uri-template works with Parenscript to provide template interpolation for JavaScript. To enable this functionality, load Parenscript before compiling uri-template (you might need to re-compile if you have previously loaded uri-template without first loading Parenscript). Note that destructuring is currently unsupported for Parenscript. For more information about uri-template, see the project homepage: https://common-lisp.net/project/uri-template/ The uri-template mailing list is: uri-template-devel@common-lisp.net Any questions, bug reports and patches are welcome. You can subscribe by visiting: https://mailman.common-lisp.net/listinfo/uri-template-devel The author, Vladimir Sedach, can be contacted at: vas@oneofus.la uri-template is distributed under the terms of the GNU Lesser General Public License, version 3 or any later version. See the files COPYING and COPYING.LESSER, included with the distribution, or https://www.gnu.org/licenses/
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The uri-template system |
Vladimir Sedach <vas@oneofus.la>
LGPL-3.0-or-later
An implementation of the URI Template proposed standard draft version 01.
An implementation of the URI Template proposed standard draft version 01.
Lets you easily create and parse URIs by using the URI Template reader macro syntax.
uri-template.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The uri-template.asd file | ||
• The uri-template/package.lisp file | ||
• The uri-template/uri-template.lisp file | ||
• The uri-template/destructure-uri.lisp file |
Next: The uri-template/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
uri-template.asd
uri-template (system)
Next: The uri-template/uri-template․lisp file, Previous: The uri-template․asd file, Up: Lisp files [Contents][Index]
uri-template (system)
package.lisp
Next: The uri-template/destructure-uri․lisp file, Previous: The uri-template/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
uri-template (system)
uri-template.lisp
Previous: The uri-template/uri-template․lisp file, Up: Lisp files [Contents][Index]
uri-template.lisp (file)
uri-template (system)
destructure-uri.lisp
weak-register-groups-bind (macro)
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The uri-template package |
package.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported macros | ||
• Exported functions |
Next: Exported macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Controls whether URI decoding/unescaping is done on the templated value when destructuring. True by default.
destructure-uri.lisp (file)
Controls whether URI encoding/escaping is done on the templated value. True by default.
uri-template.lisp (file)
Next: Exported functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Binds URI template placeholders (which must be symbols) in given
URI, as well as attempting to bind a set of standard URI components to
their respective parts of the given URI. Body executes only if all
explicitly specified URI template placeholders can be bound.
Given the example URI http://user@www.foo.com:8080/dir/abc?bar=baz&xyz=1#hash
The standard URI components look like:
%uri-scheme http
%uri-authority user@www.foo.com:8080
%uri-user user
%uri-host www.foo.com
%uri-port 8080
%uri-path /dir/abc
%uri-directory /dir/
%uri-file abc
%uri-query bar=baz&xyz=1
%uri-fragment hash
%uri-head http://user@www.foo.com:8080
%uri-tail /dir/abc?bar=baz&xyz=1#hash
destructure-uri.lisp (file)
Previous: Exported macros, Up: Exported definitions [Contents][Index]
Binds the #U dispatch character to read a URI template.
uri-template.lisp (file)
A function suitable for inserting into the readtable so you can read URI templates from your own dispatch character.
uri-template.lisp (file)
Decodes URI encoded/escaped characters in the given string.
destructure-uri.lisp (file)
URI encodes/escapes the given string.
uri-template.lisp (file)
The car of the list that the URI template reader produces. A
function or macro.
This symbol also names the named-readtables readtable that provides the #U dispatch macro.
uri-template.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal macros | ||
• Internal functions |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
uri-template.lisp (file)
destructure-uri.lisp (file)
Previous: Internal macros, Up: Internal definitions [Contents][Index]
uri-template.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L U |
---|
Jump to: | F L U |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | E F M R U W |
---|
Jump to: | E F M R U W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | S U |
---|
Jump to: | S U |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | P S U |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
P | |||
Package, uri-template : | The uri-template package | ||
| |||
S | |||
System, uri-template : | The uri-template system | ||
| |||
U | |||
uri-template : | The uri-template system | ||
uri-template : | The uri-template package | ||
|
Jump to: | P S U |
---|