Questions tagged [hiccup]

Hiccup is a library for representing HTML in Clojure. It uses vectors to represent tags, and maps to represent a tag's attributes.

101 questions
2
votes
1 answer

How do you set the filepath for css in hiccup with Clojure using the html5 tag?

I am learning the very basics of web-developing with Clojure, but cannot seem to get my css to work using hiccup. I have tested several possible paths to the file, tried setting the link manually using tags, and even tried adding an html5, line at…
kurofune
  • 1,055
  • 12
  • 26
2
votes
1 answer

How to repeat a list of items from a vector in hiccup?

If I have a vector name-lst as ["John" "Mary" "Watson" "James"], and I want to diplay them as list items, how do I do that using hiccup ? something like [:ul (for [name name-list] [:li name])] will return a list of [:li ] in between [:ul ]…
Amogh Talpallikar
  • 12,084
  • 13
  • 79
  • 135
2
votes
1 answer

Hiccup not working : FileNotFoundException: Could not locate ../as__init.class or ../as.clj on classpath

I'm just beginning with clojure and I'm trying to build a small web app. I wanted to try out hiccup but it doesn't seem to be working. My code is below. Project.clj (defproject WebTest "0.1.0-SNAPSHOT" :description "FIXME: write description" …
Seth Paulson
  • 800
  • 6
  • 15
2
votes
1 answer

Noir - unable to resolve symbol html5 in this context

I am trying to use noir and am following the tutorial that is given at the default tutorial and am using this code (defpage "/my-page" [] (html5 [:h1 "This is my first page!"])) However, clojure throws up an error and refuses to work.
logiblocs
  • 58
  • 5
1
vote
1 answer

Converting Antd Form.Item to reagent-hiccup

I'm trying to translate a antd react form item to reagent-hiccup. The original react component is something like this, { } …
Kannan Ramamoorthy
  • 3,980
  • 9
  • 45
  • 63
1
vote
0 answers

How do I make an image in the navigation bar bigger?

I'm making a landing page based on the one from Clojure Bridge. I made the navigation bar bigger using py-3 and added a logo. But the logo that's in the navigation bar is still tiny. It takes up a fraction of the space it could. How do I make it…
JohnBradens
  • 119
  • 8
1
vote
1 answer

Turn hiccup into html in a reagent application

This might sound a stupid question, but how do I turn a piece of hiccup into html in a ClojureScript reagent application? I want something like this : (html [:div [:p "hello world" ]]) that produces

hello world

This is what you…
interstar
  • 26,048
  • 36
  • 112
  • 180
1
vote
1 answer

What is the preferred syntax for nesting a reagent hiccup element that is returned from a function?

Given a function to return an element: (defn title [] [:h1 "Hello World"]) What is the preferred way of nesting this inside another component? I've seen it done in a tutorial by wrapping the function call in a vector: [:div {:class "app"} …
insano10
  • 113
  • 2
  • 6
1
vote
1 answer

Why are these `select` elements not being rendered?

I'm working on a project for a client where there needs to be 125 dropdown menus displayed on one page. I of course am not going to manually add all those so I wrote a simple for expression to do it for me. This works for the vast majority of the…
TomLisankie
  • 3,785
  • 7
  • 28
  • 32
1
vote
1 answer

How to convert the following js style map to clojurescript?

I want to write this js style map in cljs: const pathLength = useSpring(yRange, { stiffness: 400, damping: 90 })
zendevil.eth
  • 974
  • 2
  • 9
  • 28
1
vote
2 answers

Querying Reagent/Hiccup Markup For Tests

I want to test a Reagent/Re-Frame view by asserting properties of the Hiccup markup it returns. Therefore I need functions that traverse the tree, filter it, or check that certain elements with certain attributes are present. I can not be the first…
1
vote
1 answer

Clojurescript Hickory on NodeJS (parse HTML to hiccup)

I need a way to parse HTML markup to hiccup on a node.js app written in Clojurescript. On the client side I used hickory for the job, which unfortunately doesn't play nice on Node.js. If any namespace requires hickory.core node refuses to run the…
Phylax
  • 189
  • 10
1
vote
2 answers

Simple Clojurescript form

I'm working with Reagent and CLJS, familiar with React and Clojure, less so CLJS. I'd like to make a simple form, but it's not obvious to me in CLJS. (defn form [] [:div [:input {:type "text" :name "first-name" :id "first-name"}] [:button …
jmargolisvt
  • 5,722
  • 4
  • 29
  • 46
1
vote
2 answers

How in Reagent with Hiccup make an element with takes all available space

I am trying to find out how in Reagent with Hiccup make an element with takes all available space. So an resize parent I will get :component-did-mount call back. (defn chart [id col-width row-height] (let [dimensions (atom {})] …
user9240263
1
vote
1 answer

Building nested vector from map in Clojure

I have a set of URLs, and some of the URLs have indirect references (as a vector). Any URL that does not have an indirect reference just has nil. I'm starting out with the following test map: {"URL 1" nil, "URL 2" ["indirect 1" "indirect 2"]} I'm…
R Jackson
  • 105
  • 3
  • 13