-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
173 lines (147 loc) · 6.55 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<html>
<head>
<title>Myst documentation</title>
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Mono:400,600|IBM+Plex+Sans+Condensed:300,700|IBM+Plex+Sans:300,400,600" rel="stylesheet">
<link rel="stylesheet" href="style.css" />
</head>
<!-- Renderer for arbitrary lists of elements. Accepts a `renderer` argument
to render the component. Elements will be sorted by their keys. -->
<script type="text/template" id="sorted_list_template">
<% Object.keys(list).sort().forEach(function(element) { %>
<%= renderer(list[element]) %>
<% }); %>
</script>
<script type="text/template" id="constant_template">
<div id="<%= full_name %>" class="display__constant">
<span class="hash_anchor"></span>
<span class="display__constant__head">
<span class="display__constant__name"><%= name %></span>
<span class="display__constant__value">= <%= value %></span>
</span>
<p><%= MarkdownRenderer.render(doc) %></p>
</div>
</script>
<script type="text/template" id="method_template">
<div id="<%= full_name %>" class="display__method">
<span class="hash_anchor"></span>
<span class="display__method__name"><%= separator %><%= name %></span>
<% clauses.forEach(function(clause) { %>
<div class="display__method__clause">
<span class="display__method__head"><%= clause.head %></span>
<p><%= MarkdownRenderer.render(clause.doc) %></p>
</div>
<% }); %>
</div>
</script>
<script type="text/template" id="sidebar_section_template">
<span class="entry__section-name"><%= section_name %></span>
<ul class="entry__list">
<% let prefix = arguments[0].prefix; %>
<% Object.keys(entries).sort().forEach(function(name) { %>
<a href="#<%= entries[name].full_name %>">
<li id="<%= entries[name].full_name %>" class="entry">
<span class="entry__chevron"></span>
<%= prefix %><%= name %>
</li>
</a>
<% }); %>
</ul>
</script>
<script type="text/template" id="sidebar_template">
<a href="#" class="sidebar-header__home-link">
<div id="sidebar-header">
<div class="sidebar-header__info">
<span class="sidebar-header__name"><%= root.project_name %></span>
<span class="sidebar-header__version"><%= root.version %></span>
</div>
<img class="sidebar-header__logo" src="<%= root.logo_url %>">
</div>
</a>
<div class="sidebar-breadcrumbs">
<% if(content.kind != "ROOT") { %>
<a href="#<%= misc.parent %>" class="sidebar-breadcrumb">
<span class="sidebar-breadcrumb__chevron"></span> <%= misc.parent || 'Kernel' %>
</a>
<% } %>
<span class="sidebar-breadcrumbs__name"><%= content.name || 'Kernel' %></span>
</div>
<div id="index">
<%= $render.sidebar_section({ section_name: 'Modules', entries: content.submodules }) %>
<%= $render.sidebar_section({ section_name: 'Types', entries: content.subtypes }) %>
<%= $render.sidebar_section({ section_name: 'Constants', entries: content.constants }) %>
<% if(content.kind == "TYPE") { %>
<%= $render.sidebar_section({ section_name: 'Initializers', entries: content.initializers }) %>
<%= $render.sidebar_section({ section_name: 'Static Methods', entries: content.static_methods, prefix: '.' }) %>
<%= $render.sidebar_section({ section_name: 'Instance Methods', entries: content.instance_methods, prefix: '#' }) %>
<% } else if(content.kind == "MODULE" || content.kind == "ROOT") { %>
<%= $render.sidebar_section({ section_name: 'Methods', entries: content.methods, prefix: '.' }) %>
<% } %>
</div>
</script>
<script type="text/template" id="docs_template">
<% if(content.kind == "TYPE") { %>
<h1 class="display__name">
<span class="muted"><%= content.full_name.replace(content.name, '') %></span><%= content.name %>
<span class="display__kind"><%= content.kind %></span>
</h1>
<p class="display__summary"><%= MarkdownRenderer.render(content.doc) %></p>
<div class="display__section">
<h2 class="display__section-name">Constants</h2>
<%= $render.sorted_list({ list: content.constants, renderer: $render.constant }) %>
</div>
<div class="display__section">
<h2 class="display__section-name">Initializers</h2>
<%= $render.sorted_list({ list: content.initializers, renderer: $render.method }) %>
</div>
<div class="display__section">
<h2 class="display__section-name">Static Methods</h2>
<%= $render.sorted_list({ list: content.static_methods, renderer: $render.method }) %>
</div>
<div class="display__section">
<h2 class="display__section-name">Instance Methods</h2>
<%= $render.sorted_list({ list: content.instance_methods, renderer: $render.method }) %>
</div>
<% } else if(content.kind == "MODULE") { %>
<h1 class="display__name">
<span class="muted"><%= content.full_name.replace(content.name, '') %></span><%= content.name %>
<span class="display__kind"><%= content.kind %></span>
</h1>
<p class="display__summary"><%= MarkdownRenderer.render(content.doc) %></p>
<div class="display__section">
<h2 class="display__section-name">Constants</h2>
<%= $render.sorted_list({ list: content.constants, renderer: $render.constant }) %>
</div>
<div class="display__section">
<h2 class="display__section-name">Methods</h2>
<%= $render.sorted_list({ list: content.methods, renderer: $render.method }) %>
</div>
<% } else if(content.kind == "ROOT") { %>
<h1 class="display__name">
<%= root.project_name %>
<span class="display__kind"><%= root.version %></span>
</h1>
<p class="display__summary"><%= MarkdownRenderer.render(root.doc) %></p>
<div class="display__section">
<h2 class="display__section-name">Constants</h2>
<%= $render.sorted_list({ list: content.constants, renderer: $render.constant }) %>
</div>
<div class="display__section">
<h2 class="display__section-name">Methods</h2>
<%= $render.sorted_list({ list: content.methods, renderer: $render.method }) %>
</div>
<% } %>
</script>
<body id="docs">
<div class="container">
<div class="content">
<div id="sidebar">
</div>
<div class="display-wrapper">
<div id="display">
</div>
</div>
</div>
</div>
</body>
<script src="docs.js"></script>
</html>