Skip to content

Commit

Permalink
Merge pull request #105 from canonical/doc-update-sphinx-config
Browse files Browse the repository at this point in the history
update docs config to use the latest sphinx starter pack
  • Loading branch information
tang-mm authored Sep 28, 2023
2 parents edea55d + f93f5b0 commit cc8cea5
Show file tree
Hide file tree
Showing 20 changed files with 747 additions and 371 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ dist
.tox
.coverage
*.charm
_build
docs/.sphinx/warnings.txt
docs/.sphinx/.wordlist.dic
docs/.sphinx/.doctrees/
5 changes: 5 additions & 0 deletions docs/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Images
*.gif filter=lfs diff=lfs merge=lfs -text
*.ico filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
Binary file modified docs/.sphinx/_static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions docs/.sphinx/_static/furo_colors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
body {
--color-code-background: #f8f8f8;
--color-code-foreground: black;
--font-stack: Ubuntu, -apple-system, Segoe UI, Roboto, Oxygen, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
--font-stack--monospace: Ubuntu Mono, Consolas, Monaco, Courier, monospace;
--color-foreground-primary: #111;
--color-foreground-secondary: var(--color-foreground-primary);
--color-foreground-muted: #333;
--color-background-secondary: #FFF;
--color-background-hover: #f2f2f2;
--color-brand-primary: #111;
--color-brand-content: #06C;
--color-api-background: #cdcdcd;
--color-inline-code-background: rgba(0,0,0,.03);
--color-sidebar-link-text: #111;
--color-sidebar-item-background--current: #ebebeb;
--color-sidebar-item-background--hover: #f2f2f2;
--toc-font-size: var(--font-size--small);
--color-admonition-title-background--note: var(--color-background-primary);
--color-admonition-title-background--tip: var(--color-background-primary);
--color-admonition-title-background--important: var(--color-background-primary);
--color-admonition-title-background--caution: var(--color-background-primary);
--color-admonition-title--note: #24598F;
--color-admonition-title--tip: #24598F;
--color-admonition-title--important: #C7162B;
--color-admonition-title--caution: #F99B11;
--color-highlighted-background: #EbEbEb;
--color-link-underline: var(--color-background-primary);
--color-link-underline--hover: var(--color-background-primary);
--color-version-popup: #772953;
}

@media not print {
body[data-theme="dark"] {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
--color-foreground-secondary: var(--color-foreground-primary);
--color-foreground-muted: #CDCDCD;
--color-background-secondary: var(--color-background-primary);
--color-background-hover: #666;
--color-brand-primary: #fff;
--color-brand-content: #06C;
--color-sidebar-link-text: #f7f7f7;
--color-sidebar-item-background--current: #666;
--color-sidebar-item-background--hover: #333;
--color-admonition-background: transparent;
--color-admonition-title-background--note: var(--color-background-primary);
--color-admonition-title-background--tip: var(--color-background-primary);
--color-admonition-title-background--important: var(--color-background-primary);
--color-admonition-title-background--caution: var(--color-background-primary);
--color-admonition-title--note: #24598F;
--color-admonition-title--tip: #24598F;
--color-admonition-title--important: #C7162B;
--color-admonition-title--caution: #F99B11;
--color-highlighted-background: #666;
--color-link-underline: var(--color-background-primary);
--color-link-underline--hover: var(--color-background-primary);
--color-version-popup: #F29879;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
--color-foreground-secondary: var(--color-foreground-primary);
--color-foreground-muted: #CDCDCD;
--color-background-secondary: var(--color-background-primary);
--color-background-hover: #666;
--color-brand-primary: #fff;
--color-brand-content: #06C;
--color-sidebar-link-text: #f7f7f7;
--color-sidebar-item-background--current: #666;
--color-sidebar-item-background--hover: #333;
--color-admonition-background: transparent;
--color-admonition-title-background--note: var(--color-background-primary);
--color-admonition-title-background--tip: var(--color-background-primary);
--color-admonition-title-background--important: var(--color-background-primary);
--color-admonition-title-background--caution: var(--color-background-primary);
--color-admonition-title--note: #24598F;
--color-admonition-title--tip: #24598F;
--color-admonition-title--important: #C7162B;
--color-admonition-title--caution: #F99B11;
--color-highlighted-background: #666;
--color-link-underline: var(--color-background-primary);
--color-link-underline--hover: var(--color-background-primary);
--color-version-popup: #F29879;
}
}
}
10 changes: 10 additions & 0 deletions docs/.sphinx/_static/header-nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$(document).ready(function() {
$(document).on("click", function () {
$(".more-links-dropdown").hide();
});

$('.nav-more-links').click(function(event) {
$('.more-links-dropdown').toggle();
event.stopPropagation();
});
})
167 changes: 167 additions & 0 deletions docs/.sphinx/_static/header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
.p-navigation {
border-bottom: 1px solid var(--color-sidebar-background-border);
}

.p-navigation__nav {
background: #333333;
display: flex;
}

.p-logo {
display: flex !important;
padding-top: 0 !important;
text-decoration: none;
}

.p-logo-image {
height: 44px;
padding-right: 10px;
}

.p-logo-text {
margin-top: 18px;
color: white;
text-decoration: none;
}

ul.p-navigation__links {
display: flex;
list-style: none;
margin-left: 0;
margin-top: auto;
margin-bottom: auto;
max-width: 800px;
width: 100%;
}

ul.p-navigation__links li {
margin: 0 auto;
text-align: center;
width: 100%;
}

