I just synced to the latest master and deftemplate has been broken. It
appears that Miekel added code to zip to make it more strict and that
is causing probs in enlive.
I started to look at the code, but decided to put it into more expert
hands. I am running the latest enlive code, but I don't think it much
matters since before I began to see the bug I was about six months
behind.
Let me know what you find or if I can do any more field work,
Thanks, Christophe. That did the trick and now autodoc is back on the
road.
Hey, do you have any performance tips for working with enlive? I
haven't focused to much on speed yet, but I need to and I'd love to
get a running start.
Indeed, enlive is an integral part of autodoc. Has been since the
google code -> github switch.
As I said, I haven't done any performance analysis yet, so I don't
even know the degree to which enlive is a bottleneck or other things
are. To this point, autodoc has run only on my system and it hasn't
really mattered if it takes 5 minutes to build the contrib docs, cause
it's running unattended (and no one's *that* cutting edge :-)).
I finally got the time to look at and understand your suggestions and
now I see why you're recommending them.
The one issue that came up, that I hadn't thought through fully
before, is that I am defining which file to use as the template at run
time (so that individual projects can optionally have their own. This
is doesn't work with deftemplate/defsnippet which define things at
read time (at least not without some tricky gams about making sure
that reading happens at the right time).
To get around this, I created my own version of deftemplate and a new
version of deftemplate that do the htnl-resource evaluation at runtime
and memoize the result. Otherwise I basically applied the patch you
gave me. Thanks!
If you want to comment on any of it, I'd certainly appreciate it.
Thanks,
Tom
I finally got the time to look at and understand your suggestions and
now I see why you're recommending them.
The one issue that came up, that I hadn't thought through fully
before, is that I am defining which file to use as the template at run
time (so that individual projects can optionally have their own. This
is doesn't work with deftemplate/defsnippet which define things at
read time (at least not without some tricky gams about making sure
that reading happens at the right time).
Right now, the program is invoked with a parameter directory argument
which includes a params.clj file to choose options and point to the
source and output directories, a templates/ subdirectory and
instructions (in the form of a build.xml) for doing any build on the
target project.
At run time, when we want to grab a template, say layout.html, we look
in the passed in param/templates directory to see if it has a
layout.html and, if so, we use that one. Otherwise, we take the
layout.html file from the autodoc source directory.
This will probably change a little as I make autodoc into more of a
library so it can be invoked from tools like leiningen. In particular,
I'll probably turn the default templates into resources in the jar
file so I can get everything packaged into a single jar.
Tom