clean-jsdoc-theme 4.2.9 → 4.2.11
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 +92 -40
- package/helpers/Environment.html +3 -0
- package/jsdoc-config.json +1 -1
- package/package.json +1 -1
- package/publish.js +0 -1
- package/static/scripts/core.js +58 -31
- package/static/scripts/core.min.js +23 -23
- package/tmpl/container.tmpl +0 -1
- package/tmpl/examples.tmpl +11 -4
- package/tmpl/layout.tmpl +1 -1
- package/tmpl/method.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:
|
|
@@ -312,6 +316,41 @@ only loaded if user wants to search anything.
|
|
|
312
316
|
`options` can be any valid CodePen option. For more
|
|
313
317
|
visit: [Codepen Prefill options](https://blog.codepen.io/documentation/prefill/#all-the-json-options-0)
|
|
314
318
|
|
|
319
|
+
If you want to add some js in the beginning of your example then you can use `js` option.
|
|
320
|
+
|
|
321
|
+
```json
|
|
322
|
+
"theme_opts": {
|
|
323
|
+
"codepen": {
|
|
324
|
+
"enable_for": ["examples"],
|
|
325
|
+
"options": {
|
|
326
|
+
"js_external": "https://code.jquery.com/jquery-3.6.0.min.js",
|
|
327
|
+
"js_pre_processor": "babel"
|
|
328
|
+
"js": "import Something from 'some-package'"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Let say you have an example as follows:
|
|
335
|
+
|
|
336
|
+
```js
|
|
337
|
+
/**
|
|
338
|
+
* @example
|
|
339
|
+
* let a = Something.fn()
|
|
340
|
+
* console.log(a) // Return value of something
|
|
341
|
+
*/
|
|
342
|
+
const a;
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
In codepen the above `@example` will look like:
|
|
346
|
+
|
|
347
|
+
```js
|
|
348
|
+
import Something from 'some-package';
|
|
349
|
+
|
|
350
|
+
let a = Something.fn();
|
|
351
|
+
console.log(a); // Return value of something
|
|
352
|
+
```
|
|
353
|
+
|
|
315
354
|
### Add static dir
|
|
316
355
|
|
|
317
356
|
To include static files:
|
|
@@ -337,7 +376,7 @@ To create custom style rules. Example:
|
|
|
337
376
|
Use this option to add third party css library. If you want to add your own custom css file then consider
|
|
338
377
|
using [Add custom css files](#add-custom-css-files)
|
|
339
378
|
|
|
340
|
-
> Note: you have to pass an array of objects. Each object key will be an attribute inside the generated
|
|
379
|
+
> Note: you have to pass an array of objects. Each object key will be an attribute inside the generated style tag.
|
|
341
380
|
|
|
342
381
|
Example:
|
|
343
382
|
|
|
@@ -368,14 +407,16 @@ file.
|
|
|
368
407
|
|
|
369
408
|
### Add scripts
|
|
370
409
|
|
|
371
|
-
|
|
410
|
+
If you wish to incorporate JavaScript functions that execute when a user accesses a webpage, you can utilize the add_scripts option for this purpose. For instance, suppose you want to display a notification dialog when a user visits the webpage located at https://place-where-my-docs-are/SomeClass.html. You want to notify users that they should refrain from utilizing this class. To accomplish this, you can proceed as follows:
|
|
372
411
|
|
|
373
412
|
```json
|
|
374
413
|
"theme_opts": {
|
|
375
|
-
"add_scripts": "function
|
|
414
|
+
"add_scripts": "function showAlert(){ if (window.location.pathname === '/SomeClass.html') { alert('Do not use this class') } } showAlert();",
|
|
376
415
|
}
|
|
377
416
|
```
|
|
378
417
|
|
|
418
|
+
Writing js code like above can get tricky and complex. You can consider `include_js`.
|
|
419
|
+
|
|
379
420
|
### Add script paths
|
|
380
421
|
|
|
381
422
|
Use this option to add third party js library. If you want to add your own custom script file then consider
|
|
@@ -404,11 +445,33 @@ This will not flatten the directory. Directory structure will be kept as it is.
|
|
|
404
445
|
|
|
405
446
|
### Add custom script files
|
|
406
447
|
|
|
407
|
-
|
|
448
|
+
If you wish to run some local/custom javascript then you can include them via `include_js`.
|
|
449
|
+
|
|
450
|
+
Lets say you want to show some custom message depending on url. You can create a js file as follows:
|
|
451
|
+
|
|
452
|
+
```js
|
|
453
|
+
// static/showAlert.js
|
|
454
|
+
function showCustomAlertMessage() {
|
|
455
|
+
const pathname = window.location.pathname;
|
|
456
|
+
|
|
457
|
+
switch (pathname) {
|
|
458
|
+
case '/SomeClass.html':
|
|
459
|
+
return alert("Please don't use this class");
|
|
460
|
+
case '/OtherPage.html':
|
|
461
|
+
return alert('Wonderful!');
|
|
462
|
+
default:
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
showCustomAlert();
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
Assuming the above js file is stored in `./static/showAlert.js`. To include you can do:
|
|
408
471
|
|
|
409
472
|
```json
|
|
410
473
|
"theme_opts": {
|
|
411
|
-
"include_js": ["./static/
|
|
474
|
+
"include_js": ["./static/showAlert.js"]
|
|
412
475
|
}
|
|
413
476
|
```
|
|
414
477
|
|
|
@@ -436,41 +499,30 @@ members/methods/events will be in the order they are in code/source.
|
|
|
436
499
|
}
|
|
437
500
|
```
|
|
438
501
|
|
|
439
|
-
### To exclude inherited
|
|
440
|
-
|
|
441
|
-
To exclude inherited symbols. Example:
|
|
442
|
-
|
|
443
|
-
```json
|
|
444
|
-
"exclude_inherited": true
|
|
445
|
-
```
|
|
446
|
-
|
|
447
|
-
This will remove all symbols (members, methods ...) that come from inherited parents.
|
|
448
|
-
|
|
449
502
|
## Cheat sheet
|
|
450
503
|
|
|
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
|
-
| `
|
|
470
|
-
| `
|
|
471
|
-
| `
|
|
472
|
-
| `
|
|
473
|
-
| `sort` | `true` | To sort the output members/methods/events | `boolean` |
|
|
504
|
+
| name | default | use case | expected value(s) |
|
|
505
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
506
|
+
| `default_theme` | `"dark"` | To set the default theme | `"light", "dark"`, `"fallback-light"` or `"fallback-dark"` |
|
|
507
|
+
| `homepageTitle` | "Home" | To set the title of homepage | `string` |
|
|
508
|
+
| `title` | `null` | To set the title | `HTML` or `string` |
|
|
509
|
+
| `base_url` | `/` | To set the base URL | `string` |
|
|
510
|
+
| `menu` | `null` | To render extra link in navbar | Array of Object(s) |
|
|
511
|
+
| `meta` | `null` | Meta tag attributes | Array of Object(s) |
|
|
512
|
+
| `search` | `true` | To render search or not | `true` or `false` |
|
|
513
|
+
| `codepen` | `{}` | To open code in codepen | `Object` |
|
|
514
|
+
| `static_dir` | `null` | To include static dir | Array of string |
|
|
515
|
+
| `create_style` | `null` | To create custom style rules | `string` |
|
|
516
|
+
| `add_style_path` | `null` | To add external css libraries/files | Array of Object(s) |
|
|
517
|
+
| `include_css` | `null` | To include css files | Array of string |
|
|
518
|
+
| `add_scripts` | `null` | To create custom script | `string` |
|
|
519
|
+
| `add_script_path` | `null` | To add external js libraries/files | Array of Object(s) |
|
|
520
|
+
| `include_js` | `null` | To include js files | `string` |
|
|
521
|
+
| `footer` | `null` | To render footer | `HTML` or `string` |
|
|
522
|
+
| `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>` |
|
|
523
|
+
| `displayModuleHeader` | `false` | If you want the module name to appear on its page | `boolean` |
|
|
524
|
+
| `includeFilesListInHomepage` | `false` | If you want to add or remove the list of files in homepage | `boolean` |
|
|
525
|
+
| `sort` | `true` | To sort the output members/methods/events | `boolean` |
|
|
474
526
|
|
|
475
527
|
Don't forget to add the following in your jsdoc config file, otherwise toc will not work on some pages.
|
|
476
528
|
|
|
@@ -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/jsdoc-config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clean-jsdoc-theme",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.11",
|
|
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/publish.js
CHANGED
|
@@ -895,7 +895,6 @@ exports.publish = async function (taffyData, opts, tutorials) {
|
|
|
895
895
|
view.resizeable = resizeable(themeOpts);
|
|
896
896
|
view.codepen = codepen(themeOpts);
|
|
897
897
|
view.baseURL = getBaseURL(themeOpts);
|
|
898
|
-
view.excludeInherited = Boolean(themeOpts.exclude_inherited);
|
|
899
898
|
attachModuleSymbols(
|
|
900
899
|
find({ longname: { left: 'module:' } }),
|
|
901
900
|
members.modules
|
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,23 +1,23 @@
|
|
|
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){
|
|
2
|
-
<div class="font-size-tooltip">
|
|
3
|
-
<button aria-label="decrease-font-size" class="icon-button ${MAX_FONT_SIZE<=e?"disabled":""}" onclick="decrementFont(event)">
|
|
4
|
-
<svg>
|
|
5
|
-
<use xlink:href="#minus-icon"></use>
|
|
6
|
-
</svg>
|
|
7
|
-
</button>
|
|
8
|
-
<div class="font-size-text" id="b77a68a492f343baabea06fad81f651e">
|
|
9
|
-
${e}
|
|
10
|
-
</div>
|
|
11
|
-
<button aria-label="increase-font-size" class="icon-button ${e<=MIN_FONT_SIZE?"disabled":""}" onclick="incrementFont(event)">
|
|
12
|
-
<svg>
|
|
13
|
-
<use xlink:href="#add-icon"></use>
|
|
14
|
-
</svg>
|
|
15
|
-
</button>
|
|
16
|
-
<button class="icon-button" onclick="updateFontSize(16)">
|
|
17
|
-
<svg>
|
|
18
|
-
<use xlink:href="#reset-icon"></use>
|
|
19
|
-
</svg>
|
|
20
|
-
</button>
|
|
21
|
-
</div>
|
|
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()}
|
|
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
|
+
<div class="font-size-tooltip">
|
|
3
|
+
<button aria-label="decrease-font-size" class="icon-button ${MAX_FONT_SIZE<=e?"disabled":""}" onclick="decrementFont(event)">
|
|
4
|
+
<svg>
|
|
5
|
+
<use xlink:href="#minus-icon"></use>
|
|
6
|
+
</svg>
|
|
7
|
+
</button>
|
|
8
|
+
<div class="font-size-text" id="b77a68a492f343baabea06fad81f651e">
|
|
9
|
+
${e}
|
|
10
|
+
</div>
|
|
11
|
+
<button aria-label="increase-font-size" class="icon-button ${e<=MIN_FONT_SIZE?"disabled":""}" onclick="incrementFont(event)">
|
|
12
|
+
<svg>
|
|
13
|
+
<use xlink:href="#add-icon"></use>
|
|
14
|
+
</svg>
|
|
15
|
+
</button>
|
|
16
|
+
<button class="icon-button" onclick="updateFontSize(16)">
|
|
17
|
+
<svg>
|
|
18
|
+
<use xlink:href="#reset-icon"></use>
|
|
19
|
+
</svg>
|
|
20
|
+
</button>
|
|
21
|
+
</div>
|
|
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()}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
package/tmpl/examples.tmpl
CHANGED
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
data.forEach(function(example) {
|
|
8
8
|
|
|
9
|
-
var jsonString = JSON.stringify(example.code)
|
|
10
|
-
.replace(/"/g, """)
|
|
11
|
-
.replace(/'/g, "'");
|
|
12
9
|
if (example.caption) {
|
|
13
10
|
?>
|
|
14
11
|
<p class="code-caption"><?js= example.caption ?></p>
|
|
@@ -20,13 +17,23 @@
|
|
|
20
17
|
if(enable_for.findIndex(function (val) { return val === "examples"}) !== -1) {
|
|
21
18
|
var options = codepen.options || {};
|
|
22
19
|
var optionsString = '';
|
|
23
|
-
|
|
20
|
+
|
|
21
|
+
var code = `${options.js}
|
|
22
|
+
${example.code}
|
|
23
|
+
`
|
|
24
|
+
|
|
25
|
+
var jsonString = JSON.stringify(code)
|
|
26
|
+
.replace(/"/g, """)
|
|
27
|
+
.replace(/'/g, "'");
|
|
28
|
+
|
|
29
|
+
var optionsKey = Object.keys(options).filter((key) => key !== 'js' )
|
|
24
30
|
optionsKey.map((key, idx) => {
|
|
25
31
|
optionsString += '"' + key +'": "' + options[key].replace(/"/g, """).replace(/'/g, "'") + '"';
|
|
26
32
|
if(idx !== optionsKey.length - 1) {
|
|
27
33
|
optionsString += ','
|
|
28
34
|
}
|
|
29
35
|
})
|
|
36
|
+
|
|
30
37
|
?>
|
|
31
38
|
<form action="https://codepen.io/pen/define" method="POST" target="_blank" class="codepen-form">
|
|
32
39
|
<input type="hidden" name="data" value='{"title": "<?js= example.caption || 'Example' ?>", "js": <?js= jsonString ?>, <?js= optionsString ?> }' />
|
package/tmpl/layout.tmpl
CHANGED
package/tmpl/method.tmpl
CHANGED
|
@@ -49,7 +49,7 @@ var self = this;
|
|
|
49
49
|
</div>
|
|
50
50
|
<?js } ?>
|
|
51
51
|
|
|
52
|
-
<?js if (data.params && params.length) { ?>
|
|
52
|
+
<?js if (data.params && params.length && !data.hideconstructor) { ?>
|
|
53
53
|
<div class="method-member-container flex flex-col w-100 overflow-auto mt-20">
|
|
54
54
|
<strong>Parameters:</strong>
|
|
55
55
|
<?js= this.partial('params.tmpl', params) ?>
|