zengin_lite 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ <!DOCTYPE html>
2
+ <html >
3
+ <head>
4
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
+ <meta charset="utf-8" />
6
+
7
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" />
8
+
9
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" />
10
+
11
+
12
+
13
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
16
+
17
+
18
+ <title>File List</title>
19
+ <base id="base_target" target="_parent" />
20
+ </head>
21
+ <body>
22
+ <div id="content">
23
+ <div class="fixed_header">
24
+ <h1 id="full_list_header">File List</h1>
25
+ <div id="full_list_nav">
26
+
27
+ <span><a target="_self" href="class_list.html">
28
+ Classes
29
+ </a></span>
30
+
31
+ <span><a target="_self" href="method_list.html">
32
+ Methods
33
+ </a></span>
34
+
35
+ <span><a target="_self" href="file_list.html">
36
+ Files
37
+ </a></span>
38
+
39
+ </div>
40
+
41
+ <div id="search">
42
+ <label for="search-class">Search:</label>
43
+ <input id="search-class" type="text" />
44
+ </div>
45
+ </div>
46
+
47
+ <ul id="full_list" class="file">
48
+
49
+
50
+ <li id="object_README" class="odd">
51
+ <div class="item"><span class="object_link"><a href="index.html" title="README">README</a></span></div>
52
+ </li>
53
+
54
+
55
+
56
+ </ul>
57
+ </div>
58
+ </body>
59
+ </html>
data/doc/frames.html ADDED
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Documentation by YARD 0.9.38</title>
6
+ </head>
7
+ <script type="text/javascript">
8
+ var mainUrl = 'index.html';
9
+ try {
10
+ var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
11
+ var name = match ? match[1] : mainUrl;
12
+ var url = new URL(name, location.href);
13
+ window.top.location.replace(url.origin === location.origin ? name : mainUrl);
14
+ } catch (e) {
15
+ window.top.location.replace(mainUrl);
16
+ }
17
+ </script>
18
+ <noscript>
19
+ <h1>Oops!</h1>
20
+ <h2>YARD requires JavaScript!</h2>
21
+ </noscript>
22
+ </html>
data/doc/index.html ADDED
@@ -0,0 +1,186 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ File: README
8
+
9
+ &mdash; Documentation by YARD 0.9.38
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "README";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index</a> &raquo;
40
+ <span class="title">File: README</span>
41
+
42
+ </div>
43
+
44
+ <div id="search">
45
+
46
+ <a class="full_list_link" id="class_list_link"
47
+ href="class_list.html">
48
+
49
+ <svg width="24" height="24">
50
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
+ </svg>
54
+ </a>
55
+
56
+ </div>
57
+ <div class="clear"></div>
58
+ </div>
59
+
60
+ <div id="content"><div id='filecontents'>
61
+ <h1 id="label-ZenginLite">ZenginLite</h1>
62
+
63
+ <p><a href="https://badge.fury.io/rb/zengin_lite"><img src="https://badge.fury.io/rb/zengin_lite.svg" alt="Gem Version"></a> <a href="https://github.com/YOUR_USERNAME/zengin-lite/actions/workflows/update.yml"><img src="https://github.com/YOUR_USERNAME/zengin-lite/actions/workflows/update.yml/badge.svg" alt="update"></a></p>
64
+
65
+ <p>A lightweight, modern Ruby implementation of Japanese bank and branch code database.</p>
66
+
67
+ <p>Rebuilt from scratch with focus on: - ⚡️ Fast startup time (5-10ms vs 200-500ms) - 💾 Low memory footprint (1MB vs 10-15MB) - 🔍 Flexible query capabilities - 📦 Compact size (~800KB)</p>
68
+
69
+ <h2 id="label-Installation">Installation</h2>
70
+
71
+ <p>Add this line to your application’s Gemfile:</p>
72
+
73
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>zengin_lite</span><span class='tstring_end'>&#39;</span></span>
74
+ </code></pre>
75
+
76
+ <p>Or install it yourself as:</p>
77
+
78
+ <pre class="code ruby"><code class="ruby">$ gem install zengin_lite
79
+ </code></pre>
80
+
81
+ <h2 id="label-Usage">Usage</h2>
82
+
83
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>zengin_lite</span><span class='tstring_end'>&#39;</span></span>
84
+
85
+ <span class='comment'># Find bank and branch
86
+ </span><span class='id identifier rubyid_bank'>bank</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ZenginLite.html" title="ZenginLite (module)">ZenginLite</a></span></span><span class='period'>.</span><span class='id identifier rubyid_bank'><span class='object_link'><a href="ZenginLite.html#bank-class_method" title="ZenginLite.bank (method)">bank</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0001</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='comment'># =&gt; #&lt;ZenginLite::Bank code=&quot;0001&quot; name=&quot;みずほ銀行&quot; ...&gt;
87
+ </span><span class='id identifier rubyid_branch'>branch</span> <span class='op'>=</span> <span class='id identifier rubyid_bank'>bank</span><span class='period'>.</span><span class='id identifier rubyid_branch'>branch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>001</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='comment'># =&gt; #&lt;ZenginLite::Branch code=&quot;001&quot; name=&quot;東京営業部&quot; ...&gt;
88
+ </span>
89
+ <span class='comment'># Search banks
90
+ </span><span class='id identifier rubyid_banks'>banks</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ZenginLite.html" title="ZenginLite (module)">ZenginLite</a></span></span><span class='period'>.</span><span class='id identifier rubyid_search_banks'><span class='object_link'><a href="ZenginLite.html#search_banks-class_method" title="ZenginLite.search_banks (method)">search_banks</a></span></span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>三井</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
91
+
92
+ <span class='comment'># Check existence (returns nil if not found)
93
+ </span><span class='const'><span class='object_link'><a href="ZenginLite.html" title="ZenginLite (module)">ZenginLite</a></span></span><span class='period'>.</span><span class='id identifier rubyid_bank'><span class='object_link'><a href="ZenginLite.html#bank-class_method" title="ZenginLite.bank (method)">bank</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>9999</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='comment'># =&gt; nil
94
+ </span></code></pre>
95
+
96
+ <p>For more detailed API documentation, please refer to the YARD documentation.</p>
97
+
98
+ <pre class="code ruby"><code class="ruby"># Generate and view documentation locally
99
+ $ bundle exec yard doc
100
+ $ open doc/index.html
101
+ </code></pre>
102
+
103
+ <p>Online documentation is available at <a href="https://rubydoc.info/gems/zengin_lite">rubydoc.info</a>.</p>
104
+
105
+ <h2 id="label-Data+Source">Data Source</h2>
106
+
107
+ <p>This gem uses data from <a href="https://github.com/zengin-code/source-data">zengin-code/source-data</a>, which is automatically updated daily.</p>
108
+
109
+ <h2 id="label-Comparison+with+zengin_code">Comparison with zengin_code</h2>
110
+
111
+ <table role="table">
112
+ <thead>
113
+ <tr>
114
+ <th>Feature</th>
115
+ <th>zengin_code</th>
116
+ <th>zengin_lite</th>
117
+ </tr>
118
+ </thead>
119
+ <tbody>
120
+ <tr>
121
+ <td>Startup time</td>
122
+ <td>200-500ms</td>
123
+ <td>5-10ms</td>
124
+ </tr>
125
+ <tr>
126
+ <td>Memory usage</td>
127
+ <td>10-15MB</td>
128
+ <td>&lt;1MB</td>
129
+ </tr>
130
+ <tr>
131
+ <td>Gem size</td>
132
+ <td>788KB</td>
133
+ <td>~800KB</td>
134
+ </tr>
135
+ <tr>
136
+ <td>Search capability</td>
137
+ <td>Basic</td>
138
+ <td>Flexible SQL queries</td>
139
+ </tr>
140
+ <tr>
141
+ <td>Data loading</td>
142
+ <td>Eager (all at once)</td>
143
+ <td>Lazy (on demand)</td>
144
+ </tr>
145
+ </tbody>
146
+ </table>
147
+
148
+ <h2 id="label-Development">Development</h2>
149
+
150
+ <pre class="code ruby"><code class="ruby"># Clone with submodule
151
+ $ git clone --recursive https://github.com/YOUR_USERNAME/zengin-lite.git
152
+ $ cd zengin-lite
153
+ $ bundle install
154
+
155
+ # Update source data and build database
156
+ $ git submodule update --remote
157
+ $ bundle exec rake db:build
158
+
159
+ # Run tests
160
+ $ bundle exec rake test
161
+
162
+ # Verify database integrity
163
+ $ bundle exec rake db:verify
164
+
165
+ # Build and install locally (database will be built automatically)
166
+ $ bundle exec rake install
167
+
168
+ # Generate documentation
169
+ $ bundle exec yard doc
170
+ $ open doc/index.html
171
+ </code></pre>
172
+
173
+ <h2 id="label-License">License</h2>
174
+
175
+ <p>The gem is available as open source under the terms of the <a href="http://opensource.org/licenses/MIT">MIT License</a>.</p>
176
+ </div></div>
177
+
178
+ <div id="footer">
179
+ Generated on Sat Feb 7 19:33:57 2026 by
180
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
181
+ 0.9.38 (ruby-3.4.6).
182
+ </div>
183
+
184
+ </div>
185
+ </body>
186
+ </html>
data/doc/js/app.js ADDED
@@ -0,0 +1,395 @@
1
+ window.__app = function () {
2
+ var localStorage = {},
3
+ sessionStorage = {};
4
+ try {
5
+ localStorage = window.localStorage;
6
+ } catch (e) {}
7
+ try {
8
+ sessionStorage = window.sessionStorage;
9
+ } catch (e) {}
10
+
11
+ function createSourceLinks() {
12
+ $(".method_details_list .source_code").before(
13
+ "<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>"
14
+ );
15
+ $(".toggleSource").toggle(
16
+ function () {
17
+ $(this).parent().nextAll(".source_code").slideDown(100);
18
+ $(this).text("Hide source");
19
+ },
20
+ function () {
21
+ $(this).parent().nextAll(".source_code").slideUp(100);
22
+ $(this).text("View source");
23
+ }
24
+ );
25
+ }
26
+
27
+ function createDefineLinks() {
28
+ var tHeight = 0;
29
+ $(".defines").after(" <a href='#' class='toggleDefines'>more...</a>");
30
+ $(".toggleDefines").toggle(
31
+ function () {
32
+ tHeight = $(this).parent().prev().height();
33
+ $(this).prev().css("display", "inline");
34
+ $(this).parent().prev().height($(this).parent().height());
35
+ $(this).text("(less)");
36
+ },
37
+ function () {
38
+ $(this).prev().hide();
39
+ $(this).parent().prev().height(tHeight);
40
+ $(this).text("more...");
41
+ }
42
+ );
43
+ }
44
+
45
+ function createFullTreeLinks() {
46
+ var tHeight = 0;
47
+ $(".inheritanceTree").toggle(
48
+ function () {
49
+ tHeight = $(this).parent().prev().height();
50
+ $(this).parent().toggleClass("showAll");
51
+ $(this).text("(hide)");
52
+ $(this).parent().prev().height($(this).parent().height());
53
+ },
54
+ function () {
55
+ $(this).parent().toggleClass("showAll");
56
+ $(this).parent().prev().height(tHeight);
57
+ $(this).text("show all");
58
+ }
59
+ );
60
+ }
61
+
62
+ function searchFrameButtons() {
63
+ $(".full_list_link").click(function () {
64
+ toggleSearchFrame(this, $(this).attr("href"));
65
+ return false;
66
+ });
67
+ window.addEventListener("message", function (e) {
68
+ if (e.data === "navEscape") {
69
+ $("#nav").slideUp(100);
70
+ $("#search a").removeClass("active inactive");
71
+ $(window).focus();
72
+ }
73
+ });
74
+
75
+ $(window).resize(function () {
76
+ if ($("#search:visible").length === 0) {
77
+ $("#nav").removeAttr("style");
78
+ $("#search a").removeClass("active inactive");
79
+ $(window).focus();
80
+ }
81
+ });
82
+ }
83
+
84
+ function toggleSearchFrame(id, link) {
85
+ var frame = $("#nav");
86
+ $("#search a").removeClass("active").addClass("inactive");
87
+ if (frame.attr("src") === link && frame.css("display") !== "none") {
88
+ frame.slideUp(100);
89
+ $("#search a").removeClass("active inactive");
90
+ } else {
91
+ $(id).addClass("active").removeClass("inactive");
92
+ if (frame.attr("src") !== link) frame.attr("src", link);
93
+ frame.slideDown(100);
94
+ }
95
+ }
96
+
97
+ function linkSummaries() {
98
+ $(".summary_signature").click(function () {
99
+ document.location = $(this).find("a").attr("href");
100
+ });
101
+ }
102
+
103
+ function summaryToggle() {
104
+ $(".summary_toggle").click(function (e) {
105
+ e.preventDefault();
106
+ localStorage.summaryCollapsed = $(this).text();
107
+ $(".summary_toggle").each(function () {
108
+ $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
109
+ var next = $(this).parent().parent().nextAll("ul.summary").first();
110
+ if (next.hasClass("compact")) {
111
+ next.toggle();
112
+ next.nextAll("ul.summary").first().toggle();
113
+ } else if (next.hasClass("summary")) {
114
+ var list = $('<ul class="summary compact" />');
115
+ list.html(next.html());
116
+ list.find(".summary_desc, .note").remove();
117
+ list.find("a").each(function () {
118
+ $(this).html($(this).find("strong").html());
119
+ $(this).parent().html($(this)[0].outerHTML);
120
+ });
121
+ next.before(list);
122
+ next.toggle();
123
+ }
124
+ });
125
+ return false;
126
+ });
127
+ if (localStorage.summaryCollapsed == "collapse") {
128
+ $(".summary_toggle").first().click();
129
+ } else {
130
+ localStorage.summaryCollapsed = "expand";
131
+ }
132
+ }
133
+
134
+ function constantSummaryToggle() {
135
+ $(".constants_summary_toggle").click(function (e) {
136
+ e.preventDefault();
137
+ localStorage.summaryCollapsed = $(this).text();
138
+ $(".constants_summary_toggle").each(function () {
139
+ $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
140
+ var next = $(this).parent().parent().nextAll("dl.constants").first();
141
+ if (next.hasClass("compact")) {
142
+ next.toggle();
143
+ next.nextAll("dl.constants").first().toggle();
144
+ } else if (next.hasClass("constants")) {
145
+ var list = $('<dl class="constants compact" />');
146
+ list.html(next.html());
147
+ list.find("dt").each(function () {
148
+ $(this).addClass("summary_signature");
149
+ $(this).text($(this).text().split("=")[0]);
150
+ if ($(this).has(".deprecated").length) {
151
+ $(this).addClass("deprecated");
152
+ }
153
+ });
154
+ // Add the value of the constant as "Tooltip" to the summary object
155
+ list.find("pre.code").each(function () {
156
+ var dt_element = $(this).parent().prev();
157
+ var tooltip = $(this).text();
158
+ if (dt_element.hasClass("deprecated")) {
159
+ tooltip = "Deprecated. " + tooltip;
160
+ }
161
+ dt_element.attr("title", tooltip);
162
+ });
163
+ list.find(".docstring, .tags, dd").remove();
164
+ next.before(list);
165
+ next.toggle();
166
+ }
167
+ });
168
+ return false;
169
+ });
170
+ if (localStorage.summaryCollapsed == "collapse") {
171
+ $(".constants_summary_toggle").first().click();
172
+ } else {
173
+ localStorage.summaryCollapsed = "expand";
174
+ }
175
+ }
176
+
177
+ function generateTOC() {
178
+ if ($("#filecontents").length === 0) return;
179
+ var _toc = $('<ol class="top"></ol>');
180
+ var show = false;
181
+ var toc = _toc;
182
+ var counter = 0;
183
+ var tags = ["h2", "h3", "h4", "h5", "h6"];
184
+ var i;
185
+ var curli;
186
+ if ($("#filecontents h1").length > 1) tags.unshift("h1");
187
+ for (i = 0; i < tags.length; i++) {
188
+ tags[i] = "#filecontents " + tags[i];
189
+ }
190
+ var lastTag = parseInt(tags[0][1], 10);
191
+ $(tags.join(", ")).each(function () {
192
+ if ($(this).parents(".method_details .docstring").length != 0) return;
193
+ if (this.id == "filecontents") return;
194
+ show = true;
195
+ var thisTag = parseInt(this.tagName[1], 10);
196
+ if (this.id.length === 0) {
197
+ var proposedId = $(this).attr("toc-id");
198
+ if (typeof proposedId != "undefined") this.id = proposedId;
199
+ else {
200
+ var proposedId = $(this)
201
+ .text()
202
+ .replace(/[^a-z0-9-]/gi, "_");
203
+ if ($("#" + proposedId).length > 0) {
204
+ proposedId += counter;
205
+ counter++;
206
+ }
207
+ this.id = proposedId;
208
+ }
209
+ }
210
+ if (thisTag > lastTag) {
211
+ for (i = 0; i < thisTag - lastTag; i++) {
212
+ if (typeof curli == "undefined") {
213
+ curli = $("<li/>");
214
+ toc.append(curli);
215
+ }
216
+ toc = $("<ol/>");
217
+ curli.append(toc);
218
+ curli = undefined;
219
+ }
220
+ }
221
+ if (thisTag < lastTag) {
222
+ for (i = 0; i < lastTag - thisTag; i++) {
223
+ toc = toc.parent();
224
+ toc = toc.parent();
225
+ }
226
+ }
227
+ var title = $(this).attr("toc-title");
228
+ if (typeof title == "undefined") title = $(this).text();
229
+ curli = $('<li><a href="#' + this.id + '">' + title + "</a></li>");
230
+ toc.append(curli);
231
+ lastTag = thisTag;
232
+ });
233
+ if (!show) return;
234
+ html =
235
+ '<div id="toc"><p class="title hide_toc"><a href="#"><strong>Table of Contents</strong></a></p></div>';
236
+ $("#content").prepend(html);
237
+ $("#toc").append(_toc);
238
+ $("#toc .hide_toc").toggle(
239
+ function () {
240
+ $("#toc .top").slideUp("fast");
241
+ $("#toc").toggleClass("hidden");
242
+ $("#toc .title small").toggle();
243
+ },
244
+ function () {
245
+ $("#toc .top").slideDown("fast");
246
+ $("#toc").toggleClass("hidden");
247
+ $("#toc .title small").toggle();
248
+ }
249
+ );
250
+ }
251
+
252
+ function navResizer() {
253
+ const resizer = document.getElementById("resizer");
254
+ resizer.addEventListener(
255
+ "pointerdown",
256
+ function (e) {
257
+ resizer.setPointerCapture(e.pointerId);
258
+ e.preventDefault();
259
+ e.stopPropagation();
260
+ },
261
+ false
262
+ );
263
+ resizer.addEventListener(
264
+ "pointerup",
265
+ function (e) {
266
+ resizer.releasePointerCapture(e.pointerId);
267
+ e.preventDefault();
268
+ e.stopPropagation();
269
+ },
270
+ false
271
+ );
272
+ resizer.addEventListener(
273
+ "pointermove",
274
+ function (e) {
275
+ if ((e.buttons & 1) === 0) {
276
+ return;
277
+ }
278
+
279
+ sessionStorage.navWidth = e.pageX.toString();
280
+ $(".nav_wrap").css("width", Math.max(200, e.pageX));
281
+ e.preventDefault();
282
+ e.stopPropagation();
283
+ },
284
+ false
285
+ );
286
+
287
+ if (sessionStorage.navWidth) {
288
+ $(".nav_wrap").css(
289
+ "width",
290
+ Math.max(200, parseInt(sessionStorage.navWidth, 10))
291
+ );
292
+ }
293
+ }
294
+
295
+ function navExpander() {
296
+ if (typeof pathId === "undefined") return;
297
+ var done = false,
298
+ timer = setTimeout(postMessage, 500);
299
+ function postMessage() {
300
+ if (done) return;
301
+ clearTimeout(timer);
302
+ var opts = { action: "expand", path: pathId };
303
+ document.getElementById("nav").contentWindow.postMessage(opts, "*");
304
+ done = true;
305
+ }
306
+ }
307
+
308
+ function mainFocus() {
309
+ var hash = window.location.hash;
310
+ if (hash !== "" && $(hash)[0]) {
311
+ $(hash)[0].scrollIntoView();
312
+ }
313
+
314
+ setTimeout(function () {
315
+ $("#main").focus();
316
+ }, 10);
317
+ }
318
+
319
+ function navigationChange() {
320
+ // This works around the broken anchor navigation with the YARD template.
321
+ window.onpopstate = function () {
322
+ var hash = window.location.hash;
323
+ if (hash !== "" && $(hash)[0]) {
324
+ $(hash)[0].scrollIntoView();
325
+ }
326
+ };
327
+ }
328
+
329
+ $(document).ready(function () {
330
+ navResizer();
331
+ navExpander();
332
+ createSourceLinks();
333
+ createDefineLinks();
334
+ createFullTreeLinks();
335
+ searchFrameButtons();
336
+ linkSummaries();
337
+ summaryToggle();
338
+ constantSummaryToggle();
339
+ generateTOC();
340
+ mainFocus();
341
+ navigationChange();
342
+ });
343
+ };
344
+ window.__app();
345
+
346
+ window.addEventListener(
347
+ "message",
348
+ async (e) => {
349
+ if (e.data.action === "navigate") {
350
+ const response = await fetch(e.data.url);
351
+ const text = await response.text();
352
+ const parser = new DOMParser();
353
+ const doc = parser.parseFromString(text, "text/html");
354
+
355
+ const classListLink =
356
+ document.getElementById("class_list_link").classList;
357
+
358
+ const content = doc.querySelector("#main").innerHTML;
359
+ document.querySelector("#main").innerHTML = content;
360
+ document.title = doc.head.querySelector("title").innerText;
361
+ document.head.querySelectorAll("script").forEach((script) => {
362
+ if (
363
+ !script.type ||
364
+ (script.type.includes("text/javascript") && !script.src)
365
+ ) {
366
+ script.remove();
367
+ }
368
+ });
369
+
370
+ doc.head.querySelectorAll("script").forEach((script) => {
371
+ if (
372
+ !script.type ||
373
+ (script.type.includes("text/javascript") && !script.src)
374
+ ) {
375
+ const newScript = document.createElement("script");
376
+ newScript.type = "text/javascript";
377
+ newScript.textContent = script.textContent;
378
+ document.head.appendChild(newScript);
379
+ }
380
+ });
381
+
382
+ window.__app();
383
+
384
+ document.getElementById("class_list_link").classList = classListLink;
385
+
386
+ const url = new URL(e.data.url, "https://localhost");
387
+ const hash = decodeURIComponent(url.hash ?? "");
388
+ if (hash) {
389
+ document.getElementById(hash.substring(1)).scrollIntoView();
390
+ }
391
+ history.pushState({}, document.title, e.data.url);
392
+ }
393
+ },
394
+ false
395
+ );