forked from ggrossetie/asciidoctor-web-pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.js
28 lines (28 loc) · 921 Bytes
/
template.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module.exports = {
paragraph: (node) => `<p class="paragraph">${node.getContent()}</p>`,
document: (node) => `<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>${node.getDocumentTitle()}</title>
<link href="https://fonts.googleapis.com/css?family=Bitter|Fira+Sans:100,200,300,400,700" rel="stylesheet">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div class="page-bleed"></div>
<div class="header">
<h1>${node.getHeader().getTitle()}</h1>
</div>
<div id="content">
${node.getContent()}
</div>
<div class="footer"></div>
</body>`,
section: (node) => {
const title = node.getTitle() === '!' ? '' : `<h${node.getLevel()}>${node.getTitle()}</h${node.getLevel()}>`
return `<div class="section section${node.getLevel()} ${node.getRole()}">
${title}
${node.getContent()}
</div>`
}
}