git ssb

3+

arj / patchbook



Tree: f9490b57823c88d2d4e1cdc8495b8ab60d63862f

Files: f9490b57823c88d2d4e1cdc8495b8ab60d63862f / book / html / short-description.js

514 bytesRaw
1const nest = require('depnest')
2const { h, computed, when } = require('mutant')
3
4exports.needs = nest({
5 'message.html.markdown': 'first'
6})
7
8exports.gives = nest('book.html.shortDescription')
9
10exports.create = (api) => {
11 return nest('book.html.shortDescription', description)
12 function description (description) {
13 const markdown = api.message.html.markdown
14
15 return h('Description', [
16 computed(description, (d) => d ? markdown(d.length > 250 ? d.substring(0, 250) + '...' : d) : '')
17 ])
18 }
19}
20

Built with git-ssb-web