Skip to content

Commit

Permalink
Added docs dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedNasser8 committed Jun 12, 2024
1 parent c2431fa commit a22d55e
Show file tree
Hide file tree
Showing 15 changed files with 1,031 additions and 64 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pytest_cache
src/osipi/__pycache__
tests/__pycache__
.coverage
junit
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ repos:
rev: v6.1.2 # Use the latest version
hooks:
- id: rstcheck
entry: rstcheck --ignore-messages="(Hyperlink target .* is not referenced.|No directive entry for
.*|Unknown directive type .*|Duplicate explicit target name.*)"
args: [
"--ignore-roles", "ref",
]
args: ["--ignore-directives=autosummary,autofunction,minigallery,image-sg","--ignore-messages=(Hyperlink target *|Duplicate explicit target name*)"]
additional_dependencies: [sphinx]
5 changes: 5 additions & 0 deletions .rstcheck.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[rstcheck]
ignore-directives =
autosummary,
image-sg,
minigallery
101 changes: 101 additions & 0 deletions docs/build/html/_sphinx_design_static/design-tabs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// @ts-check

// Extra JS capability for selected tabs to be synced
// The selection is stored in local storage so that it persists across page loads.

/**
* @type {Record<string, HTMLElement[]>}
*/
let sd_id_to_elements = {};
const storageKeyPrefix = "sphinx-design-tab-id-";

/**
* Create a key for a tab element.
* @param {HTMLElement} el - The tab element.
* @returns {[string, string, string] | null} - The key.
*
*/
function create_key(el) {
let syncId = el.getAttribute("data-sync-id");
let syncGroup = el.getAttribute("data-sync-group");
if (!syncId || !syncGroup) return null;
return [syncGroup, syncId, syncGroup + "--" + syncId];
}

/**
* Initialize the tab selection.
*
*/
function ready() {
// Find all tabs with sync data

/** @type {string[]} */
let groups = [];

document.querySelectorAll(".sd-tab-label").forEach((label) => {
if (label instanceof HTMLElement) {
let data = create_key(label);
if (data) {
let [group, id, key] = data;

// add click event listener
// @ts-ignore
label.onclick = onSDLabelClick;

// store map of key to elements
if (!sd_id_to_elements[key]) {
sd_id_to_elements[key] = [];
}
sd_id_to_elements[key].push(label);

if (groups.indexOf(group) === -1) {
groups.push(group);
// Check if a specific tab has been selected via URL parameter
const tabParam = new URLSearchParams(window.location.search).get(
group
);
if (tabParam) {
console.log(
"sphinx-design: Selecting tab id for group '" +
group +
"' from URL parameter: " +
tabParam
);
window.sessionStorage.setItem(storageKeyPrefix + group, tabParam);
}
}

// Check is a specific tab has been selected previously
let previousId = window.sessionStorage.getItem(
storageKeyPrefix + group
);
if (previousId === id) {
// console.log(
// "sphinx-design: Selecting tab from session storage: " + id
// );
// @ts-ignore
label.previousElementSibling.checked = true;
}
}
}
});
}

/**
* Activate other tabs with the same sync id.
*
* @this {HTMLElement} - The element that was clicked.
*/
function onSDLabelClick() {
let data = create_key(this);
if (!data) return;
let [group, id, key] = data;
for (const label of sd_id_to_elements[key]) {
if (label === this) continue;
// @ts-ignore
label.previousElementSibling.checked = true;
}
window.sessionStorage.setItem(storageKeyPrefix + group, id);
}

document.addEventListener("DOMContentLoaded", ready, false);

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/source/generated/api/osipi.aif_georgiou.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@




.. minigallery:: osipi.aif_georgiou
:add-heading:
1 change: 1 addition & 0 deletions docs/source/generated/api/osipi.aif_parker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@




.. minigallery:: osipi.aif_parker
:add-heading:
1 change: 1 addition & 0 deletions docs/source/generated/api/osipi.aif_weinmann.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@




.. minigallery:: osipi.aif_weinmann
:add-heading:
1 change: 1 addition & 0 deletions docs/source/generated/api/osipi.extended_tofts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@




.. minigallery:: osipi.extended_tofts
:add-heading:
1 change: 1 addition & 0 deletions docs/source/generated/api/osipi.tofts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@




.. minigallery:: osipi.tofts
:add-heading:
23 changes: 23 additions & 0 deletions docs/source/generated/examples/index.rst.new
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@


.. _sphx_glr_generated_examples:

########
Examples
########

Illustrating common use cases of osipi.



.. raw:: html

<div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. thumbnail-parent-div-close

.. raw:: html

</div>
1 change: 0 additions & 1 deletion junit/test-results.xml

This file was deleted.

Loading

0 comments on commit a22d55e

Please sign in to comment.