Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add follow up style additions #5

Merged
merged 3 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
site/
.unotes
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ pip install mkdocs-rtd-dropdown # install the rtd-dropdown theme
mkdocs serve # start the local server
```
Follow https://www.mkdocs.org/user-guide/writing-your-docs/ to write documentation

### Extensions
* [Fenced code blocks](https://python-markdown.github.io/extensions/fenced_code_blocks/)
* [Admonitions](https://python-markdown.github.io/extensions/admonition/)
* [Attribute Lists](https://python-markdown.github.io/extensions/attr_list/)
3 changes: 3 additions & 0 deletions docs/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ code {
}
th {
text-align: center;
}
.tocbase .toctree-l3.current {
background: #bdbdbd;
}
48 changes: 37 additions & 11 deletions docs/javascript/overrides.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
.hljs {
overflow - x: auto!important;
padding: 0.5em!important;
color: #333!important;
background: #f8f8f8!important;
}

code {
white - space: pre!important;
word - wrap: normal!important;
font - size: 12px!important;
}
$(document).ready(() => {
const toggleCurrent = function (elem) {
var parent_li = elem.closest('li');
var menu_li = parent_li.next();
var menu_ul = menu_li.children('ul');
parent_li.siblings('li').not(menu_li).removeClass('current').removeClass('with-children');
parent_li.siblings().find('> ul').not(menu_ul).removeClass('current').addClass('toc-hidden');
parent_li.toggleClass('current');
parent_li.toggleClass('with-children');
menu_li.toggleClass('current');
menu_ul.toggleClass('current').toggleClass('toc-hidden');
$('.with-children').each((i, obj) => {
console.log(obj)
if ($(obj).find('.toctree-expand').length === 0) {
$(obj).removeClass('with-children')
}
})
}
var thispage = document.location.hash;
var hash = thispage.replace(/^#/, '');
if (!hash) return;
var $linkEL = $(`.tocbase a[href="#${hash}"]`);
if ($linkEL && $linkEL[0]) {
$linkEL.parents('[class^="toctree-"]').each((i, obj) => {
if ($(obj).hasClass('toctree-l1')) {
return;
}
const $newLi = $(obj).prev('li')
if ($newLi.hasClass('current')) return;
const $newA = $newLi.children('a');
if ($newA && $newA[0]) {
toggleCurrent($newA)
}
});
// toggleCurrent($linkEL);
}
})
6 changes: 5 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ extra_css:
extra_javascript:
- javascript/overrides.js
theme:
name: 'rtd-dropdown'
name: 'rtd-dropdown'
markdown_extensions:
- admonition
- attr_list
- fenced_code