git ssb

16+

Dominic / patchbay



Tree: bc574122903c7ef4a0abf0fb4918a12a4e96a977

Files: bc574122903c7ef4a0abf0fb4918a12a4e96a977 / app / page / shortcuts.js

810 bytesRaw
1const nest = require('depnest')
2const { h } = require('mutant')
3const fs = require('fs')
4const { join } = require('path')
5
6const rawMd = fs.readFileSync(join(__dirname, './SHORTCUTS.md'), 'utf8')
7
8exports.gives = nest({
9 'app.html.menuItem': true,
10 'app.page.shortcuts': true
11})
12
13exports.needs = nest({
14 'app.sync.goTo': 'first',
15 'message.html.markdown': 'first'
16})
17
18exports.create = function (api) {
19 return nest({
20 'app.html.menuItem': menuItem,
21 'app.page.shortcuts': shortcutsPage
22 })
23
24 function menuItem () {
25 return h('a', {
26 'ev-click': () => api.app.sync.goTo({ page: 'shortcuts' })
27 }, '/shortcuts')
28 }
29
30 function shortcutsPage (location) {
31 const page = h('Shortcuts', [
32 api.message.html.markdown(rawMd)
33 ])
34
35 page.title = '/shortcuts'
36 return page
37 }
38}
39

Built with git-ssb-web