Fork me on GitHub
#reagent
<
2018-01-16
>
Casey17:01:39

anyone know of a solution for embedding an svg inline in the dom?

Casey17:01:07

such that I can dynamically manipulate it along with other components

mihaelkonjevic17:01:30

@ramblurr we usually convert it to hiccup and then treat it as any other reagent component

Casey17:01:48

hm yea that would work

Casey17:01:07

given a svg file in my resources/public, how would I convert it to hiccup?

Casey17:01:15

do you do that manually? at build time?

noisesmith18:01:29

there’s also a templating library called enlive that can take markup and return hiccup

noisesmith18:01:22

this was very useful when I collaborated with designers who didn’t want to learn a new syntax - enlive can ingest their normal markup (including svg) and produce a hiccup compatible form that you can then do arbitrary clojure data manipulations on

noisesmith18:01:05

I also found that enlive could simplify web scraping

kenrestivo22:01:33

i did a client project in 2013 that was all web scraping (a social media network, into datomic). it worked great.