问题标签 [hiccup]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
161 浏览

clojure - 如何创建返回 Hiccup 结构的 Clojure 函数?

想象一下,我想编写一个 Clojure 函数,它返回一个等效于<h3>Hello</h3>.

我该怎么做?

我试过了

但在这两种情况下都会收到错误消息(:h3 "Location X") is not a valid element name.

更新1:我从这个调用上述函数:

有一个集合all-locations。对于其中的每个元素,我想在 HTML 中创建一个部分(带有h3)标题 ( hiccup-body),添加标题 ( hiccup-title) 并将所有这些转换为 HTML。

0 投票
2 回答
121 浏览

clojure - 如何有条件地生成打嗝结构?

我有一堆描述位置的地图:

有些地图有:Comments,有些则没有。

我想创建一个 Clojure 函数,除其他外,将注释输出到 HTML(如果存在)。

我写了这个函数:

如果我运行使用此函数的代码,我会收到错误

如果我更改comment-hiccupnil,则错误消失。

如何使用 Hiccup 有条件地将数据输出到 HTML?

注意:我是 Clojure 的新手,所以如果我的方法完全错误,请告诉并展示如何正确操作。

0 投票
0 回答
31 浏览

javascript - React and JSX plus Hiccup custom implementation

I have found a declarative-canvas hiccup implementation, what works like that:

I'd like to write this inside a react JSX file taking the advantage of typescript prop check writing my own Group, Rect, and Circle React component.

Something like:

Do anyone has any kind of hint or suggestion?

0 投票
1 回答
75 浏览

clojure - 如何使用 Hiccup 在 Clojure 中制作可点击的图像

现在我有一个徽标,然后是一个指向主页的链接。我想将它们组合起来,以便有人可以单击徽标并被定向到主页。我不知道如何用 Hiccup 做到这一点。

我正在尝试做类似的事情

但它不起作用。我该怎么办?