We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
查看 Enlive。它将允许您的设计人员使用纯 HTML 进行工作。
Check out Enlive. It will allow your designer to work in pure HTML.
相同答案加意见
正如其他答案已经指出的那样, Enlive 将允许您使用纯 HTML 模板,而 Hiccup 利用 Clojure 数据结构生成 HTML。
但是,我认为我们都同意,HTML 应该是语义的并描述页面的结构,而布局和外观应留给 CSS和 JavaScript。至少根据我的经验,前端设计师不应该负责彻底改变页面的结构,而应该负责通过 CSS 和 JavaScript 进行样式和布局。
每当开发比静态 HTML 页面集合更复杂的应用程序时,如果前端设计人员认为需要更改页面的结构,则应该与将其组合在一起的开发人员共同对话。考虑到这一点,开发人员应该选择一种模板方案或 HTML 生成方法,以提高他/她的工作效率。我的两分钱。
Same Answer Plus Opinion
As other answers have already stated, Enlive will let you use pure HTML templates, while Hiccup leverages Clojure data structures to generate HTML.
But, as I think we'd all agree, HTML should be semantic and describe the structure of the page, while layout and look-and-feel should be left to CSS and JavaScript. At least out of my experience, front-end designers should not be responsible for drastically altering the structure of a page, but rather responsible for styling and placement through CSS and JavaScript.
Whenever working on an application more complex than a collection of static HTML pages, if a front-end designer feels the need to change a page's structure, that should be a joint conversation with the developer who put it together. With this in mind, the developer should choose a templating scheme or HTML generation method that allows him/her to be most productive. My two cents.
Hiccup 在示例中大多是默认设置,但我所知道的所有 Web 框架都可以与任何模板库一起使用。
就像 dnolen 提到的那样,Enlive 非常受欢迎(https://github.com/cgrand/enlive) 。 Enlive 代码和 html 100% 分离。如果您有其他人进行设计,那么使用起来非常好。
除了 Hiccup 和 Enlive 之外,还有鲜为人知的舰队 (https://github.com/Flamefork/fleet )这更接近流行的 Ruby/PHP 解决方案。
Hiccup is mostly the default in examples, but all webframeworks I know of can work with any templating library.
Like dnolen mentioned there is Enlive which is quite popular (https://github.com/cgrand/enlive). Enlive has 100% separation of code and html. Very nice to use if you have other people doing the design.
Other then Hiccup and Enlive there is the lesser known fleet (https://github.com/Flamefork/fleet) which is closer to popular Ruby/PHP solutions.
三年后:
您还可以看看 Caribou http://let-caribou.in/ 。它是一个新的 Clojure 框架,使用良好的旧 HTML 语法进行模板化。
您可以首先观看此截屏视频:http://www.youtube.com/watch?v=dPUQ0GUvSt0
您会发现您也不需要在 clojure 中编写代码来更新数据模型。只有控制器(模板和模型之间的链接)需要您用口齿不清的方式说话......
祝你好运!
Three years later:
You can also have a look to Caribou http://let-caribou.in/ . It is a new Clojure framework that uses good old HTML syntax for templating.
You could start by watch this screencast: http://www.youtube.com/watch?v=dPUQ0GUvSt0
You'll see that you don't need to code in clojure for updating your data models either. Only the controllers (the links between templates and models) would require you to talk the lispy way...
Good luck!
还有 Selmer :
因此,它更适合大型应用程序。
There is also Selmer :
Which is therefore more suited to large apps.