[Catalyst] Re: javascript in Catalyst using Template Toolkit
Kieren Diment
diment at gmail.com
Sat Dec 22 16:48:45 GMT 2007
On 23 Dec 2007, at 01:06, kevin montuori wrote:
>
> obCatalyst: let me add that if you use emacs :| you could define a
> little function like:
>
> (defun ii-insert-catalyst-url ()
> (interactive)
> (let ((path (read-from-minibuffer "URI: ")))
> (insert (format "<a href=\"[%% Catalyst.uri_for('%s') %%]\"></
> a>" path))
> (backward-char 4)))
>
> to do the work for you. if you're accustomed to using html-mode or
> sgml-mode you might even rebind C-c C-c h (html-href-anchor):
>
> (add-hook 'html-mode-hook
well tt-mode would be more sensible. Some people ought to be able
to write a little vi macro to do this too. I suspect that the macro
would be written in perl. Also most of the time we'duse c.uri_for
not Catalyst.uri_for
> '(lambda ()
> (define-key html-mode-map "\C-c\C-c\h" 'ii-insert-catalyst-url)))
>
> and there'd be no new finger memory to develop, so no extra work
> whatsoever.
>
This is axiomatic. Software sucks. You can a contribution to how
much your software sucks by taking that little bit of extra effort
and making the little bit of software that you're responsible for
suck less. Because if software sucks, good software sucks less.
HTH
More information about the Catalyst
mailing list