git ssb

0+

Zach! / dat-zine-library



Tree: 623ff906a993e064e9317ffbb5d9040bb68b975e

Files: 623ff906a993e064e9317ffbb5d9040bb68b975e / building / components / branchPlacard.js

734 bytesRaw
1const html = require('nanohtml')
2const raw = require('nanohtml/raw')
3const md = require('markdown-it')()
4
5const button = require('./actionButtons')
6
7module.exports = view
8
9function view (state, emit) {
10 if (state.branch.title) {
11 var branch = state.branch
12 console.log({branch})
13 return html`
14 <section id='branch-placard'>
15 <h1>${branch.title}</h1>
16 ${render(branch.description)}
17 <p>Want to start your own zine library?<span> ${button.makeBranch()}</span></p>
18 </section>
19 `
20 } else {
21 return html`<h1>loading</h1>`
22 }
23}
24
25function render (text) {
26 var htmlFromMarkdown = md.render(text)
27 var compatibleHTML = raw(htmlFromMarkdown)
28 return html`<article>${compatibleHTML}</article>`
29}
30

Built with git-ssb-web