Questions tagged [enlive]

Enlive is a Clojure library for HTML/XML extraction, transformation, and templating.

Enlive is a Clojure library for HTML/XML extraction and transformation.

Links:

89 questions
3
votes
1 answer

How to scrape data from specified tag with Enlive?

could someone explain me how to scrape content from tags where the has content value (actually in this case I need content of tag for matching operation) "Row1 title", but without scraping tag (or any of its content) in process?…
Мitke
  • 310
  • 3
  • 17
3
votes
2 answers

combine multiple html fragment files with enlive, clojure

I have multiple html files, which is to be combined into a single html file. Those multiple files are like header, footer, etc, which are common to multiple files. I'm using enlive's html-resource method. but, that method inserting missing html tags…
Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
3
votes
0 answers

parsing HTML5 with Enlive/Tagsoup/JSoup

HTML5 allows tags to appear in the body, but Enlive does not seem to support this: (deftest test-enlive (testing "enlive" (let [html-as-string "
the…
George Armhold
  • 30,824
  • 50
  • 153
  • 232
3
votes
2 answers

Enlive template auto-reload / detect changes in a Pedestal service

I am using the autoreload-server example which is working great for reloading namespaces on changes to the .clj files using ns-tracker. https://github.com/pedestal/samples/blob/master/auto-reload-server/dev/dev.clj However, it is not picking up…
Tony
  • 2,037
  • 3
  • 22
  • 22
3
votes
1 answer

Variable HTML template in Enlive

I'm trying to find an 'Enlivonic' way of defining a function that will perform a transformation on a parameterised html template. In other words, how do I define something like a defsnippet that also takes the template as an argument? I looked at…
Mebster
  • 33
  • 4
3
votes
2 answers

Append to an attribute in Enlive

Is it possible to append a value to an attribute using enlive? example: I have this edit and would like this edit I am currently doing this: (html/defsnippet foo "views/foo.html" [:#main] …
Xian
  • 76,121
  • 12
  • 43
  • 49
3
votes
1 answer

how to reload the template when working with enlive without restar

I am using enlive for my web development. I start my ring server in repl using (serve my-app/handler) However when I make changes to any of my html templates I have to restart my repl for the changes to show up. How do I reload my markup without…
murtaza52
  • 46,887
  • 28
  • 84
  • 120
2
votes
4 answers

Enlive templates – add to head section

Some pages of my app will have it's own js/css includes, so I wonder how I can add these resources to the head section of an html document with Enlive. I found "append" transformer, but there is no "html-append" without auto escaping. Or what a…
Dmitry Stropalov
  • 790
  • 6
  • 14
2
votes
2 answers

Rescraping data with Enlive

I tried to create function to scrape and tags from HTML page, whose URL I provide to a function, and this works as it should. I get sequence of

and elements, when I try to use select function to extract only table or h3 tags from…
Мitke
  • 310
  • 3
  • 17
2
votes
1 answer

How set a table row's attribute class dynamically with clojure/enlive?

I have created a table using enlive template engine. what I have done, is create a singe table row and repeated that row up to the no of row needed dynamically. But, I have some problems update the each row's attribute class. How can I set the class…
Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
2
votes
2 answers

How to generate arguments of a Clojure macro dynamically?

I am currently developing a small CMS using the wonderful Enlive as templating engine. Enlive has a macro called at that takes a node (a map) specifying the HTML snippet and an arbitrary number of tuples each consisting of a selector (a vector) and…
Jochen Rau
  • 390
  • 1
  • 6
2
votes
2 answers

How can I reduce the duplication in the Clojure code below?

I have the following Clojure code with a render function which renders a html page using enlive-html. Depending on the selected language a different html template is used. As you can see, there is a lot of code duplication and I would like to remove…
vidi
  • 2,056
  • 16
  • 34
2
votes
1 answer

how to parse result from httpclient in enlive

In the following link https://github.com/swannodette/enlive-tutorial/blob/master/src/tutorial/scrape1.clj it shows how to parse the page from a URL, but I need to use a sock5 proxy, and I can't figure out how to use proxy inside enlive, but I know…
Daniel Wu
  • 5,853
  • 12
  • 42
  • 93
2
votes
2 answers

Clojure: partly change an attribute value in Enlive

I have this test.html file that contains:
content
A want to define a template that changes only a part of an html attr value: (deftemplate test "public/templates/test.html" [] [:.clj-test]…
leontalbot
  • 2,513
  • 1
  • 23
  • 32
2
votes
1 answer

enlive: smashing vectors of nodes together

So I have finally realized that I can use selectors to limit the portions of the page nodes that enlive transforms, that way I can create vectors of non-intersecting nodes. Lots of words to say: (defn b-content-transform [] (def b-area (eh/select…
sova
  • 5,468
  • 10
  • 40
  • 48