older version of ivory?

This commit is contained in:
PySimpleGUI 2021-09-27 14:00:40 -04:00
parent bb0094a7b7
commit e7b36a6f16
15 changed files with 912 additions and 0 deletions

6
mkdocs_ivory/404.html Normal file
View File

@ -0,0 +1,6 @@
{% extends "base.html" %}
{% block content %}
<h1 id="404-page-not-found">404</h1>
<p><strong>Page not found</strong></p>
{% endblock %}

0
mkdocs_ivory/__init__.py Normal file
View File

107
mkdocs_ivory/base.html Normal file
View File

@ -0,0 +1,107 @@
<!DOCTYPE html>
<html>
<head>
{%- block site_meta %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{%- if page and page.is_homepage %}
<meta name="description" content="{{ config.site_description }}">{% endif %}
{%- if config.site_author %}
<meta name="author" content="{{ config.site_author }}">{% endif %}
{%- if config.site_favicon %}
<link rel="shortcut icon" href="{{ config.site_favicon|url }}">
{%- else %}
<link rel="shortcut icon" href="{{ 'img/favicon.ico'|url }}">{% endif %}
{%- endblock %}
{%- block htmltitle %}
<title>{% if page and page.title and not page.is_hompage %}{{ page.title|striptags }} &mdash; {% endif %}{{ config.site_name }}</title>
{%- endblock %}
{%- block styles %}
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:400,700">
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/tonsky/FiraCode@1.206/distr/fira_code.css">
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.8.1/css/all.css">
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.8.1/css/v4-shims.css">
<link rel="stylesheet" href="{{ 'css/theme.css'|url }}">
{%- if config.theme.highlightjs %}
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
{%- endif %}
{%- for path in config['extra_css'] %}
<link rel="stylesheet" href="{{ path|url }}">
{%- endfor %}
{%- endblock %}
{%- block libs %}
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
{%- if config.theme.highlightjs %}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
{%- for lang in config.theme.hljs_languages %}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/{{lang}}.min.js"></script>
{%- endfor %}
<script>
hljs.initHighlightingOnLoad();
</script>
{%- endif %}
{%- endblock %}
{%- block extrahead %} {% endblock %}
</head>
<body ontouchstart="">
<div id="container">
<aside>
<div class="home">
<div class="title">
<button class="hamburger"></button>
<a href="{{ nav.homepage.url|url }}" class="site-name"> {{ config.site_name }}</a>
</div>
{%- if config.theme.version -%}
<div class="version">{{ config.theme.version }}</div>
{%- endif %}
{%- if 'search' in config['plugins'] %}
<div class="search">
{%- block search_button %}
{% include "searchbox.html" %}
{%- endblock %}
</div>
{%- endif %}
</div>
<nav class="nav">
{%- block site_nav %}
<ul class="root">
{%- set navlevel = 1 %}
{%- for nav_item in nav %}
<li class="toctree-l{{ navlevel }}{% if nav_item.active and not nav_item.children %} current{%endif%}">
{%- include 'nav.html' -%}
</li>
{%- endfor %}
</ul>
{%- endblock %}
</nav>
{% include "repo.html" %}
</aside>
<div id="spacer"><button class="arrow"></button></div>
<main>
<div class="home-top">
<button class="hamburger"></button>
<a href="{{ nav.homepage.url|url }}" class="site-name"> {{ config.site_name }}</a>
</div>
<div id="main">
<nav class="breadcrumbs">{% include "breadcrumbs.html" %}</nav>
{% block content %}<div id="content">{{ page.content }}</div>{% endblock %}
{% block footer %}{% include "footer.html" %}{% endblock %}
</div>
</main>
</div>
{%- block scripts %}
<script>var base_url = '{{ base_url }}';</script>
<script src="{{ 'js/theme.js'|url }}"></script>
{%- for path in config['extra_javascript'] %}
<script src="{{ path|url }}"></script>{% endfor %}
{%- endblock %}
</body>
</html>

View File

@ -0,0 +1,12 @@
{% if page %}
<ul>
{% for doc in page.ancestors|reverse -%}
{%- if doc.link -%}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a>
{%- else -%}
<li>{{ doc.title }}
{%- endif -%}
{%- if not loop.last %} &raquo; {% endif %}</li>
{%- endfor %}
</ul>
{% endif %}

657
mkdocs_ivory/css/theme.css Normal file
View File

@ -0,0 +1,657 @@
html {
font-size: 16px;
}
*, *::before, *::after {
box-sizing: border-box;
}
body, button {
font-family: Lato, "Yu Gothic Medium", "游ゴシック Medium", YuGothic, "游ゴシック体", "ヒラギノ角ゴ Pro W3", "メイリオ", sans-serif;
}
body {
margin: 0;
}
code {
font-family: "Fira Code", "Courier New", Consolas, monospace;
font-size: 0.83rem;
color: #7700FF;
border: 1px solid #E0E0E0;
border-radius: 3px;
padding: 1px 4px;
margin: 0px 1px;
background: white;
}
pre code {
font-size: 0.8rem;
}
p {
line-height: 1.65rem;
}
main ul {
margin-top: 0px;
margin-bottom: 8px;
}
main li {
margin-top: 4px;
margin-bottom: 4px;
line-height: 1.5;
}
pre {
line-height: 1.6;
}
a {
color: #39f;
text-decoration: none;
}
button {
font-size: 1rem;
cursor: pointer;
border: none;
background: transparent;
outline: none;
}
img {
width: 100%;
max-width: 100%;
height: auto;
}
/* ul, ol, dl {
margin: 0;
padding: 0;
list-style: none;
list-style-image: none;
} */
.nav ul,
.breadcrumbs ul {
padding: 0px;
list-style-type: none;
}
.site-name {
display: inline-block;
color: #ddd;
font-weight: bold;
}
.site-name::before {
font-family: "Font Awesome 5 Free";
content: "\f015";
}
.nav-item {
display: block;
position: relative;
font-size: 0.95rem;
line-height: 1.1;
padding-top: 5px;
padding-bottom: 5px;
padding-right: 5px;
}
.nav-item.section {
color: #ddd;
width: 100%;
text-align: left;
}
.nav-item.section:hover {
background: #999;
color: #333;
}
a.nav-item {
color: #999;
}
a.nav-item.current {
color: #333;
background: #eee;
}
a.nav-item.current:hover {
color: #333;
background: #bbb;
}
a.nav-item:hover {
background: #666;
}
.subnav.hide {
display: none;
}
.nav-item.section::before {
position: absolute;
text-align: center;
width: 5px;
}
.nav-item.section::before {
font-family: "Font Awesome 5 Free";
font-weight: bold;
content: "\f107";
}
.nav-item.section.hide::before {
content: "\f105";
}
.toctree-l1>.nav-item.section {
padding-left: 25px;
}
.toctree-l1>a.nav-item {
padding-left: 25px;
}
.toctree-l1>.nav-item.section::before {
left: 10px;
}
.toctree-l2>.nav-item.section {
padding-left: 35px;
}
.toctree-l2>a.nav-item {
padding-left: 25px;
}
.toctree-l2>.nav-item.section::before {
left: 20px;
}
.toctree-l3>.nav-item.section {
padding-left: 45px;
}
.toctree-l3>a.nav-item {
padding-left: 35px;
}
.toctree-l3>.nav-item.section::before {
left: 30px;
}
.toctree-l4>.nav-item.section {
padding-left: 55px;
}
.toctree-l4>a.nav-item {
padding-left: 45px;
}
.toctree-l4>.nav-item.section::before {
left: 40px;
}
.toctree-l5>.nav-item.section {
padding-left: 65px;
}
.toctree-l5>a.nav-item {
padding-left: 55px;
}
.toctree-l5>.nav-item.section::before {
left: 50px;
}
.toctree-l6>.nav-item.section {
padding-left: 75px;
}
.toctree-l6>a.nav-item {
padding-left: 65px;
}
.toctree-l6>.nav-item.section::before {
left: 45px;
}
.nav-item.toc {
background: #ccc;
color: #555;
border: none;
}
.nav-item.toc:hover {
background: #bbb;
color: #555;
border: none;
}
.repo div {
padding: 0 10px;
}
.repo div:first-child {
margin-right: auto;
}
.repo a {
color: #ddd;
font-size: 0.9rem;
}
.breadcrumbs li {
font-size: 0.9rem;
display: inline;
}
.footer-buttons {
position: relative;
height: 2.5rem;
}
.footer-buttons .previous {
position: absolute;
left: 0;
margin: auto;
}
.footer-buttons .next {
position: absolute;
right: 0;
}
.footer-buttons a {
display: inline-block;
color: #444;
background: #eee;
padding: 4px 8px;
border: 1px solid #ccc;
font-size: 14px;
}
.footer-buttons span::after,
.footer-buttons span::before {
font-family: "Font Awesome 5 Free";
font-weight: bold;
}
.footer-buttons .previous span::before {
margin-right: 6px;
content: "\f359";
}
.footer-buttons .next span::after {
margin-left: 6px;
content: "\f35a";
}
.footer-note {
display: flex;
font-size: 0.9rem;
color: #aaa;
height: 40px;
border-top: 1px solid #ccc;
align-items: center;
justify-content: center;
}
.footer-note a {
color: #88d;
}
/**************************************/
/* layout */
/**************************************/
#container {
display: flex;
}
aside {
flex: 0 0 300px;
width: 300px;
order: 1;
background: #333;
z-index: 999;
}
aside>* {
width: inherit;
}
.home, .home-top {
display: flex;
background: #48c;
flex-direction: column;
align-items: center;
justify-content: center;
}
.home {
position: fixed;
top: 0;
}
.home .search input {
display: inline-block;
border-radius: 40px;
padding: 4px 10px;
outline: none;
width: 250px;
border: 1px solid #999;
}
.nav {
position: fixed;
overflow-y: auto;
background: #333;
}
.repo {
display: flex;
background: #222;
position: fixed;
bottom: 0;
height: 40px;
align-items: center;
}
#spacer {
flex: 0 0 22px;
order: 2;
}
main {
flex: 1 1 300px;
order: 3;
min-width: 0;
overflow: hidden;
}
@media screen and (max-width: 768px) {
html.show {
overflow-y: hidden;
}
aside {
display: none;
}
aside.show {
display: block;
flex: 0 0 100%;
width: 100%;
}
.home, .home-top {
height: 40px;
}
.home-top {
position: relative;
}
.home .version,
.home .search {
display: none;
}
.hamburger {
position: absolute;
right: 15px;
}
.hamburger::before {
font-family: "Font Awesome 5 Free";
content: "\f0c9";
font-weight: bold;
color: #ddd;
font-size: 1.3rem;
}
.nav {
top: 40px;
height: calc(100% - 80px);
}
.site-name.hide {
display: none;
}
#spacer {
display: none;
}
#main {
margin: 10px 15px;
}
.footer-note {
display: none;
}
h1 {
font-size: 1.45rem;
}
h2 {
font-size: 1.3rem;
}
h3 {
font-size: 1.2rem;
}
h4 {
font-size: 1.15rem;
}
h5 {
font-size: 1.1rem;
}
h6 {
font-size: 1.0rem;
}
}
@media screen and (min-width: 768px) {
.home-top {
display: none;
}
.home {
height: 100px;
}
.home .title {
margin-top: 5px;
margin-bottom: 2px;
}
.home .version {
margin-bottom: 2px;
color: #aaa;
}
.nav {
top: 100px;
height: calc(100% - 140px);
}
#main {
margin: 10px 50px 10px 30px;
}
.hamburger {
display: none;
}
.arrow {
position: fixed;
top: calc(50% - 23px);
bottom: calc(50% - 23px);
border: 1px solid #eee;
border-radius: 0px 14px 14px 0px;
padding-left: 3px;
padding-right: 6px;
margin-left: -10px;
transition: 0.3s ease 0s;
}
.arrow::before {
font-family: "Font Awesome 5 Free";
content: "\f053";
font-weight: bold;
color: #fff;
font-size: 1rem;
}
.arrow.hide::before {
content: "\f054";
}
.arrow:hover {
background: #555;
color: #ddd;
border-color: #555;
margin-left: 0px;
}
aside.hide {
display: none;
}
h1 {
font-size: 1.65rem;
}
h2 {
font-size: 1.5rem;
}
h3 {
font-size: 1.25rem;
}
h4 {
font-size: 1.2rem;
}
h5 {
font-size: 1.1rem;
}
h6 {
font-size: 1.0rem;
}
}
/**************************************************
Table style
**************************************************/
table {
border-collapse: collapse;
font-size: 0.9rem;
margin: auto;
}
th, td {
text-align: center;
padding: 2px 4px;
}
th {
color: darkblue;
background: #eee;
border: 1px solid #333;
}
td {
color: black;
border: 1px solid #b9b9b9;
}
tr th:first-child, tr td:first-child {
border-left: 1px solid #333366;
}
tr th:last-child, tr td:last-child {
border-right: 1px solid #333366;
}
tr:first-child td, tr:first-child th {
border-top: 1px solid #333366;
}
tr:last-child td, tr:last-child th {
border-bottom: 1px solid #333366;
}
tbody tr:nth-child(2n+1) td {
background: #fafafa;
}
.admonition {
margin-top: 20px;
margin-bottom: 20px;
padding: 0px;
padding-bottom: 10px;
}
.admonition.note {
background: #F0F0FF;
}
.note p.admonition-title {
color: white;
background: #555599;
margin: 0px;
padding: 4px 8px;
}
.note p.admonition-title:before {
font-family: "Font Awesome 5 Free";
content: "\f303";
font-weight: 900;
padding-right: 5px;
color: white;
}
.admonition.warning {
background: #FFEEEE;
}
.warning p.admonition-title {
color: white;
background: #FF6666;
margin: 0px;
padding: 4px 8px;
}
.warning p.admonition-title:before {
font-family: "Font Awesome 5 Free";
content: "\f071";
font-weight: 900;
padding-right: 5px;
color: white;
}
.admonition p {
margin-top: 5px;
margin-left: 10px;
margin-bottom: 5px;
padding: 4px;
}
.admonition pre {
margin-top: 5px;
margin-left: 15px;
}

