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