misaki.compiler.default.html.core documentation

HTML utility for template

absolute-css

css alias for compatibility

absolute-js

js alias for compatibility

blockquote

(blockquote & xs)
Make blockquote

(blockquote "foo" "bar")
;=> <blockquote><p>foo</p><p>bar</p></blockquote>
(blockquote "foo\nbar")
;=> <blockquote><p>foo</p><p>bar</p></blockquote>
(blockquote {:class "bar"} "foo")
;=> <blockquote class="bar"><p>foo</p></blockquote>

code

macro

(code s)(code attr s)
Make inline code

(code hello)
;=> <code class="prettyprint">hello</code>
(code {:class "foo"} hello)
;=> <code class="prettyprint foo">hello</code>

container

(container & body)
Make default container tag.

css

(css & args)
Include Cascading Style Sheet.

(css "foo.css" "bar.css")
;=> <link rel="stylesheet" type="text/css" href="foo.css" />
;=> <link rel="stylesheet" type="text/css" href="bar.css" />
(css {:media "screen"} "foo.css" "bar.css")
;=> <link rel="stylesheet" type="text/css" media="screen" href="foo.css" />
;=> <link rel="stylesheet" type="text/css" media="screen" href="bar.css" />

defparser

macro

(defparser name regexp result-fn)
Macro to define string parser.

dl

(dl x)(dl attr x)
Make definition list

(dl {:foo "bar"})
;=> <dl><dt>foo</dt><dd>bar</dd></dl>
(dl [:foo "bar"])
;=> <dl><dt>foo</dt><dd>bar</dd></dl>
(dl {:class "foo"} {:foo "bar"})
;=> <dl class="foo"><dt>foo</dt><dd>bar</dd></dl>

header

(header h & p)
Make default header tag.

heading

(heading n s)(heading n attr s)
Make heading tag

(heading 1 "hello")
;=> <h1 id="auto_gen"><span>h</span>ello</h1>
(heading 1 {:class "foo"} "hello")
;=> <h1 id="auto_gen" class="foo"><span>h</span>ello</h1>

img

(img src)(img x src)(img attr alt src)
Make image

(img "bar.jpg")
;=> <img src="bar.jpg" />
(img "foo" "bar.jpg")
;=> <img alt="foo" src="bar.jpg" />
(img {:class "foo"} "bar.jpg")
;=> <img class="foo" src="bar.jpg" />
(img {:class "foo"} "foo" "bar.jpg")
;=> <img alt="foo" class="foo" src="bar.jpg" />

js

(js & args)
Include JavaScript

(js "foo.js" "bar.js")
;=> <script type="text/javascript" src="foo.js"></script>
;=> <script type="text/javascript" src="bar.js"></script>

p

(p & s)
Make paragraph

    (p "hello")
    ;=> <p class="paragraph">hello</p>
    (p {:class "foo"} "hello")
    ;=> <p class="paragraph foo">hello</p>

Following markdown format is allowd.

 * Parse link
    "[hello](world)"
    ;=> <a href="world">hello</a>
    "[hello](title: POST TITLE)"
    ;=> <a href="POST URL">hello</a>

 * Parse emphasized
    "*hello*"
    ;=> <em>hello</em>

 * Parse strong
    "**hello**"
    ;=> <strong>hello</strong>

 * Parse inline code
    "`hello`"
    ;=> <code class="prettyprint">hello</code>

 * Parse new line
    "\n\nhello"
    ;=> <br />hello

post-date

(post-date)
Make default post date tag.

post-list

(post-list)(post-list attr)
Make default all posts unordered list.

(post-list)
(post-list {:class "foo "})

post-tags

(post-tags & {:keys [class], :or {class "tag"}})
Make default post tags unordered list.

prev-next-post-link

(prev-next-post-link & {:keys [class separator], :or {class "pager", separator "|"}})
Make previous/next post links.

table

(table bodies)(table x bodies)(table attr head bodies)
Make table

(table [[1 2]])
;=> <table><tbody><tr><td>1</td><td>2</td></tr></tbody></table>
(table '[a b] [[1 2]])
;=> <table><thead><tr><th>a</th><th>b</th></tr></thead>
;          <tbody><tr><td>1</td><td>2</td></tr></tbody></table>
(table {:class "foo"} [[1 2]])
;=> <table class="foo"><tbody><tr><td>1</td><td>2</td></tr></tbody></table>
(table {:class "foo"} '[a b] [[1 2]])
;=> <table class="foo"><thead><tr><th>a</th><th>b</th></tr></thead>
;          <tbody><tr><td>1</td><td>2</td></tr></tbody></table>

tag-list

(tag-list)(tag-list attr)
Make default all tags unordered list.

(tag-list)
(tag-list {:class "foo"})

two-column

(two-column left right)
Make 2 column

ul

(ul ls)(ul x ls)(ul f attr ls)
Make unordered list

    (ul [1 2])
    ;=> <ul><li><span>1</span></li><li><span>2</span></li></ul>
    (ul inc [1 2])
    ;=> <ul><li><span>2</span></li><li><span>3</span></li></ul>
    (ul {:class "foo"} [1 2])
    ;=> <ul class="foo"><li><span>1</span></li><li><span>2</span></li></ul>
    (ul inc {:class "foo"} [1 2])
    ;=> <ul class="foo"><li><span>2</span></li><li><span>3</span></li></ul>
;