20
mkdocs_ivory/footer.html Normal file
View File

@ -0,0 +1,20 @@
<footer>
{%- block next_prev %}
{%- if page and page.next_page or page.previous_page %}
<div class="footer-buttons">
{%- if page.previous_page %}
<div class="previous"><a href="{{ page.previous_page.url|url }}" title="{{ page.previous_page.title|striptags }}"><span>Previous</span></a></div>
{%- endif %}
{%- if page.next_page %}
<div class="next"><a href="{{ page.next_page.url|url }}" title="{{ page.next_page.title|striptags }}"><span>Next</span></a></div>
{%- endif %}
</div>
{%- endif %}
{%- endblock %}
<div class="footer-note">
<p>
Built with <a href="http://www.mkdocs.org">MkDocs</a> using
<a href="https://github.com/daizutabi/mkdocs-ivory">Ivory theme</a>.
</p>
</div>
</footer>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

21
mkdocs_ivory/js/theme.js Normal file
View File

@ -0,0 +1,21 @@
function ready() {
$('.nav .section').each(function() {
$(this).click(function(e) {
$(this).toggleClass("hide");
$(this).parent().children(".subnav").toggleClass("hide");
});
});
$('.hamburger').click(function(e) {
$('html').toggleClass("show");
$('aside').toggleClass("show");
$('.home-top .site-name').toggleClass("hide");
});
$('.arrow').click(function(e) {
$('aside').toggleClass("hide");
$(this).toggleClass("hide");
});
}
$(ready);

