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
0
votes
1 answer

clojure.data.json write/read affects enlive data

What is the appropriate json way to save and reload enlive's html-resource outputs. The following procedure does not preserve the data structure (note that I ask json/read-str to map keys to symbols): (require net.cgrand.enlive-html :as…
user3639782
  • 487
  • 3
  • 10
0
votes
1 answer

Clojure enlive: the function html-content can't operate a function with an argument (?)

So i made a simple html template using deftemplate, (html/deftemplate header "selmer/header.html" []) (html/deftemplate footer "selmer/footer.html" []) (html/deftemplate blogp "selmer/blogpage.html" [id] [:bjudul] (html/content…
Arie
  • 3
  • 1
0
votes
1 answer

Compojure Not Serving CSS When I Use Multiple Parameters

I'm trying to mimic Wordpress permalink using Compojure, but why all the static files (css, js, and img) are not found when I use multiple parameter? Here is my code. (defroutes approutes (GET "/" [] (posts-for-home)) (GET "/:year/:month/:title"…
0
votes
1 answer

Enlive: append a snippet in a template without parent element?

Say I have only access to
and child elements in my /public/articles.html file. ...

leontalbot
  • 2,513
  • 1
  • 23
  • 32
0
votes
1 answer

Clojure: enlive deftemplate can't use snippet

I'm trying to create template that produces table with some data in it. Data comes from a map defined in msh-contents. (require '[net.cgrand.enlive-html :as html]) (def msh-contents {:title "Events mashup", :data-content…
Vesna
  • 345
  • 2
  • 11
0
votes
1 answer

Clojure: why is sniptest producing LazySeq

I'm creating a template in enlive and having trouble with this snippet which produces lazyseq. When I try this sniptest in REPL it produces "clojure.lang.LazySeq@ba6da9f2". (h/sniptest (template-div) [:div.Row] (h/content (map…
Vesna
  • 345
  • 2
  • 11
0
votes
1 answer

enlive: passing parameters from selectors to transformations

I have some transformations in enlive: (html/deftemplate tranforma-numero-template "public/index.html" [m] [:#portugues :.conteudo] (html/content (:portugues m)) [:#ingles :.conteudo] (html/content (:ingles m)) …
Carlos Nunes
  • 1,929
  • 2
  • 16
  • 20
0
votes
1 answer

Enlive snippet giving me odd HTML

Problem: Enlive snippet making funky HTML Visual reference of problem: http://i.imgur.com/FIOzgZv.png See bottom of code snippet for strange HTML in question (ns notebook.handler (:require [compojure.core :refer :all] …
deadghost
  • 5,017
  • 3
  • 34
  • 46
0
votes
1 answer

Update and normalize attr src in enlive

I just start programming recently and I have this problem, so I have this html snippet. I want parse the src attribute of the img and normalize it with urly path normalization, and add some new path to the src.
calvin91
  • 15
  • 4
0
votes
2 answers

Clojure Enlive: A selector that uses regex

I'm trying to select the :li node that has, in is content, the word "(SCIAN":
  • ...
  • Conception de systèmes informatiques et services connexes (SCIAN 541510)
  • ...
  • I've fail trying…
    leontalbot
    • 2,513
    • 1
    • 23
    • 32
    0
    votes
    1 answer

    How to write this clojure enlive program so it can parse multiple urls?

    This is a program to parse some sites. The first site is site1. All the logic to parse that perticular site is located to (-> config :site1) (ns program.core (require [net.cgrand.enlive-html :as html])) (def config {:site1 …
    leontalbot
    • 2,513
    • 1
    • 23
    • 32
    0
    votes
    2 answers

    Clojure Enlive: How to simplify this extract fn from scrape3.clj

    I followed the enlive-tutorial and must say i'm impressed by the power of Enlive for parsing the web. Now, I came to look further to the scrape3.clj available here:…
    leontalbot
    • 2,513
    • 1
    • 23
    • 32
    0
    votes
    1 answer

    How to add a string containing HTML with Clojure Enlive

    I have defined a template in this way: (deftemplate layout-string "path/to/html/container.html" [content-strings] [:#container :> :div.pad] (content (html-snippet (apply str content-strings))) ) Here content-strings contain a HTML (for…
    Nico Balestra
    • 256
    • 3
    • 12
    0
    votes
    1 answer

    Enlive Predefined selector-steps

    I'm trying to use Enlive to clone the replace-me script tag in this html. [...] [...] Question 1) I'm…
    ebaxt
    • 8,287
    • 1
    • 34
    • 36
    1 2 3 4 5
    6