docs collapse APIs by default
This commit is contained in:
20
docs/_static/css/custom.css
vendored
20
docs/_static/css/custom.css
vendored
@@ -111,3 +111,23 @@ code.sig-name
|
|||||||
.lv-example-link-button:visited {
|
.lv-example-link-button:visited {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dl.cpp.unexpanded dd {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lv-api-expansion-button {
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
.lv-api-expansion-button::before {
|
||||||
|
font-family: FontAwesome, "Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 1.1em;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.unexpanded .lv-api-expansion-button::before {
|
||||||
|
content: "\f0da \00a0";
|
||||||
|
}
|
||||||
|
.expanded .lv-api-expansion-button::before {
|
||||||
|
content: "\f0d7 \00a0";
|
||||||
|
}
|
||||||
18
docs/_static/js/custom.js
vendored
Normal file
18
docs/_static/js/custom.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/* API collapsing */
|
||||||
|
document.addEventListener('DOMContentLoaded', (event) => {
|
||||||
|
document.querySelectorAll("dl.cpp").forEach(cppListing => {
|
||||||
|
const dt = cppListing.querySelector("dt");
|
||||||
|
let shouldBeExpanded = false;
|
||||||
|
if(dt.id == document.location.hash.substring(1))
|
||||||
|
shouldBeExpanded = true;
|
||||||
|
cppListing.classList.add(shouldBeExpanded ? "expanded" : "unexpanded");
|
||||||
|
const button = document.createElement("span");
|
||||||
|
button.classList.add("lv-api-expansion-button");
|
||||||
|
button.addEventListener("click", () => {
|
||||||
|
cppListing.classList.toggle("unexpanded");
|
||||||
|
cppListing.classList.toggle("expanded");
|
||||||
|
});
|
||||||
|
|
||||||
|
dt.insertBefore(button, dt.firstChild);
|
||||||
|
});
|
||||||
|
})
|
||||||
10
docs/conf.py
10
docs/conf.py
@@ -18,14 +18,16 @@
|
|||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath('./_ext'))
|
sys.path.insert(0, os.path.abspath('./_ext'))
|
||||||
|
|
||||||
|
from subprocess import PIPE, Popen
|
||||||
|
|
||||||
import recommonmark
|
import recommonmark
|
||||||
from recommonmark.transform import AutoStructify
|
from recommonmark.transform import AutoStructify
|
||||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||||
from subprocess import Popen, PIPE
|
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
# -- General configuration ------------------------------------------------
|
||||||
|
|
||||||
@@ -148,6 +150,10 @@ html_sidebars = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html_js_files = [
|
||||||
|
'js/custom.js'
|
||||||
|
]
|
||||||
|
|
||||||
html_favicon = 'favicon.png'
|
html_favicon = 'favicon.png'
|
||||||
html_logo = 'logo_lvgl.png'
|
html_logo = 'logo_lvgl.png'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user