Files: f9490b57823c88d2d4e1cdc8495b8ab60d63862f / book / html / short-description.js
514 bytesRaw
1 | const nest = require('depnest') |
2 | const { h, computed, when } = require('mutant') |
3 | |
4 | exports.needs = nest({ |
5 | 'message.html.markdown': 'first' |
6 | }) |
7 | |
8 | exports.gives = nest('book.html.shortDescription') |
9 | |
10 | exports.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