clean-jsdoc-theme 4.2.9 → 4.2.10
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.
- package/README.md +29 -25
- package/helpers/Environment.html +3 -0
- package/package.json +1 -1
- package/static/scripts/core.js +58 -31
- package/static/scripts/core.min.js +2 -2
- package/tmpl/container.tmpl +0 -1
- package/tmpl/layout.tmpl +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# clean-jsdoc-theme
|
|
2
2
|
|
|
3
|
-
[](https://github.com/ankitskvmdam/clean-jsdoc-theme) [](https://github.com/ankitskvmdam/clean-jsdoc-theme/fork) ](https://github.com/ankitskvmdam/clean-jsdoc-theme) [](https://github.com/ankitskvmdam/clean-jsdoc-theme/fork)  [](https://github.com/ankitskvmdam/clean-jsdoc-theme/issues) [](https://github.com/ankitskvmdam/clean-jsdoc-theme/graphs/contributors) [](https://travis-ci.org/ankitskvmdam/clean-jsdoc-theme) [](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/master/LICENSE)
|
|
4
4
|
<br>
|
|
5
5
|
|
|
6
6
|
`clean-jsdoc-theme` is a beautifully crafted theme for JSDoc 3/JSDoc 4. It is a clean and fully responsive theme with loads of
|
|
@@ -117,10 +117,14 @@ To set the default theme, add the following in your JSDoc config file:
|
|
|
117
117
|
|
|
118
118
|
```json
|
|
119
119
|
"theme_opts": {
|
|
120
|
-
"default_theme": "dark" //
|
|
120
|
+
"default_theme": "dark" // "light", "fallback-dark", "fallback-light"
|
|
121
121
|
}
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
+
If you set default theme as `"fallback-dark"`, then `clean-jsdoc-theme` will try to detect user's preferred color scheme. If it will detect successfully then it will set user's preferred theme else fallback to dark theme.
|
|
125
|
+
|
|
126
|
+
Same if you set default theme as `"fallback-light"`, it will try to detect user's preferred theme. If not then fallback to light theme.
|
|
127
|
+
|
|
124
128
|
### Set base url
|
|
125
129
|
|
|
126
130
|
To set the base url, add the following in your JSDoc config file:
|
|
@@ -448,29 +452,29 @@ This will remove all symbols (members, methods ...) that come from inherited par
|
|
|
448
452
|
|
|
449
453
|
## Cheat sheet
|
|
450
454
|
|
|
451
|
-
| name | default | use case | expected value(s)
|
|
452
|
-
| ---------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
|
453
|
-
| `default_theme` | `"dark"` | To set the default theme | `"light" or "dark"`
|
|
454
|
-
| `homepageTitle` | "Home" | To set the title of homepage | `string`
|
|
455
|
-
| `title` | `null` | To set the title | `HTML` or `string`
|
|
456
|
-
| `base_url` | `/` | To set the base URL | `string`
|
|
457
|
-
| `menu` | `null` | To render extra link in navbar | Array of Object(s)
|
|
458
|
-
| `meta` | `null` | Meta tag attributes | Array of Object(s)
|
|
459
|
-
| `search` | `true` | To render search or not | `true` or `false`
|
|
460
|
-
| `codepen` | `{}` | To open code in codepen | `Object`
|
|
461
|
-
| `static_dir` | `null` | To include static dir | Array of string
|
|
462
|
-
| `create_style` | `null` | To create custom style rules | `string`
|
|
463
|
-
| `add_style_path` | `null` | To add external css libraries/files | Array of Object(s)
|
|
464
|
-
| `include_css` | `null` | To include css files | Array of string
|
|
465
|
-
| `add_scripts` | `null` | To create custom script | `string`
|
|
466
|
-
| `add_script_path` | `null` | To add external js libraries/files | Array of Object(s)
|
|
467
|
-
| `include_js` | `null` | To include js files | `string`
|
|
468
|
-
| `footer` | `null` | To render footer | `HTML` or `string`
|
|
469
|
-
| `exclude_inherited` | `false` | To exclude inherited symbols | `boolean`
|
|
470
|
-
| `sections` | `["Modules", "Classes", "Externals", "Events", "Namespaces", "Mixins", "Tutorials", "Interfaces", "Global"]` | To order navbar/sidebar sections or to hide/remove navbar/sidebar sections | `Array<SECTION_TYPE>`
|
|
471
|
-
| `displayModuleHeader` | `false` | If you want the module name to appear on its page | `boolean`
|
|
472
|
-
| `includeFilesListInHomepage` | `false` | If you want to add or remove the list of files in homepage | `boolean`
|
|
473
|
-
| `sort` | `true` | To sort the output members/methods/events | `boolean`
|
|
455
|
+
| name | default | use case | expected value(s) |
|
|
456
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
457
|
+
| `default_theme` | `"dark"` | To set the default theme | `"light", "dark"`, `"fallback-light"` or `"fallback-dark"` |
|
|
458
|
+
| `homepageTitle` | "Home" | To set the title of homepage | `string` |
|
|
459
|
+
| `title` | `null` | To set the title | `HTML` or `string` |
|
|
460
|
+
| `base_url` | `/` | To set the base URL | `string` |
|
|
461
|
+
| `menu` | `null` | To render extra link in navbar | Array of Object(s) |
|
|
462
|
+
| `meta` | `null` | Meta tag attributes | Array of Object(s) |
|
|
463
|
+
| `search` | `true` | To render search or not | `true` or `false` |
|
|
464
|
+
| `codepen` | `{}` | To open code in codepen | `Object` |
|
|
465
|
+
| `static_dir` | `null` | To include static dir | Array of string |
|
|
466
|
+
| `create_style` | `null` | To create custom style rules | `string` |
|
|
467
|
+
| `add_style_path` | `null` | To add external css libraries/files | Array of Object(s) |
|
|
468
|
+
| `include_css` | `null` | To include css files | Array of string |
|
|
469
|
+
| `add_scripts` | `null` | To create custom script | `string` |
|
|
470
|
+
| `add_script_path` | `null` | To add external js libraries/files | Array of Object(s) |
|
|
471
|
+
| `include_js` | `null` | To include js files | `string` |
|
|
472
|
+
| `footer` | `null` | To render footer | `HTML` or `string` |
|
|
473
|
+
| `exclude_inherited` | `false` | To exclude inherited symbols | `boolean` |
|
|
474
|
+
| `sections` | `["Modules", "Classes", "Externals", "Events", "Namespaces", "Mixins", "Tutorials", "Interfaces", "Global"]` | To order navbar/sidebar sections or to hide/remove navbar/sidebar sections | `Array<SECTION_TYPE>` |
|
|
475
|
+
| `displayModuleHeader` | `false` | If you want the module name to appear on its page | `boolean` |
|
|
476
|
+
| `includeFilesListInHomepage` | `false` | If you want to add or remove the list of files in homepage | `boolean` |
|
|
477
|
+
| `sort` | `true` | To sort the output members/methods/events | `boolean` |
|
|
474
478
|
|
|
475
479
|
Don't forget to add the following in your jsdoc config file, otherwise toc will not work on some pages.
|
|
476
480
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="Author" content="Ankit Kumar"><meta name="Description" content="A beautifully crafted theme for jsdoc"><script src="script.js"></script><link type="text/css" rel="stylesheet" href="style.css"><title>Class: Environment</title><!--[if lt IE 9]>
|
|
2
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
3
|
+
<![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><style>.test-create-style{background:red}</style><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body class="dark" data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><a href="/" class="sidebar-title sidebar-title-anchor">clean-jsdoc-theme</a><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="lUrjRXtWbw7TgUHpOpeIs"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-SqlJs.html">SqlJs</a></div><div class="sidebar-section-children"><a href="module-bookshelf.html">bookshelf</a></div><div class="sidebar-section-children"><a href="module-color_mixer.html">color/mixer</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="axG7kDgeAPeZ5DHapLq1d"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Alive.html">Alive</a></div><div class="sidebar-section-children"><a href="Apple.html">Apple</a></div><div class="sidebar-section-children"><a href="Database.html">Database</a></div><div class="sidebar-section-children"><a href="Energy.html">Energy</a></div><div class="sidebar-section-children"><a href="Environment.html">Environment</a></div><div class="sidebar-section-children"><a href="Statement.html">Statement</a></div><div class="sidebar-section-children"><a href="StatementIterator.html">StatementIterator</a></div><div class="sidebar-section-children"><a href="Test.html">Test</a></div><div class="sidebar-section-children"><a href="Tree.html">Tree</a></div><div class="sidebar-section-children"><a href="World.html">World</a></div><div class="sidebar-section-children"><a href="module-bookshelf.Book.html" class="has-anchor"><span class="ancestors">bookshelf~ </span>Book</a></div><div class="sidebar-section-children"><a href="module-color_mixer-Colour.html" class="has-anchor"><span class="ancestors">color_mixer~ </span>Colour</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="BWZtTwBCXCWgbevKSQKPL"><div>Events</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Apple.html#event:beEaten">beEaten</a></div><div class="sidebar-section-children"><a href="Environment.html#event:beforeDestroy">beforeDestroy</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="6udUSs5-PJoqnSItnJHu5"><div>Namespaces</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="obj.map.html">map</a></div><div class="sidebar-section-children"><a href="pieOptions.html">pieOptions</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="FTgL4gY1UQX8gtVdugX3V"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-Alive_.html">Alive</a></div><div class="sidebar-section-children"><a href="tutorial-Apple_.html">Apple</a></div><div class="sidebar-section-children"><a href="tutorial-Environment_.html">Environment</a></div><div class="sidebar-section-children"><a href="tutorial-new.html">new</a></div><div class="sidebar-section-children"><a href="tutorial-Other.html">Other</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="E4zOAQLXxH4qLBVcwgklg"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#AliveEnergy">AliveEnergy</a></div><div class="sidebar-section-children"><a href="global.html#EnergyUnit">EnergyUnit</a></div><div class="sidebar-section-children"><a href="global.html#EnvironmentConfiguration">EnvironmentConfiguration</a></div><div class="sidebar-section-children"><a href="global.html#PhotoSize">PhotoSize</a></div><div class="sidebar-section-children"><a href="global.html#SqlJs">SqlJs</a></div><div class="sidebar-section-children"><a href="global.html#SqlJsConfig">SqlJsConfig</a></div><div class="sidebar-section-children"><a href="global.html#fibonacci">fibonacci</a></div><div class="sidebar-section-children"><a href="global.html#initSqlJs">initSqlJs</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"><div class="navbar-item"><a id="github" href="https://github.com/ankitskvmdam/clean-jsdoc-theme" target="">Github</a></div><div class="navbar-item"><a id="npm" href="https://www.npmjs.com/package/clean-jsdoc-theme" target="">npm</a></div></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><header><h1 id="Environment-title" class="has-anchor">Environment</h1><div class="class-description"><p>Lorem ipsum dolor sit amet, {@link Energy} consectetur adipiscing elit. Vestibulum condimentum tempus diam. Ut eget ultricies metus, vitae ornare turpis. Vivamus lectus metus, euismod quis tortor quis, pretium semper massa. Nulla mauris sapien, faucibus vitae metus et, ultrices fringilla sem. Sed laoreet tempor odio, elementum scelerisque nunc aliquet quis.</p></div></header><article><div class="container-overview"><h2 id="constructor" class="has-anchor">Constructor</h2><h3 class="name has-anchor" id="Environment"><span class="type-signature"></span>new Environment<span class="signature">()</span></h3><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="Environment.js.html">Environment.js</a>, <a href="Environment.js.html#line6">line 6</a></li></ul></dd></div></dl></div><h2 id="members" class="subsection-title has-anchor">Members</h2><h3 class="name has-anchor" id="livingThings"><span class="type-signature"></span>livingThings<span class="type-signature"> :Array.<<a href="Alive.html">Alive</a>></span></h3><div class="description"><p>All the living things in this environment</p></div><div class="member-item-container flex"><strong>Type:</strong><ul><li><span class="param-type">Array.<<a href="Alive.html">Alive</a>></span></li></ul></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="Environment.js.html">Environment.js</a>, <a href="Environment.js.html#line12">line 12</a></li></ul></dd></div></dl><h3 class="name has-anchor" id="name"><span class="type-signature"></span>name<span class="type-signature"> :String</span></h3><div class="description"><p>The name of this environment</p></div><div class="member-item-container flex"><strong>Type:</strong><ul><li><span class="param-type">String</span></li></ul></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="Environment.js.html">Environment.js</a>, <a href="Environment.js.html#line18">line 18</a></li></ul></dd></div></dl><h2 id="methods" class="subsection-title has-anchor">Methods</h2><h3 class="name has-anchor" id="start"><span class="type-signature"></span>start<span class="signature">(config)</span></h3><div class="description"><p>Vestibulum condimentum tempus {@link Alive} diam.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>config</code></td><td class="type"><span class="param-type"><a href="global.html#EnvironmentConfiguration">EnvironmentConfiguration</a></span></td><td class="description last"></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="Environment.js.html">Environment.js</a>, <a href="Environment.js.html#line25">line 25</a></li></ul></dd></div></dl><h2 id="events" class="subsection-title has-anchor">Events</h2><h3 class="name has-anchor" id="event:beforeDestroy">beforeDestroy</h3><div class="description"><p>Lorem ipsum dolor sit amet, {@link Energy} consectetur adipiscing el</p></div><div class="method-member-container mt-20"><strong>Type:</strong><ul><li><span class="param-type"><a href="Energy.html">Energy</a></span></li></ul></div><b class="subsection-title">Properties</b><div class="allow-overflow"><table class="props"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>foo</code></td><td class="type"><span class="param-type">boolean</span></td><td class="description last"><p>aalks djlas</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="Environment.js.html">Environment.js</a>, <a href="Environment.js.html#line36">line 36</a></li></ul></dd></div></dl></article></section><footer class="footer" id="PeOAagUepe"><div class="wrapper"><div style="margin-bottom:.5rem">clean-jsdoc-theme</div>Fork: <a href="https://github.com/ankitskvmdam/clean-jsdoc-theme">https://github.com/ankitskvmdam/clean-jsdoc-theme</a></div></footer></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><a href="/" class="sidebar-title sidebar-title-anchor">clean-jsdoc-theme</a><div class="mobile-nav-links"><div class="navbar-item"><a id="github-mobile" href="https://github.com/ankitskvmdam/clean-jsdoc-theme" target="">Github</a></div><div class="navbar-item"><a id="npm-mobile" href="https://www.npmjs.com/package/clean-jsdoc-theme" target="">npm</a></div></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="lUrjRXtWbw7TgUHpOpeIs"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-SqlJs.html">SqlJs</a></div><div class="sidebar-section-children"><a href="module-bookshelf.html">bookshelf</a></div><div class="sidebar-section-children"><a href="module-color_mixer.html">color/mixer</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="axG7kDgeAPeZ5DHapLq1d"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Alive.html">Alive</a></div><div class="sidebar-section-children"><a href="Apple.html">Apple</a></div><div class="sidebar-section-children"><a href="Database.html">Database</a></div><div class="sidebar-section-children"><a href="Energy.html">Energy</a></div><div class="sidebar-section-children"><a href="Environment.html">Environment</a></div><div class="sidebar-section-children"><a href="Statement.html">Statement</a></div><div class="sidebar-section-children"><a href="StatementIterator.html">StatementIterator</a></div><div class="sidebar-section-children"><a href="Test.html">Test</a></div><div class="sidebar-section-children"><a href="Tree.html">Tree</a></div><div class="sidebar-section-children"><a href="World.html">World</a></div><div class="sidebar-section-children"><a href="module-bookshelf.Book.html" class="has-anchor"><span class="ancestors">bookshelf~ </span>Book</a></div><div class="sidebar-section-children"><a href="module-color_mixer-Colour.html" class="has-anchor"><span class="ancestors">color_mixer~ </span>Colour</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="BWZtTwBCXCWgbevKSQKPL"><div>Events</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Apple.html#event:beEaten">beEaten</a></div><div class="sidebar-section-children"><a href="Environment.html#event:beforeDestroy">beforeDestroy</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="6udUSs5-PJoqnSItnJHu5"><div>Namespaces</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="obj.map.html">map</a></div><div class="sidebar-section-children"><a href="pieOptions.html">pieOptions</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="FTgL4gY1UQX8gtVdugX3V"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-Alive_.html">Alive</a></div><div class="sidebar-section-children"><a href="tutorial-Apple_.html">Apple</a></div><div class="sidebar-section-children"><a href="tutorial-Environment_.html">Environment</a></div><div class="sidebar-section-children"><a href="tutorial-new.html">new</a></div><div class="sidebar-section-children"><a href="tutorial-Other.html">Other</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="E4zOAQLXxH4qLBVcwgklg"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#AliveEnergy">AliveEnergy</a></div><div class="sidebar-section-children"><a href="global.html#EnergyUnit">EnergyUnit</a></div><div class="sidebar-section-children"><a href="global.html#EnvironmentConfiguration">EnvironmentConfiguration</a></div><div class="sidebar-section-children"><a href="global.html#PhotoSize">PhotoSize</a></div><div class="sidebar-section-children"><a href="global.html#SqlJs">SqlJs</a></div><div class="sidebar-section-children"><a href="global.html#SqlJsConfig">SqlJsConfig</a></div><div class="sidebar-section-children"><a href="global.html#fibonacci">fibonacci</a></div><div class="sidebar-section-children"><a href="global.html#initSqlJs">initSqlJs</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">function foo(){console.log("foo")}function bar(){console.log("bar")}bar(),foo()</script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clean-jsdoc-theme",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.10",
|
|
4
4
|
"description": "A beautifully crafted theme/template for JSDoc 3. This theme/template looks and feels like a premium theme/template. This is a fully mobile responsive theme and also fully customizable theme.",
|
|
5
5
|
"main": "publish.js",
|
|
6
6
|
"scripts": {
|
package/static/scripts/core.js
CHANGED
|
@@ -11,9 +11,43 @@ var MIN_FONT_SIZE = 10;
|
|
|
11
11
|
var localStorage = window.localStorage;
|
|
12
12
|
|
|
13
13
|
function getTheme() {
|
|
14
|
-
var
|
|
14
|
+
var theme = localStorage.getItem(themeLocalStorageKey);
|
|
15
|
+
|
|
16
|
+
if (theme) return theme;
|
|
17
|
+
|
|
18
|
+
theme = document.body.getAttribute('data-theme');
|
|
19
|
+
|
|
20
|
+
switch (theme) {
|
|
21
|
+
case 'dark':
|
|
22
|
+
case 'light':
|
|
23
|
+
return theme;
|
|
24
|
+
case 'fallback-dark':
|
|
25
|
+
if (
|
|
26
|
+
// eslint-disable-next-line no-undef
|
|
27
|
+
window.matchMedia('(prefers-color-scheme)').matches &&
|
|
28
|
+
// eslint-disable-next-line no-undef
|
|
29
|
+
window.matchMedia('(prefers-color-scheme: light)').matches
|
|
30
|
+
) {
|
|
31
|
+
return 'light';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return 'dark';
|
|
15
35
|
|
|
16
|
-
|
|
36
|
+
case 'fallback-light':
|
|
37
|
+
if (
|
|
38
|
+
// eslint-disable-next-line no-undef
|
|
39
|
+
window.matchMedia('(prefers-color-scheme)').matches &&
|
|
40
|
+
// eslint-disable-next-line no-undef
|
|
41
|
+
window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
42
|
+
) {
|
|
43
|
+
return 'dark';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return 'light';
|
|
47
|
+
|
|
48
|
+
default:
|
|
49
|
+
return 'dark';
|
|
50
|
+
}
|
|
17
51
|
}
|
|
18
52
|
|
|
19
53
|
function localUpdateTheme(theme) {
|
|
@@ -47,17 +81,7 @@ function toggleTheme() {
|
|
|
47
81
|
(function () {
|
|
48
82
|
var theme = getTheme();
|
|
49
83
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (themeStoredInLocalStorage) {
|
|
53
|
-
if (theme === themeStoredInLocalStorage) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
updateTheme(themeStoredInLocalStorage);
|
|
58
|
-
} else {
|
|
59
|
-
localStorage.setItem(themeLocalStorageKey, theme);
|
|
60
|
-
}
|
|
84
|
+
updateTheme(theme);
|
|
61
85
|
})();
|
|
62
86
|
|
|
63
87
|
/**
|
|
@@ -152,8 +176,11 @@ function bringElementIntoView(element, updateHistory = true) {
|
|
|
152
176
|
*/
|
|
153
177
|
// eslint-disable-next-line no-undef
|
|
154
178
|
if (tocbotInstance) {
|
|
155
|
-
|
|
156
|
-
|
|
179
|
+
setTimeout(
|
|
180
|
+
// eslint-disable-next-line no-undef
|
|
181
|
+
() => tocbotInstance.updateTocListActiveElement(element),
|
|
182
|
+
60
|
|
183
|
+
);
|
|
157
184
|
}
|
|
158
185
|
var navbar = document.querySelector('.navbar-container');
|
|
159
186
|
var body = document.querySelector('.main-content');
|
|
@@ -252,7 +279,6 @@ function addAnchor() {
|
|
|
252
279
|
* @param {string} value
|
|
253
280
|
*/
|
|
254
281
|
function copy(value) {
|
|
255
|
-
console.log(value);
|
|
256
282
|
const el = document.createElement('textarea');
|
|
257
283
|
|
|
258
284
|
el.value = value;
|
|
@@ -460,8 +486,9 @@ function fontSizeTooltip() {
|
|
|
460
486
|
|
|
461
487
|
return `
|
|
462
488
|
<div class="font-size-tooltip">
|
|
463
|
-
<button aria-label="decrease-font-size" class="icon-button ${
|
|
464
|
-
|
|
489
|
+
<button aria-label="decrease-font-size" class="icon-button ${
|
|
490
|
+
fontSize >= MAX_FONT_SIZE ? 'disabled' : ''
|
|
491
|
+
}" onclick="decrementFont(event)">
|
|
465
492
|
<svg>
|
|
466
493
|
<use xlink:href="#minus-icon"></use>
|
|
467
494
|
</svg>
|
|
@@ -469,8 +496,9 @@ function fontSizeTooltip() {
|
|
|
469
496
|
<div class="font-size-text" id="b77a68a492f343baabea06fad81f651e">
|
|
470
497
|
${fontSize}
|
|
471
498
|
</div>
|
|
472
|
-
<button aria-label="increase-font-size" class="icon-button ${
|
|
473
|
-
|
|
499
|
+
<button aria-label="increase-font-size" class="icon-button ${
|
|
500
|
+
fontSize <= MIN_FONT_SIZE ? 'disabled' : ''
|
|
501
|
+
}" onclick="incrementFont(event)">
|
|
474
502
|
<svg>
|
|
475
503
|
<use xlink:href="#add-icon"></use>
|
|
476
504
|
</svg>
|
|
@@ -490,31 +518,31 @@ function initTooltip() {
|
|
|
490
518
|
// eslint-disable-next-line no-undef
|
|
491
519
|
tippy('.theme-toggle', {
|
|
492
520
|
content: 'Toggle Theme',
|
|
493
|
-
delay: 500
|
|
521
|
+
delay: 500,
|
|
494
522
|
});
|
|
495
523
|
|
|
496
524
|
// eslint-disable-next-line no-undef
|
|
497
525
|
tippy('.search-button', {
|
|
498
526
|
content: 'Search',
|
|
499
|
-
delay: 500
|
|
527
|
+
delay: 500,
|
|
500
528
|
});
|
|
501
529
|
|
|
502
530
|
// eslint-disable-next-line no-undef
|
|
503
531
|
tippy('.font-size', {
|
|
504
532
|
content: 'Change font size',
|
|
505
|
-
delay: 500
|
|
533
|
+
delay: 500,
|
|
506
534
|
});
|
|
507
535
|
|
|
508
536
|
// eslint-disable-next-line no-undef
|
|
509
537
|
tippy('.codepen-button', {
|
|
510
538
|
content: 'Open code in CodePen',
|
|
511
|
-
placement: 'left'
|
|
539
|
+
placement: 'left',
|
|
512
540
|
});
|
|
513
541
|
|
|
514
542
|
// eslint-disable-next-line no-undef
|
|
515
543
|
tippy('.copy-code', {
|
|
516
544
|
content: 'Copy this code',
|
|
517
|
-
placement: 'left'
|
|
545
|
+
placement: 'left',
|
|
518
546
|
});
|
|
519
547
|
|
|
520
548
|
// eslint-disable-next-line no-undef
|
|
@@ -523,7 +551,7 @@ function initTooltip() {
|
|
|
523
551
|
trigger: 'click',
|
|
524
552
|
interactive: true,
|
|
525
553
|
allowHTML: true,
|
|
526
|
-
placement: 'left'
|
|
554
|
+
placement: 'left',
|
|
527
555
|
});
|
|
528
556
|
}
|
|
529
557
|
|
|
@@ -624,13 +652,13 @@ function onDomContentLoaded() {
|
|
|
624
652
|
// we are able to cross-check the correctness of
|
|
625
653
|
// result.
|
|
626
654
|
obj.el.parentNode.setAttribute('data-lang', 'code');
|
|
627
|
-
}
|
|
655
|
+
},
|
|
628
656
|
});
|
|
629
657
|
// eslint-disable-next-line no-undef
|
|
630
658
|
hljs.highlightAll();
|
|
631
659
|
// eslint-disable-next-line no-undef
|
|
632
660
|
hljs.initLineNumbersOnLoad({
|
|
633
|
-
singleLine: true
|
|
661
|
+
singleLine: true,
|
|
634
662
|
});
|
|
635
663
|
|
|
636
664
|
// Highlight complete
|
|
@@ -663,13 +691,12 @@ window.addEventListener('hashchange', (event) => {
|
|
|
663
691
|
});
|
|
664
692
|
|
|
665
693
|
// eslint-disable-next-line no-undef
|
|
666
|
-
window.addEventListener('storage', event => {
|
|
694
|
+
window.addEventListener('storage', (event) => {
|
|
667
695
|
if (event.newValue === 'undefined') return;
|
|
668
696
|
|
|
669
697
|
initTooltip();
|
|
670
698
|
|
|
671
|
-
if (event.key === themeLocalStorageKey)
|
|
672
|
-
localUpdateTheme(event.newValue);
|
|
699
|
+
if (event.key === themeLocalStorageKey) localUpdateTheme(event.newValue);
|
|
673
700
|
if (event.key === fontSizeLocalStorageKey)
|
|
674
701
|
localUpdateFontSize(event.newValue);
|
|
675
702
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var accordionLocalStorageKey="accordion-id",themeLocalStorageKey="theme",fontSizeLocalStorageKey="font-size",html=document.querySelector("html"),MAX_FONT_SIZE=30,MIN_FONT_SIZE=10,localStorage=window.localStorage;function getTheme(){return document.body.getAttribute("data-theme")}function localUpdateTheme(e){var t=document.body,o=document.querySelectorAll(".theme-svg-use"),n="dark"===e?"#light-theme-icon":"#dark-theme-icon";t.setAttribute("data-theme",e),t.classList.remove("dark","light"),t.classList.add(e),o.forEach(function(e){e.setAttribute("xlink:href",n)})}function updateTheme(e){localUpdateTheme(e),localStorage.setItem(themeLocalStorageKey,e)}function toggleTheme(){updateTheme("dark"===document.body.getAttribute("data-theme")?"light":"dark")}function setAccordionIdToLocalStorage(e){var t=JSON.parse(localStorage.getItem(accordionLocalStorageKey));t[e]=e,localStorage.setItem(accordionLocalStorageKey,JSON.stringify(t))}function removeAccordionIdFromLocalStorage(e){var t=JSON.parse(localStorage.getItem(accordionLocalStorageKey));delete t[e],localStorage.setItem(accordionLocalStorageKey,JSON.stringify(t))}function getAccordionIdsFromLocalStorage(){return JSON.parse(localStorage.getItem(accordionLocalStorageKey))||{}}function toggleAccordion(e){"false"===e.getAttribute("data-isopen")?(e.setAttribute("data-isopen","true"),setAccordionIdToLocalStorage(e.id)):(e.setAttribute("data-isopen","false"),removeAccordionIdFromLocalStorage(e.id))}function initAccordion(){void 0!==localStorage.getItem(accordionLocalStorageKey)&&null!==localStorage.getItem(accordionLocalStorageKey)||localStorage.setItem(accordionLocalStorageKey,"{}");var e=document.querySelectorAll(".sidebar-section-title"),t=getAccordionIdsFromLocalStorage();e.forEach(function(e){e.addEventListener("click",function(){toggleAccordion(e)}),e.id in t&&toggleAccordion(e)})}function isSourcePage(){return Boolean(document.querySelector("#source-page"))}function bringElementIntoView(e,t=!0){var o,n,i,c;e&&(tocbotInstance&&setTimeout(()=>tocbotInstance.updateTocListActiveElement(e),60),o=document.querySelector(".navbar-container"),n=document.querySelector(".main-content"),i=e.getBoundingClientRect().top,c=16,o&&(c+=o.scrollHeight),n&&n.scrollBy(0,i-c),t&&history.pushState(null,null,"#"+e.id))}function bringLinkToView(e){e.preventDefault(),e.stopPropagation();var e=e.currentTarget.getAttribute("href");!e||(e=document.getElementById(e.slice(1)))&&bringElementIntoView(e)}function bringIdToViewOnMount(){var e,t;isSourcePage()||""!==(e=window.location.hash)&&((t=document.getElementById(e.slice(1)))||(e=decodeURI(e),t=document.getElementById(e.slice(1))),t&&bringElementIntoView(t,!1))}function createAnchorElement(e){var t=document.createElement("a");return t.textContent="#",t.href="#"+e,t.classList.add("link-anchor"),t.onclick=bringLinkToView,t}function addAnchor(){var e=document.querySelector(".main-content").querySelector("section");[e.querySelectorAll("h1"),e.querySelectorAll("h2"),e.querySelectorAll("h3"),e.querySelectorAll("h4")].forEach(function(e){e.forEach(function(e){var t=createAnchorElement(e.id);e.classList.add("has-anchor"),e.append(t)})})}function copy(e){
|
|
1
|
+
var accordionLocalStorageKey="accordion-id",themeLocalStorageKey="theme",fontSizeLocalStorageKey="font-size",html=document.querySelector("html"),MAX_FONT_SIZE=30,MIN_FONT_SIZE=10,localStorage=window.localStorage;function getTheme(){var e=localStorage.getItem(themeLocalStorageKey);if(e)return e;switch(e=document.body.getAttribute("data-theme")){case"dark":case"light":return e;case"fallback-dark":return window.matchMedia("(prefers-color-scheme)").matches&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";case"fallback-light":return window.matchMedia("(prefers-color-scheme)").matches&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";default:return"dark"}}function localUpdateTheme(e){var t=document.body,o=document.querySelectorAll(".theme-svg-use"),n="dark"===e?"#light-theme-icon":"#dark-theme-icon";t.setAttribute("data-theme",e),t.classList.remove("dark","light"),t.classList.add(e),o.forEach(function(e){e.setAttribute("xlink:href",n)})}function updateTheme(e){localUpdateTheme(e),localStorage.setItem(themeLocalStorageKey,e)}function toggleTheme(){updateTheme("dark"===document.body.getAttribute("data-theme")?"light":"dark")}function setAccordionIdToLocalStorage(e){var t=JSON.parse(localStorage.getItem(accordionLocalStorageKey));t[e]=e,localStorage.setItem(accordionLocalStorageKey,JSON.stringify(t))}function removeAccordionIdFromLocalStorage(e){var t=JSON.parse(localStorage.getItem(accordionLocalStorageKey));delete t[e],localStorage.setItem(accordionLocalStorageKey,JSON.stringify(t))}function getAccordionIdsFromLocalStorage(){return JSON.parse(localStorage.getItem(accordionLocalStorageKey))||{}}function toggleAccordion(e){"false"===e.getAttribute("data-isopen")?(e.setAttribute("data-isopen","true"),setAccordionIdToLocalStorage(e.id)):(e.setAttribute("data-isopen","false"),removeAccordionIdFromLocalStorage(e.id))}function initAccordion(){void 0!==localStorage.getItem(accordionLocalStorageKey)&&null!==localStorage.getItem(accordionLocalStorageKey)||localStorage.setItem(accordionLocalStorageKey,"{}");var e=document.querySelectorAll(".sidebar-section-title"),t=getAccordionIdsFromLocalStorage();e.forEach(function(e){e.addEventListener("click",function(){toggleAccordion(e)}),e.id in t&&toggleAccordion(e)})}function isSourcePage(){return Boolean(document.querySelector("#source-page"))}function bringElementIntoView(e,t=!0){var o,n,i,c;e&&(tocbotInstance&&setTimeout(()=>tocbotInstance.updateTocListActiveElement(e),60),o=document.querySelector(".navbar-container"),n=document.querySelector(".main-content"),i=e.getBoundingClientRect().top,c=16,o&&(c+=o.scrollHeight),n&&n.scrollBy(0,i-c),t&&history.pushState(null,null,"#"+e.id))}function bringLinkToView(e){e.preventDefault(),e.stopPropagation();var e=e.currentTarget.getAttribute("href");!e||(e=document.getElementById(e.slice(1)))&&bringElementIntoView(e)}function bringIdToViewOnMount(){var e,t;isSourcePage()||""!==(e=window.location.hash)&&((t=document.getElementById(e.slice(1)))||(e=decodeURI(e),t=document.getElementById(e.slice(1))),t&&bringElementIntoView(t,!1))}function createAnchorElement(e){var t=document.createElement("a");return t.textContent="#",t.href="#"+e,t.classList.add("link-anchor"),t.onclick=bringLinkToView,t}function addAnchor(){var e=document.querySelector(".main-content").querySelector("section");[e.querySelectorAll("h1"),e.querySelectorAll("h2"),e.querySelectorAll("h3"),e.querySelectorAll("h4")].forEach(function(e){e.forEach(function(e){var t=createAnchorElement(e.id);e.classList.add("has-anchor"),e.append(t)})})}function copy(e){const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function showTooltip(e){var t=document.getElementById(e);t.classList.add("show-tooltip"),setTimeout(function(){t.classList.remove("show-tooltip")},3e3)}function copyFunction(e){var t=document.getElementById(e);copy((t.querySelector(".linenums")||t.querySelector("code")).innerText.trim().replace(/(^\t)/gm,"")),showTooltip("tooltip-"+e)}function hideTocOnSourcePage(){isSourcePage()&&(document.querySelector(".toc-container").style.display="none")}function getPreTopBar(e,t=""){e='<button aria-label="copy code" class="icon-button copy-code" onclick="copyFunction(\''+e+'\')"><svg class="sm-icon" alt="click to copy"><use xlink:href="#copy-icon"></use></svg>'+('<div class="tooltip" id="tooltip-'+e+'">Copied!</div>')+"</button>";return'<div class="pre-top-bar-container">'+('<div class="code-lang-name-container"><div class="code-lang-name">'+t.toLocaleUpperCase()+"</div></div>")+e+"</div>"}function getPreDiv(){var e=document.createElement("div");return e.classList.add("pre-div"),e}function processAllPre(){var e=document.querySelectorAll("pre"),t=document.querySelector("#PeOAagUepe"),o=document.querySelector("#VuAckcnZhf"),n=0,i=0,c=(t&&(i=t.getBoundingClientRect().height),o&&(n=o.getBoundingClientRect().height),window.innerHeight-n-i-250);e.forEach(function(e,t){var o,n=e.parentNode;n&&"true"===n.getAttribute("data-skip-pre-process")||(n=getPreDiv(),o=getPreTopBar(t="ScDloZOMdL"+t,e.getAttribute("data-lang")||"code"),n.innerHTML=o,e.style.maxHeight=c+"px",e.id=t,e.classList.add("prettyprint"),e.parentNode.insertBefore(n,e),n.appendChild(e))})}function highlightAndBringLineIntoView(){var e=window.location.hash.replace("#line","");try{var t='[data-line-number="'+e+'"',o=document.querySelector(t);o.scrollIntoView(),o.parentNode.classList.add("selected")}catch(e){console.error(e)}}function getFontSize(){var e=16;try{e=Number.parseInt(html.style.fontSize.split("px")[0],10)}catch(e){console.log(e)}return e}function localUpdateFontSize(e){html.style.fontSize=e+"px";var t=document.querySelector("#b77a68a492f343baabea06fad81f651e");t&&(t.innerHTML=e)}function updateFontSize(e){localUpdateFontSize(e),localStorage.setItem(fontSizeLocalStorageKey,e)}function incrementFont(e){var t=getFontSize();t<MAX_FONT_SIZE&&updateFontSize(t+1)}function decrementFont(e){var t=getFontSize();MIN_FONT_SIZE<t&&updateFontSize(t-1)}function fontSizeTooltip(){var e=getFontSize();return`
|
|
2
2
|
<div class="font-size-tooltip">
|
|
3
3
|
<button aria-label="decrease-font-size" class="icon-button ${MAX_FONT_SIZE<=e?"disabled":""}" onclick="decrementFont(event)">
|
|
4
4
|
<svg>
|
|
@@ -20,4 +20,4 @@ var accordionLocalStorageKey="accordion-id",themeLocalStorageKey="theme",fontSiz
|
|
|
20
20
|
</button>
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
|
-
`}function initTooltip(){tippy(".theme-toggle",{content:"Toggle Theme",delay:500}),tippy(".search-button",{content:"Search",delay:500}),tippy(".font-size",{content:"Change font size",delay:500}),tippy(".codepen-button",{content:"Open code in CodePen",placement:"left"}),tippy(".copy-code",{content:"Copy this code",placement:"left"}),tippy(".font-size",{content:fontSizeTooltip(),trigger:"click",interactive:!0,allowHTML:!0,placement:"left"})}function fixTable(){for(const t of document.querySelectorAll("table")){if(t.classList.contains("hljs-ln"))return;var e=document.createElement("div");e.classList.add("table-div"),t.parentNode.insertBefore(e,t),e.appendChild(t)}}function hideMobileMenu(){var e=document.querySelector("#mobile-sidebar"),t=document.querySelector("#mobile-menu"),o=t.querySelector("use");e&&e.classList.remove("show"),t&&t.setAttribute("data-isopen","false"),o&&o.setAttribute("xlink:href","#menu-icon")}function showMobileMenu(){var e=document.querySelector("#mobile-sidebar"),t=document.querySelector("#mobile-menu"),o=t.querySelector("use");e&&e.classList.add("show"),t&&t.setAttribute("data-isopen","true"),o&&o.setAttribute("xlink:href","#close-icon")}function onMobileMenuClick(){("true"===document.querySelector("#mobile-menu").getAttribute("data-isopen")?hideMobileMenu:showMobileMenu)()}function initMobileMenu(){var e=document.querySelector("#mobile-menu");e&&e.addEventListener("click",onMobileMenuClick)}function addHrefToSidebarTitle(){document.querySelectorAll(".sidebar-title-anchor").forEach(function(e){e.setAttribute("href",baseURL)})}function onDomContentLoaded(){var e=document.querySelectorAll(".theme-toggle");initMobileMenu(),e&&e.forEach(function(e){e.addEventListener("click",toggleTheme)}),hljs.addPlugin({"after:highlightElement":function(e){e.el.parentNode.setAttribute("data-lang","code")}}),hljs.highlightAll(),hljs.initLineNumbersOnLoad({singleLine:!0}),initAccordion(),addAnchor(),processAllPre(),hideTocOnSourcePage(),setTimeout(function(){bringIdToViewOnMount(),isSourcePage()&&highlightAndBringLineIntoView()},1e3),initTooltip(),fixTable(),addHrefToSidebarTitle()}
|
|
23
|
+
`}function initTooltip(){tippy(".theme-toggle",{content:"Toggle Theme",delay:500}),tippy(".search-button",{content:"Search",delay:500}),tippy(".font-size",{content:"Change font size",delay:500}),tippy(".codepen-button",{content:"Open code in CodePen",placement:"left"}),tippy(".copy-code",{content:"Copy this code",placement:"left"}),tippy(".font-size",{content:fontSizeTooltip(),trigger:"click",interactive:!0,allowHTML:!0,placement:"left"})}function fixTable(){for(const t of document.querySelectorAll("table")){if(t.classList.contains("hljs-ln"))return;var e=document.createElement("div");e.classList.add("table-div"),t.parentNode.insertBefore(e,t),e.appendChild(t)}}function hideMobileMenu(){var e=document.querySelector("#mobile-sidebar"),t=document.querySelector("#mobile-menu"),o=t.querySelector("use");e&&e.classList.remove("show"),t&&t.setAttribute("data-isopen","false"),o&&o.setAttribute("xlink:href","#menu-icon")}function showMobileMenu(){var e=document.querySelector("#mobile-sidebar"),t=document.querySelector("#mobile-menu"),o=t.querySelector("use");e&&e.classList.add("show"),t&&t.setAttribute("data-isopen","true"),o&&o.setAttribute("xlink:href","#close-icon")}function onMobileMenuClick(){("true"===document.querySelector("#mobile-menu").getAttribute("data-isopen")?hideMobileMenu:showMobileMenu)()}function initMobileMenu(){var e=document.querySelector("#mobile-menu");e&&e.addEventListener("click",onMobileMenuClick)}function addHrefToSidebarTitle(){document.querySelectorAll(".sidebar-title-anchor").forEach(function(e){e.setAttribute("href",baseURL)})}function onDomContentLoaded(){var e=document.querySelectorAll(".theme-toggle");initMobileMenu(),e&&e.forEach(function(e){e.addEventListener("click",toggleTheme)}),hljs.addPlugin({"after:highlightElement":function(e){e.el.parentNode.setAttribute("data-lang","code")}}),hljs.highlightAll(),hljs.initLineNumbersOnLoad({singleLine:!0}),initAccordion(),addAnchor(),processAllPre(),hideTocOnSourcePage(),setTimeout(function(){bringIdToViewOnMount(),isSourcePage()&&highlightAndBringLineIntoView()},1e3),initTooltip(),fixTable(),addHrefToSidebarTitle()}updateTheme(getTheme()),function(){var e=getFontSize(),t=localStorage.getItem(fontSizeLocalStorageKey);t?(t=Number.parseInt(t,10))!==e&&updateFontSize(t):updateFontSize(e)}(),window.addEventListener("DOMContentLoaded",onDomContentLoaded),window.addEventListener("hashchange",e=>{e=new URL(e.newURL);""!==e.hash&&bringIdToViewOnMount(e.hash)}),window.addEventListener("storage",e=>{"undefined"!==e.newValue&&(initTooltip(),e.key===themeLocalStorageKey&&localUpdateTheme(e.newValue),e.key===fontSizeLocalStorageKey&&localUpdateFontSize(e.newValue))});
|
package/tmpl/container.tmpl
CHANGED