1local html = import 'html.libsonnet';
2local jekyll = import 'jekyll.libsonnet';
3local content = import 'stdlib-content.jsonnet';
9local manifestJsonSingleLine(val) = std.strReplace(std.manifestJsonEx(val, ''), '\n', ' ');
13 if std.isString(ex) then
16 html.spaceless([html.code({}, ex.input), ' yields ', html.code({}, manifestJsonSingleLine(ex.output))])
18 html.p({}, html.spaceless(['Example: ', exRep, '.']))
21local hgroup(body) = html.div({ class: 'hgroup' }, body);
22local hgroup_inline(body) = html.div({ class: 'hgroup-inline' }, [body, '<div style="clear: both"></div>']);
23local panel(body) = html.div({ class: 'panel' }, body);
25local in_panel(body) = hgroup(hgroup_inline(panel(body)));
28 if std.objectHas(f, 'params') then
29 '(' + std.join(', ', f.params) + ')'
34local fieldDescription(f) =
35 if std.isString(f.description) then
36 html.p({}, f.description)
41local fieldDoc(f, prefix) =
43 in_panel(html.h4({ id: f.name }, prefix + '.' + f.name + fieldParams(f))),
45 if std.objectHas(f, 'availableSince') then (
50 if f.availableSince == 'upcoming' then
51 'Available in upcoming release.'
53 'Available since version ' + f.availableSince + '.'
58 if std.objectHas(f, 'examples') then [
66local group(group_spec, prefix) =
68 in_panel(html.h3({ id: group_spec.id }, group_spec.name)),
69 if std.objectHas(group_spec, 'intro') then in_panel(group_spec.intro),
71 [fieldDoc(f, prefix) for f in group_spec.fields],
76 in_panel(html.h1({id: 'standard_library'}, 'Standard Library')),
78 in_panel(content.intro),
80 [group(g, content.prefix) for g in content.groups],
83local stdlibFrontMatter = {
85 title: 'Standard Library',
88jekyll.renderWithFrontMatter(stdlibFrontMatter, stdlibPage)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list