summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-10-19 12:36:09 +0200
committerJo-Philipp Wich <jo@mein.io>2023-10-19 12:36:09 +0200
commit07c03173d4e6a30953f92fa88ed29b0b956c9106 (patch)
treebb53a5ea16dc7f52fdd7bb3d9a237fab67a10b5e
parent6ca08b05a93d6286e5d6a1e5ef779913fa6d644a (diff)
jsdoc: switch to own custom theme
Switch to a custom fork of the clean jsdoc theme to address a number of quirks and to directly incorporate CSS and markup changes. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--docs/ucode.css94
-rw-r--r--docs/ucode.js39
-rw-r--r--jsdoc/conf.json5
-rw-r--r--package.json2
4 files changed, 2 insertions, 138 deletions
diff --git a/docs/ucode.css b/docs/ucode.css
index 966228a..5787ae7 100644
--- a/docs/ucode.css
+++ b/docs/ucode.css
@@ -1,34 +1,3 @@
-#sidebar > .sidebar-items-container {
- margin-top: 1rem;
-}
-
-h1 {
- display: flex;
-}
-
-h3[id].name:not(h2 + h3) {
- margin-top: 2.5rem;
- border-top: 1px solid #292929;
- padding-top: 1.5rem;
-}
-
-h3[id].name:not(h2 + h3) .link-anchor {
- top: 1.5rem;
-}
-
-.light h3[id].name {
- border-color: #ccc;
-}
-
-html body {
- line-height: 1.5;
-}
-
-article .description > ul,
-article .description > ol {
- list-style: initial;
-}
-
.navbar-item.github-home a {
background-image: url("data:image/svg+xml,%3Csvg width='98' height='96' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z' fill='%2324292f'/%3E%3C/svg%3E");
background-repeat: no-repeat;
@@ -36,66 +5,3 @@ article .description > ol {
background-position: 1rem center;
padding-left: 3rem;
}
-
-section table td:first-child,
-section .params td:first-child,
-section table thead th:first-child,
-section .params thead th:first-child,
-section .props thead th:first-child {
- border-top-left-radius: .5rem;
- border-bottom-left-radius: .5rem;
-}
-
-section table td:last-child,
-section .params td:last-child,
-section table thead th:last-child,
-section .params thead th:last-child,
-section .props thead th:last-child {
- border-top-right-radius: .5rem;
- border-bottom-right-radius: .5rem;
-}
-
-section .params td,
-section .params th,
-section .props td,
-section .props th,
-section th,
-section td,
-section .details .details-item-container {
- padding: .5rem 1rem;
-}
-
-section ul,
-section ol {
- padding-left: 1.5rem;
-}
-
-section ul li,
-section ol li {
- padding: .25rem 0;
-}
-
-section p {
- margin: .75rem 0;
-}
-
-section .details {
- border-radius: .5rem;
-}
-
-section .pre-div {
- margin: 1rem 0;
- border-radius: .5rem;
-}
-
-.param-type {
- font-family: "code";
-}
-
-.signature-attributes {
- font-variant: sub;
-}
-
-.method-member-container > strong + dl.param-type > dt {
- display: none;
-}
diff --git a/docs/ucode.js b/docs/ucode.js
deleted file mode 100644
index 2377c7e..0000000
--- a/docs/ucode.js
+++ /dev/null
@@ -1,39 +0,0 @@
-document.addEventListener('DOMContentLoaded', (ev) => {
- const accordionState = window.localStorage.getItem('accordion-id');
-
- if (accordionState == null || accordionState == '{}')
- document.querySelectorAll('[data-isopen="false"]')
- .forEach(item => item.setAttribute('data-isopen', 'true'));
-
- const moduleName = location.pathname.match(/\/module-(.+)\.html$/)?.[1];
-
- if (moduleName) {
- const modulePrefix = `module:${moduleName}.`;
-
- document.querySelectorAll(`a[href^="module-${CSS.escape(moduleName)}."]`).forEach(a => {
- if (a.text?.indexOf(modulePrefix) == 0)
- a.text = a.text.substring(modulePrefix.length);
- });
- }
-
- document.querySelectorAll('.param-type, .type-signature').forEach(span => {
- let replaced;
- do {
- replaced = false;
- span.innerHTML = span.innerHTML.replace(/\b(Object|Array)\.&lt;((?:(?!&[lg]t;).)+)&gt;/,
- (m, t, st) => {
- replaced = true;
-
- if (t == 'Object')
- return `Object&lt;${st.replace(/,\s*/, ':&#8239;')}&gt;`;
- else
- return `${st}[]`;
- });
- } while (replaced);
- });
-
- document.querySelectorAll('.type-signature').forEach(span => {
- span.innerHTML = span.innerHTML.replace(/\(nullable\) (.+)$/,
- '$1<span class="signature-attributes">nullable</span>');
- });
-});
diff --git a/jsdoc/conf.json b/jsdoc/conf.json
index e1487eb..3a52e8f 100644
--- a/jsdoc/conf.json
+++ b/jsdoc/conf.json
@@ -26,7 +26,7 @@
"idInHeadings": true
},
"opts": {
- "template": "node_modules/clean-jsdoc-theme",
+ "template": "node_modules/ucode-jsdoc-theme",
"destination": "docs",
"recurse": true,
"readme": "docs/README.md",
@@ -41,9 +41,6 @@
"include_css": [
"docs/ucode.css"
],
- "include_js": [
- "docs/ucode.js"
- ],
"menu": [
{
"title": "GitHub Project Page",
diff --git a/package.json b/package.json
index b52247f..04c7471 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"doc": "LC_ALL=C jsdoc -c jsdoc/conf.json"
},
"devDependencies": {
- "clean-jsdoc-theme": "^4.2.9",
+ "ucode-jsdoc-theme": "https://github.com/jow-/ucode-jsdoc-theme.git",
"jsdoc": "^4.0.2"
}
}