Closed lvh closed 8 years ago
(Also, I feel like html5 should probably be the default.)
The hiccup.page/html5
macro is for producing complete HTML pages, so it'll add a doctype and html
tags. The hiccup.core/html
macro just produces a segment of HTML.
(hiccup.page/html5 [:span "foo"])
=> "<!DOCTYPE html>\n<html><span>foo</span></html>"
(hiccup.core/html [:span "foo"])
=> "<span>foo</span>"
The API docs do say that the html5
function creates "a HTML5 document", but perhaps the meaning of this could be clearer. I'll accept clarifications to the docstrings.
Thanks! I think the docstring is plenty clear; I just had no idea that was an API I was supposed to use. I've submitted #117 to mention that API in the README.
I don't think this requires an update to the README. All the namespaces in the API docs are APIs you can use. If they weren't, they wouldn't be in the API docs. If the API docs are clear about the purpose of the functions, then we don't need additional documentation.
Okay. I guess I'll kill that PR then; thanks again.
There's the html5 macro, but the public API seems to be
html
, which does take some opts. Whichever the official thing I should be using is, I'd be happy to submit a PR documenting that, as well as how to produce html5, xhtml, html4... for the README.