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