10
mkdocs_ivory/main.html Normal file
View File

@ -0,0 +1,10 @@
{% extends "base.html" %}
{#
The entry point for the ReadTheDocs Theme.
Any theme customisations should override this file to redefine blocks defined in
the various templates. The custom theme should only need to define a main.html
which `{% extends "base.html" %}` and defines various blocks which will replace
the blocks defined in base.html and its included child templates.
#}

View File

@ -0,0 +1,10 @@
# Config options for 'ivory' theme
static_templates:
- 404.html
include_search_page: true
search_index_only: false
highlightjs: true
hljs_languages: []

22
mkdocs_ivory/nav.html Normal file
View File

@ -0,0 +1,22 @@
{%- if nav_item.is_section -%}
<button class="section nav-item{% if navlevel > 1 and not nav_item.active %} hide{% endif %}">{{ nav_item.title }}</button>
{%- elif nav_item.toc -%}
{%- for toc_item in nav_item.toc -%}
<a class="nav-item{% if nav_item.active %} current{%endif%}" href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
{%- endfor %}
{%- else %}
<a class="nav-item{% if nav_item.active %} current{%endif%}" href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
{%- endif -%}
{%- if nav_item == page or nav_item.children %}
<ul class="subnav{% if navlevel > 1 and not nav_item.active %} hide{% endif %}">
{%- if nav_item == page %}{% include 'toc.html' %}{%- endif %}
{%- if nav_item.children %}
{%- set navlevel = navlevel + 1 %}
{%- for nav_item in nav_item.children %}
<li class="toctree-l{{ navlevel }}{% if nav_item.active %} current{%endif%}">{% include 'nav.html' %}</li>
{%- endfor %}
{%- set navlevel = navlevel - 1%}
{%- endif %}
</ul>
{%- endif %}

19
mkdocs_ivory/repo.html Normal file
View File

@ -0,0 +1,19 @@
<div class="repo">
{%- if config.repo_name %}
<div class="link">
{%- if config.repo_name == 'GitHub' %}
<a href="{{ config.repo_url }}" class="fa fa-github"> GitHub</a>
{%- elif config.repo_name == 'Bitbucket' %}
<a href="{{ config.repo_url }}" class="icon icon-bitbucket"> BitBucket</a>
{%- elif config.repo_name == 'GitLab' %}
<a href="{{ config.repo_url }}" class="icon icon-gitlab"> GitLab</a>
{%- endif %}
</div>
{%- endif %}
{%- if page.previous_page %}
<div class="previous"><a href="{{ page.previous_page.url|url }}">&laquo; Previous</a></div>
{%- endif %}
{%- if page.next_page %}
<div class="next"><a href="{{ page.next_page.url|url }}">Next &raquo;</a></div>
{%- endif %}
</div>

16
mkdocs_ivory/search.html Normal file
View File

@ -0,0 +1,16 @@
{% extends "base.html" %}
{% block content %}
<h1 id="search">Search Results</h1>
<form id="content_search" action="search.html">
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
<input name="q" id="mkdocs-search-query" type="text" class="search_input search-query ui-autocomplete-input" placeholder="Search the Docs" autocomplete="off" autofocus title="Type search term here">
</form>
<div id="mkdocs-search-results" class="search-results">
Searching...
</div>
{% endblock %}

View File

@ -0,0 +1,5 @@
<div role="search">
<form id="rtd-search-form" class="wy-form" action="{{ base_url }}/search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>

7
mkdocs_ivory/toc.html Normal file
View File

@ -0,0 +1,7 @@
{%- for toc_item in page.toc %}
{%- if toc_item.children %}
{%- for toc_item in toc_item.children %}
<li class="toctree-l{{ navlevel + 1 }}"><a class="nav-item toc" href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{%- endfor %}
{%- endif %}
{%- endfor %}