Commit a250656d authored by Guillaume Blanchy's avatar Guillaume Blanchy
Browse files

WIP docstring ohmpi.py

Showing with 45 additions and 169 deletions
+45 -169
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
# Sphinx build info version 1 # Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 632d0e889a8fba89da2489b9424a452f config: ca7e0a74d2b6886c0b281f49e446eff0
tags: 645f666f9bcd5a90fca523b33c5a78b7 tags: 645f666f9bcd5a90fca523b33c5a78b7
/* /* Compatability shim for jQuery and underscores.js.
* _sphinx_javascript_frameworks_compat.js
* ~~~~~~~~~~
*
* Compatability shim for jQuery and underscores.js.
*
* WILL BE REMOVED IN Sphinx 6.0
* xref RemovedInSphinx60Warning
* *
* Copyright Sphinx contributors
* Released under the two clause BSD licence
*/ */
/**
* select a different prefix for underscore
*/
$u = _.noConflict();
/** /**
* small helper function to urldecode strings * small helper function to urldecode strings
* *
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Sphinx stylesheet -- basic theme. * Sphinx stylesheet -- basic theme.
* *
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details. * :license: BSD, see LICENSE for details.
* *
*/ */
...@@ -237,6 +237,10 @@ a.headerlink { ...@@ -237,6 +237,10 @@ a.headerlink {
visibility: hidden; visibility: hidden;
} }
a:visited {
color: #551A8B;
}
h1:hover > a.headerlink, h1:hover > a.headerlink,
h2:hover > a.headerlink, h2:hover > a.headerlink,
h3:hover > a.headerlink, h3:hover > a.headerlink,
...@@ -324,17 +328,17 @@ aside.sidebar { ...@@ -324,17 +328,17 @@ aside.sidebar {
p.sidebar-title { p.sidebar-title {
font-weight: bold; font-weight: bold;
} }
nav.contents, nav.contents,
aside.topic, aside.topic,
div.admonition, div.topic, blockquote { div.admonition, div.topic, blockquote {
clear: left; clear: left;
} }
/* -- topics ---------------------------------------------------------------- */ /* -- topics ---------------------------------------------------------------- */
nav.contents, nav.contents,
aside.topic, aside.topic,
div.topic { div.topic {
border: 1px solid #ccc; border: 1px solid #ccc;
padding: 7px; padding: 7px;
...@@ -375,7 +379,6 @@ div.sidebar > :last-child, ...@@ -375,7 +379,6 @@ div.sidebar > :last-child,
aside.sidebar > :last-child, aside.sidebar > :last-child,
nav.contents > :last-child, nav.contents > :last-child,
aside.topic > :last-child, aside.topic > :last-child,
div.topic > :last-child, div.topic > :last-child,
div.admonition > :last-child { div.admonition > :last-child {
margin-bottom: 0; margin-bottom: 0;
...@@ -385,7 +388,6 @@ div.sidebar::after, ...@@ -385,7 +388,6 @@ div.sidebar::after,
aside.sidebar::after, aside.sidebar::after,
nav.contents::after, nav.contents::after,
aside.topic::after, aside.topic::after,
div.topic::after, div.topic::after,
div.admonition::after, div.admonition::after,
blockquote::after { blockquote::after {
...@@ -611,25 +613,6 @@ ul.simple p { ...@@ -611,25 +613,6 @@ ul.simple p {
margin-bottom: 0; margin-bottom: 0;
} }
/* Docutils 0.17 and older (footnotes & citations) */
dl.footnote > dt,
dl.citation > dt {
float: left;
margin-right: 0.5em;
}
dl.footnote > dd,
dl.citation > dd {
margin-bottom: 0em;
}
dl.footnote > dd:after,
dl.citation > dd:after {
content: "";
clear: both;
}
/* Docutils 0.18+ (footnotes & citations) */
aside.footnote > span, aside.footnote > span,
div.citation > span { div.citation > span {
float: left; float: left;
...@@ -654,8 +637,6 @@ div.citation > p:last-of-type:after { ...@@ -654,8 +637,6 @@ div.citation > p:last-of-type:after {
clear: both; clear: both;
} }
/* Footnotes & citations ends */
dl.field-list { dl.field-list {
display: grid; display: grid;
grid-template-columns: fit-content(30%) auto; grid-template-columns: fit-content(30%) auto;
...@@ -668,10 +649,6 @@ dl.field-list > dt { ...@@ -668,10 +649,6 @@ dl.field-list > dt {
padding-right: 5px; padding-right: 5px;
} }
dl.field-list > dt:after {
content: ":";
}
dl.field-list > dd { dl.field-list > dd {
padding-left: 0.5em; padding-left: 0.5em;
margin-top: 0em; margin-top: 0em;
...@@ -697,6 +674,16 @@ dd { ...@@ -697,6 +674,16 @@ dd {
margin-left: 30px; margin-left: 30px;
} }
.sig dd {
margin-top: 0px;
margin-bottom: 0px;
}
.sig dl {
margin-top: 0px;
margin-bottom: 0px;
}
dl > dd:last-child, dl > dd:last-child,
dl > dd:last-child > :last-child { dl > dd:last-child > :last-child {
margin-bottom: 0; margin-bottom: 0;
...@@ -765,6 +752,14 @@ abbr, acronym { ...@@ -765,6 +752,14 @@ abbr, acronym {
cursor: help; cursor: help;
} }
.translated {
background-color: rgba(207, 255, 207, 0.2)
}
.untranslated {
background-color: rgba(255, 207, 207, 0.2)
}
/* -- code displays --------------------------------------------------------- */ /* -- code displays --------------------------------------------------------- */
pre { pre {
......
...@@ -4,12 +4,19 @@ ...@@ -4,12 +4,19 @@
* *
* Base JavaScript utilities for all Sphinx HTML documentation. * Base JavaScript utilities for all Sphinx HTML documentation.
* *
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details. * :license: BSD, see LICENSE for details.
* *
*/ */
"use strict"; "use strict";
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
"TEXTAREA",
"INPUT",
"SELECT",
"BUTTON",
]);
const _ready = (callback) => { const _ready = (callback) => {
if (document.readyState !== "loading") { if (document.readyState !== "loading") {
callback(); callback();
...@@ -18,73 +25,11 @@ const _ready = (callback) => { ...@@ -18,73 +25,11 @@ const _ready = (callback) => {
} }
}; };
/**
* highlight a given string on a node by wrapping it in
* span elements with the given class name.
*/
const _highlight = (node, addItems, text, className) => {
if (node.nodeType === Node.TEXT_NODE) {
const val = node.nodeValue;
const parent = node.parentNode;
const pos = val.toLowerCase().indexOf(text);
if (
pos >= 0 &&
!parent.classList.contains(className) &&
!parent.classList.contains("nohighlight")
) {
let span;
const closestNode = parent.closest("body, svg, foreignObject");
const isInSVG = closestNode && closestNode.matches("svg");
if (isInSVG) {
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
} else {
span = document.createElement("span");
span.classList.add(className);
}
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
parent.insertBefore(
span,
parent.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling
)
);
node.nodeValue = val.substr(0, pos);
if (isInSVG) {
const rect = document.createElementNS(
"http://www.w3.org/2000/svg",
"rect"
);
const bbox = parent.getBBox();
rect.x.baseVal.value = bbox.x;
rect.y.baseVal.value = bbox.y;
rect.width.baseVal.value = bbox.width;
rect.height.baseVal.value = bbox.height;
rect.setAttribute("class", className);
addItems.push({ parent: parent, target: rect });
}
}
} else if (node.matches && !node.matches("button, select, textarea")) {
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
}
};
const _highlightText = (thisNode, text, className) => {
let addItems = [];
_highlight(thisNode, addItems, text, className);
addItems.forEach((obj) =>
obj.parent.insertAdjacentElement("beforebegin", obj.target)
);
};
/** /**
* Small JavaScript module for the documentation. * Small JavaScript module for the documentation.
*/ */
const Documentation = { const Documentation = {
init: () => { init: () => {
Documentation.highlightSearchWords();
Documentation.initDomainIndexTable(); Documentation.initDomainIndexTable();
Documentation.initOnKeyListeners(); Documentation.initOnKeyListeners();
}, },
...@@ -126,51 +71,6 @@ const Documentation = { ...@@ -126,51 +71,6 @@ const Documentation = {
Documentation.LOCALE = catalog.locale; Documentation.LOCALE = catalog.locale;
}, },
/**
* highlight the search words provided in the url in the text
*/
highlightSearchWords: () => {
const highlight =
new URLSearchParams(window.location.search).get("highlight") || "";
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
if (terms.length === 0) return; // nothing to do
// There should never be more than one element matching "div.body"
const divBody = document.querySelectorAll("div.body");
const body = divBody.length ? divBody[0] : document.querySelector("body");
window.setTimeout(() => {
terms.forEach((term) => _highlightText(body, term, "highlighted"));
}, 10);
const searchBox = document.getElementById("searchbox");
if (searchBox === null) return;
searchBox.appendChild(
document
.createRange()
.createContextualFragment(
'<p class="highlight-link">' +
'<a href="javascript:Documentation.hideSearchWords()">' +
Documentation.gettext("Hide Search Matches") +
"</a></p>"
)
);
},
/**
* helper function to hide the search marks again
*/
hideSearchWords: () => {
document
.querySelectorAll("#searchbox .highlight-link")
.forEach((el) => el.remove());
document
.querySelectorAll("span.highlighted")
.forEach((el) => el.classList.remove("highlighted"));
const url = new URL(window.location);
url.searchParams.delete("highlight");
window.history.replaceState({}, "", url);
},
/** /**
* helper function to focus on search bar * helper function to focus on search bar
*/ */
...@@ -210,15 +110,11 @@ const Documentation = { ...@@ -210,15 +110,11 @@ const Documentation = {
) )
return; return;
const blacklistedElements = new Set([
"TEXTAREA",
"INPUT",
"SELECT",
"BUTTON",
]);
document.addEventListener("keydown", (event) => { document.addEventListener("keydown", (event) => {
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements // bail for input elements
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
// bail with special keys
if (event.altKey || event.ctrlKey || event.metaKey) return;
if (!event.shiftKey) { if (!event.shiftKey) {
switch (event.key) { switch (event.key) {
...@@ -240,10 +136,6 @@ const Documentation = { ...@@ -240,10 +136,6 @@ const Documentation = {
event.preventDefault(); event.preventDefault();
} }
break; break;
case "Escape":
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
Documentation.hideSearchWords();
event.preventDefault();
} }
} }
......
var DOCUMENTATION_OPTIONS = { const DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: 'open hardware resistivity-meter', VERSION: 'open hardware resistivity-meter',
LANGUAGE: 'en', LANGUAGE: 'en',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
...@@ -10,5 +9,5 @@ var DOCUMENTATION_OPTIONS = { ...@@ -10,5 +9,5 @@ var DOCUMENTATION_OPTIONS = {
SOURCELINK_SUFFIX: '.txt', SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false, NAVIGATION_WITH_KEYS: false,
SHOW_SEARCH_SUMMARY: true, SHOW_SEARCH_SUMMARY: true,
ENABLE_SEARCH_SHORTCUTS: false, ENABLE_SEARCH_SHORTCUTS: true,
}; };
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* This script contains the language-specific data used by searchtools.js, * This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter. * namely the list of stopwords, stemmer, scorer and splitter.
* *
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details. * :license: BSD, see LICENSE for details.
* *
*/ */
......
...@@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: ...@@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ .highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */ .highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #E40000 } /* Generic.Error */ .highlight .gr { color: #E40000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #008400 } /* Generic.Inserted */ .highlight .gi { color: #008400 } /* Generic.Inserted */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment