Skip to content

Instantly share code, notes, and snippets.

@jave
Created October 20, 2010 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jave/636376 to your computer and use it in GitHub Desktop.
Save jave/636376 to your computer and use it in GitHub Desktop.
how you use the original macro:
(defsvgtemplate overview3 "overview.svg" []
;;1 unit
[:#rect523] (replace-fill "grey")
[:#circle401] (replace-fill "grey")
[:#circle396] (replace-fill "grey")
[:#circle391] (replace-fill (get-hudson-job-state "mlm-trunk"))
[:#path235] (replace-fill "grey")
[:#text288] (net.cgrand.enlive-html/content "0")
[:#text294] (net.cgrand.enlive-html/content "0")
[:#text298] (net.cgrand.enlive-html/content "0")
;;2nd unit ...
)
this is a macro im trying to build:
(defmacro overview-unit [hudson-job deploy asm utst bld live tim cov loc]
`(
[~deploy] ~(replace-fill "grey")
[~asm] ~(replace-fill "grey")
[~utst] ~(replace-fill "grey")
[~bld] ~(replace-fill "grey");(get-hudson-job-state hudson-job))
[~live] ~(replace-fill "grey")
[~tim] ~(net.cgrand.enlive-html/content "0");;http://docs.codehaus.org/display/SONAR/Web+Service+API#WebServiceAPI-Metrics
[~cov] ~(net.cgrand.enlive-html/content "0")
[~loc] ~(net.cgrand.enlive-html/content "0")
))
and usage would be like this:
(defmacro mupp []
`(defsvgtemplate overview "overview.svg" []
~@(overview-unit "mlm-trunk" :#rect523 :#circle401 :#circle396 :#circle391 :#path235 :#text288 :#text294 :#text298))
; ~@(overview-unit "mln-trunk" :#rect536 :#circle428 :#circle423 :#circle418 :#path244 :#text962 :#text316 :#text320)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment