Hiccup is a library for representing HTML in Clojure. It uses vectors to represent tags, and maps to represent a tag's attributes.
Questions tagged [hiccup]
101 questions
1
vote
1 answer
Clojure file upload with hiccup, ring, compojure
I am trying to create file upload system. However, i stuck and can't resolve the problem.
My core.cjl
(ns hiccup-templating.core
(:require [compojure.core :refer [defroutes GET ANY POST]]
[compojure.route :as route]
…

Andrei Belkevich
- 73
- 6
1
vote
1 answer
Clojure form - Submit when press enter
I have a search-form that searches some text for me. When I type in the input box I have to manually press a button for it to search. Is there a way for me to hit enter on the keyboard and have that search, as well as the button?
(defn search-form
…

rbb
- 989
- 6
- 19
1
vote
1 answer
Recursion in html like data structure using clojure
I have been thinking about this problem, but I can't figure out the steps to build my function:
I have an hiccup like html data as input, this structure is composed by html and custom elements, example:
format: [tag-name options & body]
[:a {} []]…

Mateus Vahl
- 979
- 2
- 12
- 29
1
vote
3 answers
Clojure: Proper condp Usage
I'm rewriting my History of the World website (history.clmitchell.net) in clojure and making great progress. I've reached the point where I need to use a conditional to output hiccup code for declaring CSS links based on which page I'm loading. I've…

Quasaur
- 1,335
- 1
- 10
- 27
1
vote
1 answer
How can I script math functionality in Clojure using Hiccup and Compojure?
I have a home page being rendered that requests user-input as vectors of integers. I need those data-structures, because they play nice with the math functions that I will use to manipulate the input:
(defn home [& [weights grades error]]
(html
…

kurofune
- 1,055
- 12
- 26
1
vote
3 answers
How to display {} in hiccup?
I am working on an angular app, where I need to display some angular expression in this form:
{{"Hello," name}}
In Hiccup, {} have a special meaning, and is used for attributes, how to use it for angular syntax ?

Amogh Talpallikar
- 12,084
- 13
- 79
- 135
1
vote
1 answer
Clojure Loop and count
I am trying to get a link for each photoset. It should look like this:
[:p (link-to (str "/album?photosetid="photosetid) photoset-name)
In the following code I get a map of all photoset ids and names:
(def ids (map #(str "/album?photosetid=" %1)…

wes
- 33
- 3
1
vote
1 answer
Lacij, and adding xml stylesheet
I am using Compojure, Hiccup and Lacij to essentially generate SVG documents. I am using data.xml to perform some post processing on the output from tikkba.utils.dom/spit-str for adding javascript essentially doing
{:tag :script, :attrs {:type…

Cyrax
- 115
- 6
1
vote
2 answers
Can't load hiccup
I have just added the [hiccup "1.0.3"] dependency to my project.clj, but now I can't start the repl anymore. Each time I try, I get:
Caused by: java.io.FileNotFoundException: Could not locate hiccup/page_helpers__init.class or…

TG-T
- 2,174
- 3
- 19
- 20
1
vote
1 answer
Clojure convert {"a.b" 1, "a.c" 2, "d.e" 3} to {:a {:b 1, :c 2}, :d {:e 3}} (for compojure/hiccup with monger hierarchy)
My mongodb schema has a JSON hierarchy to it. When I get the field params from compojure, the hash is in flat dotted notation like {"a.b" 1, "a.c" 2, "d.e" 3}. I'm wanting to use monger to insert the data, but that expects a real hierarchical…

lobsterism
- 3,469
- 2
- 22
- 36
1
vote
1 answer
lein ring server does not automatically rebuild
I am writing a small clojurescript project and I followed the numerous lein cljsbuild examples that use lein ring as a development web server.
I used to run lein ring server to serve the website on my local machine. Now it seems that lein ring…

wirrbel
- 3,173
- 3
- 26
- 49
1
vote
1 answer
Parsing values from multiple checkboxes using compojure
I have created small compojure web application, which can display multiple values, fetched from other website, using provided URL. At the moment, this URL is hard coded in one of my functions, and now I would like to add feature for dynamical URL…

Мitke
- 310
- 3
- 17
0
votes
0 answers
Clojurescript show pdf inside webpage using hiccup
I want to show a pdf file inside the webpage, using Clojurescript. These are what I've tried but it does not show anything.
[:embed {:src "demo.pdf"
:type "application/pdf"
:width "500px"
:height "400px"}]
or
[:object…

niloofar
- 2,244
- 5
- 23
- 44
0
votes
0 answers
using the [:video] in reagent doesn't work
I am trying to embed a video inside my reagent (clojurescript) web app, and it doesn't seem to work
the following just doesn't produce a video on my localhost webpage -
[:video {:muted true :loop true :autoplay true :height "240px" :width "320px"}
…

Viktor Karsakov
- 157
- 3
- 10
0
votes
1 answer
clojurescript / hiccup - inline css to set dispatch to a hover action
I'm trying to hover a text and change the :display of another text to none, in order to make it disappear. I've used :onMouseOver, but it does not work because it needs this.value I think.
So, any idea for how I can do that? I require inline CSS in…

niloofar
- 2,244
- 5
- 23
- 44