Files: 8199616e9406d34349c48b6a0a48bfef05dedbdc / modules_extra / split.js
382 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | exports.needs = { |
4 | screen_view: 'first' |
5 | } |
6 | |
7 | exports.gives = 'screen_view' |
8 | |
9 | exports.create = function (api) { |
10 | |
11 | return function (path) { |
12 | var m = /^split\s*\((.*)\)$/.exec(path) |
13 | if(!m) |
14 | return |
15 | |
16 | return h('div.row', |
17 | m[1].split(',').map(function (e) { |
18 | return api.screen_view(e.trim()) |
19 | }).filter(Boolean) |
20 | ) |
21 | } |
22 | |
23 | } |
24 |
Built with git-ssb-web