Profilo di agentzhHuman & MachineFotoBlogElenchiAltro ![]() | Guida |
|
28 settembre Now we have Actions!On behalf of the OpenResty team, I'm happy to announce that OpenResty 0.5.0 has been released to CPAN, which means OpenResty has hit its 5th milestone indicated by a working Action API. Special thanks go to chaoslawful++ for acting as the pumpkin of the Action branch. It's worth mentioning that the hardest part of the Action handler, i.e., the RestyScript language compiler, is written in Haskell. I've found Acitons very useful in grouping together concurrent AJAX requests, which will make webpages load much faster. Our blog sites are already taking full advantage of this trick: http://blog.agentzh.org Also, Actions ensure cascaded requests run in exactly the expected order and the REST interfaces are called (mostly) in the expected way (e.g. from the end users' web browser). There used to be a serious security hole in the above blog sites in past because I had to expose PUT /=/model/Post/~/~ to the Public role for updating the "comments" field in the Post model before we have Actions. The main server for OpenResty, api.openresty.org, has already been upgraded to 0.5.0. If you want to play with OpenResty directly on our servers, feel free to write to me (agentzh at yahoo dot cn) and get an account for free! Enjoy! pod2html.js: Some JavaScript love for POD in a browserIt's fun to do POD (Plain Old Documentation) in a web browser and I've hacked up a JavaScript implementation for the pod2html utility (actually the output is more like Pod::Simple::HTML). The pod2html.js script is in OpenResty's SVN repository: http://svn.openfoundry.org/openapi/trunk/demo/Onccf/js/pod2html.js The API is straightforward, for instance, var pod = "=head1 Blah\n\nI<Hello>, C<world>!\n"; var html = pod2html(pod); The following web site is already making use of it: http://agentzh.org/misc/onccf/out/ By sniffing the background AJAX requests (e.g. using Firebug), you can see raw POD is retrieved from the OpenResty server and converted to HTML on-the-fly in your browser. It's worth mentioning that I had a lot of fun combining Test::Base and JavaScript::SpiderMonkey to test this piece of JavaScript code in pure Perl. You can checkout the test script here: http://svn.openfoundry.org/openapi/trunk/demo/Onccf/t/01-pod2html.t By looking at the (declarative) test cases, it's trivial to see what it can do (and hopefully what it can't) :) In record, as of this writing, the following POD directives are supported: =headN, =over, =item *, =item NUM., =item TEXT, =back, =begin html, =end html, =begin ANY, =end ANY, =cut (it's a no-op), =encoding ANY (it's a no-op) and the following POD markups are implemented: C<...>, I<...>, B<...>, L<...>, F<...> I've also implemented the (non-standard) =image directive for convenience. For example, =image gate.jpg will be converted to <p><img src="gate.jpg"/></p> Have fun! 17 settembre My slides for the upcoming OpenResty talk at YAPC::Beijing 2008I've finished the first draft of my slides for my OpenResty talk at the upcoming YAPC::Beijing session:
http://agentzh.org/misc/openresty-yes/openresty-yes.xul (Firefox only) A pdf (but less pretty) version could also be found here: http://agentzh.org/misc/openresty-yes.pdf I've already given this talk to my colleagues on the company level and it was a big success :) Feedback, comments, or even nit-picking will be highly appreciated. P.S. I'm still wondering what to talk for the other presentation. Jemplate? XUL::App? Or Test::Base? |
|
|