Skip to content

Commit

Permalink
Deployed e089122 with MkDocs version: 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
KSneijders committed Nov 2, 2024
0 parents commit 28e2ee4
Show file tree
Hide file tree
Showing 109 changed files with 182,586 additions and 0 deletions.
Empty file added .nojekyll
Empty file.
2,057 changes: 2,057 additions & 0 deletions 404.html

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions _assets/css/api_docs_extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
h5.doc.doc-heading {
font-size: 20px;
}

.class-attribute-entry {
padding: 10px 10px !important;
}

.class-attribute-entry .highlight.language-python {
font-size: 14px;
}

.class-attribute-entry .doc-label-instance-attribute {
font-size: 14px;
}

/*
| Overwrite certain CSS attributes on source code blocks inside tables to fix styling issues.
*/

.inner-table-code-block-overwrite details {
margin: 1.5625em 0 !important;
}

.inner-table-code-block-overwrite table.highlighttable tr {
display: flex !important;
}

.inner-table-code-block-overwrite table.highlighttable tr td {
border-top: none !important;
}

.inner-table-code-block-overwrite table.highlighttable tr td:first-child {
padding: .7720588235em 0 .7720588235em 1.1764705882em !important;
}

.inner-table-code-block-overwrite table.highlighttable tr td:not(:first-child) {
padding: 0 !important;
}
16 changes: 16 additions & 0 deletions _assets/css/api_docs_toc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
|
| Hide nested content (1) and rotate arrows (2) to make menus look entirely closed.
| This stays until JS takes over and actually closes them and disables these styles using: `.disable-instant-css`
|
*/

/* (1) */
.md-nav__toggle:not(.disable-instant-css) ~ .md-nav:not([data-md-level="0"]):not([data-md-level="1"]) {
display: none;
}

/* (2) */
.md-nav__item--nested .md-nav__toggle:not(.disable-instant-css) ~ .md-nav__link .md-nav__icon.md-icon {
transform: rotate(0deg);
}
58 changes: 58 additions & 0 deletions _assets/js/api_docs_toc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const collapseToC = () => {
if (window.screen.width < 1220) {
document.querySelectorAll('.md-nav__toggle').forEach((e) => e.classList.add('disable-instant-css'))
document.querySelectorAll('.md-nav__item--nested .md-nav__toggle').forEach((e) => e.classList.add('disable-instant-css'))

return;
}

/*
| Update window path name to only useful part
|
| '/AoE2ScenarioParser/api_docs/player/player/'
| ['','AoE2ScenarioParser','api_docs','player','player','']
| ['player','player']
*/
const path = window.location.pathname.split('/').slice(3, -1);
console.log("Path", path);

const primary = '.md-nav--primary .md-nav__item.md-nav__item--nested';
const selector = '.md-nav__toggle ~ .md-nav:not([data-md-level="0"]):not([data-md-level="1"])';

const completeSelector = `${primary} ${selector}`;
console.log(`Selector: [${completeSelector}]`)

let index = 0;
document.querySelectorAll(completeSelector)
.forEach((e) => {
const input = e.parentNode.children[0];
const label = e.parentNode.children[1];

console.log(label, input)

if (!label || !('click' in label) || index >= path.length)
return;

const labelName = label.innerText.toLowerCase(); /* Do not trim */
const pathName = path[index].toLowerCase().replace('_', '');

console.log(`\tLabel: [${labelName}] // Path: [${pathName}]`)

const collapseElement = labelName !== pathName;

if (collapseElement) {
label.click(); /* Close the menu item */
} else {
index++;
console.log(`Match! Continue index to: ${index}`)
}

if (input) {
input.classList.add('disable-instant-css');
}
});
}

window.addEventListener('load', function() {
collapseToC();
});
Loading

0 comments on commit 28e2ee4

Please sign in to comment.