URI Template(tools.ietf.org)
tools.ietf.org
URI Template
http://tools.ietf.org/html/rfc6570
10 comments
There's a mature Perl module for this as well: http://search.cpan.org/~bricas/URI-Template-0.17/lib/URI/Tem...
For rubyists, the addressable gem has support for it: https://github.com/sporkmonger/addressable/tree/#uri-templat...
And for Node.js:
https://github.com/bramstein/url-template
It's pretty great to have a standard for templates to generate URIs, but it's equally important to parse URIs and extract the variables. It looks like this RFC skimps on that part:
In Section 1.4:
In Section 1.4:
Some URI Templates can be used in reverse for the purpose of variable
matching: comparing the template to a fully formed URI in order to
extract the variable parts from that URI and assign them to the named
variables. Variable matching only works well if the template
expressions are delimited by the beginning or end of the URI or by
characters that cannot be part of the expansion, such as reserved
characters surrounding a simple string expression. In general,
regular expression languages are better suited for variable matching.
It'd be better IMO to have a stricter definition of parseable templates and include test cases so that implementations that try to validate templates for parseability don't disagree.GitHub uses URI templates extensively: https://api.github.com/
Very helpful, thanks for link. I'm working on my own web app "framework" and had rolled my own URL/URI router. This will reduce my reinvention quotient.
Ruby Gems for this
https://github.com/sporkmonger/addressable
Slightly related (if you hold your head at the right angle) is the (commercial) platform called NetKernel. It brings URIs into conventional programming scenarios, presenting something like a RESTful programming language. (Whatever that might mean...)
I haven't done anything with it, but I find it fascinating just to read the documentation:
http://docs.netkernel.org/book/view/book:quickstart/doc:quic...
I haven't done anything with it, but I find it fascinating just to read the documentation:
http://docs.netkernel.org/book/view/book:quickstart/doc:quic...
Why do RFC's have to be so ugly?
It's just a formating issue. Nothing prevent you to reformat them: http://pretty-rfc.herokuapp.com/RFC2616
This is very cool. Why is the RFC source not available and what does it take to get it?
The home page states:
Note: most RFCs can't be prettified at the moment, as their
source files are unavailable to the public and need to be
requested from rfc-editor.org. I'm working on this.
I suppose that it's just a matter of time.Because they originate from a time where plain text was what you had, and the format was created to be consistent and easy to format by hand. I still prefer my specifications to be in plain text so that I can view them easily and quickly.
It would be easy enough to at least format them in HTML, they use such consistent ascii 'typesetting', it could easily be automated.
I mean, they are formatted in HTML now, but as a giant block of monospace text. They could use <hx>s for the headers, let the text flow with browser resize for small screens, heck use bootstrap for good readable web typesetting, etc.
I am not sure why the IETF isn't interested in better web typesetting for em.
At one point someone had a site that did that, I think it was advertised and discussed here on HN, but I forget what it was called, and I think it faded into non-supported obscurity (since it was obviously a labor of love, unpaid).
I mean, they are formatted in HTML now, but as a giant block of monospace text. They could use <hx>s for the headers, let the text flow with browser resize for small screens, heck use bootstrap for good readable web typesetting, etc.
I am not sure why the IETF isn't interested in better web typesetting for em.
At one point someone had a site that did that, I think it was advertised and discussed here on HN, but I forget what it was called, and I think it faded into non-supported obscurity (since it was obviously a labor of love, unpaid).
I still prefer my everything in plaintext....
I really love them. This probably reveals my age...
Nope, I'm <25 and I love them too.
I think this[1] is to blame for it.
[1]: http://tools.ietf.org/tools/rfcmarkup/
[1]: http://tools.ietf.org/tools/rfcmarkup/
I wonder if it'd be worth implementing this in my URLObject library (https://github.com/zacharyvoase/urlobject).
http://tools.ietf.org/html/rfc6902