ul.p-navigation__links li a {
background-color: rgba(0, 0, 0, 0);
border: none;
border-radius: 0;
color: var(--color-sidebar-link-text);
display: block;
font-weight: 400;
line-height: 1.5rem;
margin: 0;
overflow: hidden;
padding: 1rem 0;
position: relative;
text-align: left;
text-overflow: ellipsis;
transition-duration: .1s;
transition-property: background-color, color, opacity;
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
white-space: nowrap;
width: 100%;
}

ul.p-navigation__links .p-navigation__link {
color: #ffffff;
font-weight: 300;
text-align: center;
text-decoration: none;
}

ul.p-navigation__links .p-navigation__link:hover {
background-color: #2b2b2b;
}

ul.p-navigation__links .p-dropdown__link:hover {
background-color: var(--color-sidebar-item-background--hover);
}

ul.p-navigation__links .p-navigation__sub-link {
background: var(--color-background-primary);
padding: .5rem 0 .5rem .5rem;
font-weight: 300;
}

ul.p-navigation__links .more-links-dropdown li a {
border-left: 1px solid var(--color-sidebar-background-border);
border-right: 1px solid var(--color-sidebar-background-border);
}

ul.p-navigation__links .more-links-dropdown li:first-child a {
border-top: 1px solid var(--color-sidebar-background-border);
}

ul.p-navigation__links .more-links-dropdown li:last-child a {
border-bottom: 1px solid var(--color-sidebar-background-border);
}

ul.p-navigation__links .p-navigation__logo {
padding: 0.5rem;
}

ul.p-navigation__links .p-navigation__logo img {
width: 40px;
}

ul.more-links-dropdown {
display: none;
overflow-x: visible;
height: 0;
z-index: 55;
padding: 0;
position: relative;
list-style: none;
margin-bottom: 0;
margin-top: 0;
}

.nav-more-links::after {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill='%23111' d='M8.187 11.748l6.187-6.187-1.06-1.061-5.127 5.127L3.061 4.5 2 5.561z'/%3E%3C/svg%3E");
background-position: center;
background-repeat: no-repeat;
background-size: contain;
content: "";
display: block;
filter: invert(100%);
height: 1rem;
pointer-events: none;
position: absolute;
right: 1rem;
text-indent: calc(100% + 10rem);
top: calc(1rem + 0.25rem);
width: 1rem;
}

.nav-ubuntu-com {
display: none;
}

@media only screen and (min-width: 480px) {
ul.p-navigation__links li {
width: 100%;
}

.nav-ubuntu-com {
display: inherit;
}
}

@media only screen and (max-width: 800px) {
.nav-more-links {
margin-left: auto !important;
padding-right: 2rem !important;
width: 8rem !important;
}
}

@media only screen and (min-width: 800px) {
ul.p-navigation__links li {
width: 100% !important;
}
}

@media only screen and (min-width: 1310px) {
ul.p-navigation__links {
margin-left: calc(50% - 41em);
}
}
3 changes: 3 additions & 0 deletions docs/.sphinx/_static/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/.sphinx/_templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
const github_url = "{{ github_url }}";
</script>
{% endblock theme_scripts %}

{# ru-fu: don't include the color variables from the conf.py file, but use a
 separate CSS file to save space #}
{% block theme_styles %}
{% endblock theme_styles %}
61 changes: 35 additions & 26 deletions docs/.sphinx/_templates/footer.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{# ru-fu: copied from Furo, with modifications as stated below #}
{# ru-fu: copied from Furo, with modifications as stated below. Modifications are marked 'mod:'. #}

<div class="related-pages">
{% if next -%}
<a class="next-page" href="{{ next.link }}">
<div class="page-info">
<div class="context">
<span>{{ _("Next") }}</span>
{# mod: Per-page navigation #}
{% if meta %}
{% if 'sequential_nav' in meta %}
{% set sequential_nav = meta.sequential_nav %}
{% endif %}
{% endif %}
{# mod: Conditional wrappers to control page navigation buttons #}
{% if sequential_nav != "none" -%}
{% if next and (sequential_nav == "next" or sequential_nav == "both") -%}
<a class="next-page" href="{{ next.link }}">
<div class="page-info">
<div class="context">
<span>{{ _("Next") }}</span>
</div>
<div class="title">{{ next.title }}</div>
</div>
<div class="title">{{ next.title }}</div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
{%- endif %}
{% if prev -%}
<a class="prev-page" href="{{ prev.link }}">
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>{{ _("Previous") }}</span>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
{%- endif %}
{% if prev and (sequential_nav == "prev" or sequential_nav == "both") -%}
<a class="prev-page" href="{{ prev.link }}">
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>{{ _("Previous") }}</span>
</div>
{% if prev.link == pathto(master_doc) %}
<div class="title">{{ _("Home") }}</div>
{% else %}
<div class="title">{{ prev.title }}</div>
{% endif %}
</div>
{% if prev.link == pathto(master_doc) %}
<div class="title">{{ _("Home") }}</div>
{% else %}
<div class="title">{{ prev.title }}</div>
{% endif %}
</div>
</a>
</a>
{%- endif %}
{%- endif %}
</div>
<div class="bottom-of-page">
Expand All @@ -44,7 +53,7 @@
</div>
{%- endif %}

{# ru-fu: removed "Made with" #}
{# mod: removed "Made with" #}

{%- if last_updated -%}
<div class="last-updated">
Expand All @@ -63,7 +72,7 @@
</div>
<div class="right-details">

{# ru-fu: replaced RTD icons with our links #}
{# mod: replaced RTD icons with our links #}

{% if discourse %}
<div class="ask-discourse">
Expand Down
Loading

0 comments on commit cc8cea5

Please sign in to comment.