git ssb

16+

Dominic / patchbay



Tree: e947432e1cdeccc80641fc333eed1e6190fb0238

Files: e947432e1cdeccc80641fc333eed1e6190fb0238 / 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