diff --git a/.gitignore b/.gitignore
index a72a28d93..b6b5efe59 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,5 +7,5 @@ cmd/VERSION
.idea
.vscode
/pebble
-
+.tox/
dist/
diff --git a/HACKING.md b/HACKING.md
index 5bbae7a75..c421d9051 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -202,6 +202,22 @@ ok github.com/canonical/pebble/cmd/pebble 0.165s
...
```
+## Docs
+
+We use [`sphinx`](https://www.sphinx-doc.org/en/master/) to build the docs with styles preconfigured by the [Canonical Documentation Starter Pack](https://github.com/canonical/sphinx-docs-starter-pack).
+
+### Building the Docs
+
+To build the docs, run `tox` under the `docs/` folder.
+
+### Pulling in the Latest Style Changes and Dependencies
+
+To pull in the latest style and dependencies from the starter pack, clone the [Canonical Documentation Starter Pack repository](https://github.com/canonical/sphinx-docs-starter-pack), and follow the README there. TL;DR:
+
+- Copy the content into the `docs/` folder.
+- Remove unnecessary files (like Makefile, cheat sheets, etc.)
+- Under the `docs/` folder, run `python3 build_requirements.py`. This generates the latest `requirements.txt` under the `.sphinx/` folder.
+- Under the `docs/` folder, run `tox -e docs-dep` to compile a pinned requirements file for tox environments.
## Creating a release
diff --git a/docs/.custom_wordlist.txt b/docs/.custom_wordlist.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/docs/.gitignore b/docs/.gitignore
new file mode 100644
index 000000000..89b3d89ac
--- /dev/null
+++ b/docs/.gitignore
@@ -0,0 +1,12 @@
+/*env*/
+.sphinx/venv/
+.sphinx/warnings.txt
+.sphinx/.wordlist.dic
+.sphinx/.doctrees/
+.sphinx/node_modules/
+package*.json
+_build
+.DS_Store
+__pycache__
+.idea/
+.vscode/
diff --git a/docs/.readthedocs.yaml b/docs/.readthedocs.yaml
new file mode 100644
index 000000000..12f286571
--- /dev/null
+++ b/docs/.readthedocs.yaml
@@ -0,0 +1,32 @@
+# .readthedocs.yaml
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required
+version: 2
+
+# Set the version of Python and other tools you might need
+build:
+ os: ubuntu-22.04
+ tools:
+ python: "3.11"
+ jobs:
+ post_checkout:
+ - cd docs && python3 .sphinx/build_requirements.py
+ apt_packages:
+ - distro-info
+
+# Build documentation in the docs/ directory with Sphinx
+sphinx:
+ builder: dirhtml
+ configuration: docs/conf.py
+ fail_on_warning: true
+
+# If using Sphinx, optionally build your docs in additional formats such as PDF
+formats:
+ - pdf
+
+# Optionally declare the Python requirements required to build your docs
+python:
+ install:
+ - requirements: docs/.sphinx/requirements.txt
diff --git a/docs/.sphinx/_static/404.svg b/docs/.sphinx/_static/404.svg
new file mode 100644
index 000000000..b353cd339
--- /dev/null
+++ b/docs/.sphinx/_static/404.svg
@@ -0,0 +1,13 @@
+
+
+
diff --git a/docs/.sphinx/_static/custom.css b/docs/.sphinx/_static/custom.css
new file mode 100644
index 000000000..c81f0981c
--- /dev/null
+++ b/docs/.sphinx/_static/custom.css
@@ -0,0 +1,369 @@
+/**
+ Ubuntu variable font definitions.
+ Based on https://github.com/canonical/vanilla-framework/blob/main/scss/_base_fontfaces.scss
+
+ When font files are updated in Vanilla, the links to font files will need to be updated here as well.
+*/
+
+/* default font set */
+@font-face {
+ font-family: 'Ubuntu variable';
+ font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
+ font-style: normal;
+ font-weight: 100 800; /* min and max value for the weight axis */
+ src: url('https://assets.ubuntu.com/v1/f1ea362b-Ubuntu%5Bwdth,wght%5D-latin-v0.896a.woff2') format('woff2-variations');
+}
+
+@font-face {
+ font-family: 'Ubuntu variable';
+ font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
+ font-style: italic;
+ font-weight: 100 800; /* min and max value for the weight axis */
+ src: url('https://assets.ubuntu.com/v1/90b59210-Ubuntu-Italic%5Bwdth,wght%5D-latin-v0.896a.woff2') format('woff2-variations');
+}
+
+@font-face {
+ font-family: 'Ubuntu Mono variable';
+ font-style: normal;
+ font-weight: 100 800; /* min and max value for the weight axis */
+ src: url('https://assets.ubuntu.com/v1/d5fc1819-UbuntuMono%5Bwght%5D-latin-v0.869.woff2') format('woff2-variations');
+}
+
+/* cyrillic-ext */
+@font-face {
+ font-family: 'Ubuntu variable';
+ font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
+ font-style: normal;
+ font-weight: 100 800; /* min and max value for the weight axis */
+ src: url('https://assets.ubuntu.com/v1/77cd6650-Ubuntu%5Bwdth,wght%5D-cyrillic-extended-v0.896a.woff2') format('woff2-variations');
+ unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
+}
+
+/* cyrillic */
+@font-face {
+ font-family: 'Ubuntu variable';
+ font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
+ font-style: normal;
+ font-weight: 100 800; /* min and max value for the weight axis */
+ src: url('https://assets.ubuntu.com/v1/2702fce5-Ubuntu%5Bwdth,wght%5D-cyrillic-v0.896a.woff2') format('woff2-variations');
+ unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
+}
+
+/* greek-ext */
+@font-face {
+ font-family: 'Ubuntu variable';
+ font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
+ font-style: normal;
+ font-weight: 100 800; /* min and max value for the weight axis */
+ src: url('https://assets.ubuntu.com/v1/5c108b7d-Ubuntu%5Bwdth,wght%5D-greek-extended-v0.896a.woff2') format('woff2-variations');
+ unicode-range: U+1F00-1FFF;
+}
+
+/* greek */
+@font-face {
+ font-family: 'Ubuntu variable';
+ font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
+ font-style: normal;
+ font-weight: 100 800; /* min and max value for the weight axis */
+ src: url('https://assets.ubuntu.com/v1/0a14c405-Ubuntu%5Bwdth,wght%5D-greek-v0.896a.woff2') format('woff2-variations');
+ unicode-range: U+0370-03FF;
+}
+
+/* latin-ext */
+@font-face {
+ font-family: 'Ubuntu variable';
+ font-stretch: 100%; /* min and max value for the width axis, expressed as percentage */
+ font-style: normal;
+ font-weight: 100 800; /* min and max value for the weight axis */
+ src: url('https://assets.ubuntu.com/v1/19f68eeb-Ubuntu%5Bwdth,wght%5D-latin-extended-v0.896a.woff2') format('woff2-variations');
+ unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
+}
+
+
+/** Define font-weights as per Vanilla
+ Based on: https://github.com/canonical/vanilla-framework/blob/main/scss/_base_typography-definitions.scss
+
+ regular text: 400,
+ bold: 550,
+ thin: 300,
+
+ h1: bold,
+ h2: 180;
+ h3: bold,
+ h4: 275,
+ h5: bold,
+ h6: regular
+*/
+
+/* default regular text */
+html {
+ font-weight: 400;
+}
+
+/* heading specific definitions */
+h1, h3, h5 { font-weight: 550; }
+h2 { font-weight: 180; }
+h4 { font-weight: 275; }
+
+/* bold */
+.toc-tree li.scroll-current>.reference,
+dl.glossary dt,
+dl.simple dt,
+dl:not([class]) dt {
+ font-weight: 550;
+}
+
+
+/** Table styling **/
+
+th.head {
+ text-transform: uppercase;
+ font-size: var(--font-size--small);
+ text-align: initial;
+}
+
+table.align-center th.head {
+ text-align: center
+}
+
+table.docutils {
+ border: 0;
+ box-shadow: none;
+ width:100%;
+}
+
+table.docutils td, table.docutils th, table.docutils td:last-child, table.docutils th:last-child, table.docutils td:first-child, table.docutils th:first-child {
+ border-right: none;
+ border-left: none;
+}
+
+/* Allow to centre text horizontally in table data cells */
+table.align-center {
+ text-align: center !important;
+}
+
+/** No rounded corners **/
+
+.admonition, code.literal, .sphinx-tabs-tab, .sphinx-tabs-panel, .highlight {
+ border-radius: 0;
+}
+
+/** Admonition styling **/
+
+.admonition {
+ border-top: 1px solid #d9d9d9;
+ border-right: 1px solid #d9d9d9;
+ border-bottom: 1px solid #d9d9d9;
+}
+
+/** Color for the "copy link" symbol next to headings **/
+
+a.headerlink {
+ color: var(--color-brand-primary);
+}
+
+/** Line to the left of the current navigation entry **/
+
+.sidebar-tree li.current-page {
+ border-left: 2px solid var(--color-brand-primary);
+}
+
+/** Some tweaks for Sphinx tabs **/
+
+[role="tablist"] {
+ border-bottom: 1px solid var(--color-sidebar-item-background--hover);
+}
+
+.sphinx-tabs-tab[aria-selected="true"], .sd-tab-set>input:checked+label{
+ border: 0;
+ border-bottom: 2px solid var(--color-brand-primary);
+ font-weight: 400;
+ font-size: 1rem;
+ color: var(--color-brand-primary);
+}
+
+body[data-theme="dark"] .sphinx-tabs-tab[aria-selected="true"] {
+ background: var(--color-background-primary);
+ border-bottom: 2px solid var(--color-brand-primary);
+}
+
+button.sphinx-tabs-tab[aria-selected="false"]:hover, .sd-tab-set>input:not(:checked)+label:hover {
+ border-bottom: 2px solid var(--color-foreground-border);
+}
+
+button.sphinx-tabs-tab[aria-selected="false"]{
+ border-bottom: 2px solid var(--color-background-primary);
+}
+
+body[data-theme="dark"] .sphinx-tabs-tab {
+ background: var(--color-background-primary);
+}
+
+.sphinx-tabs-tab, .sd-tab-set>label{
+ color: var(--color-brand-primary);
+ font-family: var(--font-stack);
+ font-weight: 400;
+ font-size: 1rem;
+ padding: 1em 1.25em .5em
+}
+
+.sphinx-tabs-panel {
+ border: 0;
+ border-bottom: 1px solid var(--color-sidebar-item-background--hover);
+ background: var(--color-background-primary);
+ padding: 0.75rem 0 0.75rem 0;
+}
+
+body[data-theme="dark"] .sphinx-tabs-panel {
+ background: var(--color-background-primary);
+}
+
+/** A tweak for issue #190 **/
+
+.highlight .hll {
+ background-color: var(--color-highlighted-background);
+}
+
+
+/** Custom classes to fix scrolling in tables by decreasing the
+ font size or breaking certain columns.
+ Specify the classes in the Markdown file with, for example:
+ ```{rst-class} break-col-4 min-width-4-8
+ ```
+**/
+
+table.dec-font-size {
+ font-size: smaller;
+}
+table.break-col-1 td.text-left:first-child {
+ word-break: break-word;
+}
+table.break-col-4 td.text-left:nth-child(4) {
+ word-break: break-word;
+}
+table.min-width-1-15 td.text-left:first-child {
+ min-width: 15em;
+}
+table.min-width-4-8 td.text-left:nth-child(4) {
+ min-width: 8em;
+}
+
+/** Underline for abbreviations **/
+
+abbr[title] {
+ text-decoration: underline solid #cdcdcd;
+}
+
+/** Use the same style for right-details as for left-details **/
+.bottom-of-page .right-details {
+ font-size: var(--font-size--small);
+ display: block;
+}
+
+/** Version switcher */
+button.version_select {
+ color: var(--color-foreground-primary);
+ background-color: var(--color-toc-background);
+ padding: 5px 10px;
+ border: none;
+}
+
+.version_select:hover, .version_select:focus {
+ background-color: var(--color-sidebar-item-background--hover);
+}
+
+.version_dropdown {
+ position: relative;
+ display: inline-block;
+ text-align: right;
+ font-size: var(--sidebar-item-font-size);
+}
+
+.available_versions {
+ display: none;
+ position: absolute;
+ right: 0px;
+ background-color: var(--color-toc-background);
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
+ z-index: 11;
+}
+
+.available_versions a {
+ color: var(--color-foreground-primary);
+ padding: 12px 16px;
+ text-decoration: none;
+ display: block;
+}
+
+.available_versions a:hover {background-color: var(--color-sidebar-item-background--current)}
+
+.show {display:block;}
+
+/** Fix for nested numbered list - the nested list is lettered **/
+ol.arabic ol.arabic {
+ list-style: lower-alpha;
+}
+
+/** Make expandable sections look like links **/
+details summary {
+ color: var(--color-link);
+}
+
+/** Fix the styling of the version box for readthedocs **/
+
+#furo-readthedocs-versions .rst-versions, #furo-readthedocs-versions .rst-current-version, #furo-readthedocs-versions:focus-within .rst-current-version, #furo-readthedocs-versions:hover .rst-current-version {
+ background: var(--color-sidebar-item-background--hover);
+}
+
+.rst-versions .rst-other-versions dd a {
+ color: var(--color-link);
+}
+
+#furo-readthedocs-versions:focus-within .rst-current-version .fa-book, #furo-readthedocs-versions:hover .rst-current-version .fa-book, .rst-versions .rst-other-versions {
+ color: var(--color-sidebar-link-text);
+}
+
+.rst-versions .rst-current-version {
+ color: var(--color-version-popup);
+ font-weight: bolder;
+}
+
+/* Code-block copybutton invisible by default
+ (overriding Furo config to achieve default copybutton setting). */
+.highlight button.copybtn {
+ opacity: 0;
+}
+
+/* Mimicking the 'Give feedback' button for UX consistency */
+.sidebar-search-container input[type=submit] {
+ color: #FFFFFF;
+ border: 2px solid #D6410D;
+ padding: var(--sidebar-search-input-spacing-vertical) var(--sidebar-search-input-spacing-horizontal);
+ background: #D6410D;
+ font-weight: bold;
+ font-size: var(--font-size--small);
+ cursor: pointer;
+}
+
+.sidebar-search-container input[type=submit]:hover {
+ text-decoration: underline;
+}
+
+/* Make inline code the same size as code blocks */
+p code.literal {
+ border: 0;
+ font-size: var(--code-font-size);
+}
+
+/* Use the general admonition font size for inline code */
+.admonition p code.literal {
+ font-size: var(--admonition-font-size);
+}
+
+.highlight .s, .highlight .s1, .highlight .s2 {
+ color: #3F8100;
+}
+
+.highlight .o {
+ color: #BB5400;
+}
diff --git a/docs/.sphinx/_static/favicon.png b/docs/.sphinx/_static/favicon.png
new file mode 100644
index 000000000..7f175e461
Binary files /dev/null and b/docs/.sphinx/_static/favicon.png differ
diff --git a/docs/.sphinx/_static/footer.css b/docs/.sphinx/_static/footer.css
new file mode 100644
index 000000000..a0a1db454
--- /dev/null
+++ b/docs/.sphinx/_static/footer.css
@@ -0,0 +1,47 @@
+.display-contributors {
+ color: var(--color-sidebar-link-text);
+ cursor: pointer;
+}
+.all-contributors {
+ display: none;
+ z-index: 55;
+ list-style: none;
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ width: 200px;
+ height: 200px;
+ overflow-y: scroll;
+ margin: auto;
+ padding: 0;
+ background: var(--color-background-primary);
+ scrollbar-color: var(--color-foreground-border) transparent;
+ scrollbar-width: thin;
+}
+
+.all-contributors li:hover {
+ background: var(--color-sidebar-item-background--hover);
+ width: 100%;
+}
+
+.all-contributors li a{
+ color: var(--color-sidebar-link-text);
+ padding: 1rem;
+ display: inline-block;
+}
+
+#overlay {
+ position: fixed;
+ display: none;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0,0,0,0.5);
+ z-index: 2;
+ cursor: pointer;
+}
diff --git a/docs/.sphinx/_static/footer.js b/docs/.sphinx/_static/footer.js
new file mode 100644
index 000000000..9a08b1e99
--- /dev/null
+++ b/docs/.sphinx/_static/footer.js
@@ -0,0 +1,12 @@
+$(document).ready(function() {
+ $(document).on("click", function () {
+ $(".all-contributors").hide();
+ $("#overlay").hide();
+ });
+
+ $('.display-contributors').click(function(event) {
+ $('.all-contributors').toggle();
+ $("#overlay").toggle();
+ event.stopPropagation();
+ });
+})
diff --git a/docs/.sphinx/_static/furo_colors.css b/docs/.sphinx/_static/furo_colors.css
new file mode 100644
index 000000000..aa3066694
--- /dev/null
+++ b/docs/.sphinx/_static/furo_colors.css
@@ -0,0 +1,87 @@
+body {
+ --color-code-background: #f8f8f8;
+ --color-code-foreground: black;
+ --code-font-size: 1rem;
+ --font-stack: Ubuntu variable, Ubuntu, -apple-system, Segoe UI, Roboto, Oxygen, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
+ --font-stack--monospace: Ubuntu Mono variable, 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: #E3E3E3;
+ --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-link);
+ --color-link-underline--hover: var(--color-link);
+ --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-version-popup: #F29879;
+ }
+ @media (prefers-color-scheme: dark) {
+ body:not([data-theme="light"]) {
+ --color-api-background: #A4A4A4;
+ --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: #F9FCFF;
+ --color-version-popup: #F29879;
+ }
+ }
+}
diff --git a/docs/.sphinx/_static/github_issue_links.css b/docs/.sphinx/_static/github_issue_links.css
new file mode 100644
index 000000000..db166ed95
--- /dev/null
+++ b/docs/.sphinx/_static/github_issue_links.css
@@ -0,0 +1,24 @@
+.github-issue-link-container {
+ padding-right: 0.5rem;
+}
+.github-issue-link {
+ font-size: var(--font-size--small);
+ font-weight: bold;
+ background-color: #D6410D;
+ padding: 13px 23px;
+ text-decoration: none;
+}
+.github-issue-link:link {
+ color: #FFFFFF;
+}
+.github-issue-link:visited {
+ color: #FFFFFF
+}
+.muted-link.github-issue-link:hover {
+ color: #FFFFFF;
+ text-decoration: underline;
+}
+.github-issue-link:active {
+ color: #FFFFFF;
+ text-decoration: underline;
+}
diff --git a/docs/.sphinx/_static/github_issue_links.js b/docs/.sphinx/_static/github_issue_links.js
new file mode 100644
index 000000000..f0706038b
--- /dev/null
+++ b/docs/.sphinx/_static/github_issue_links.js
@@ -0,0 +1,34 @@
+// if we already have an onload function, save that one
+var prev_handler = window.onload;
+
+window.onload = function() {
+ // call the previous onload function
+ if (prev_handler) {
+ prev_handler();
+ }
+
+ const link = document.createElement("a");
+ link.classList.add("muted-link");
+ link.classList.add("github-issue-link");
+ link.text = "Give feedback";
+ link.href = (
+ github_url
+ + "/issues/new?"
+ + "title=docs%3A+TYPE+YOUR+QUESTION+HERE"
+ + "&body=*Please describe the question or issue you're facing with "
+ + `"${document.title}"`
+ + ".*"
+ + "%0A%0A%0A%0A%0A"
+ + "---"
+ + "%0A"
+ + `*Reported+from%3A+${location.href}*`
+ );
+ link.target = "_blank";
+
+ const div = document.createElement("div");
+ div.classList.add("github-issue-link-container");
+ div.append(link)
+
+ const container = document.querySelector(".article-container > .content-icon-container");
+ container.prepend(div);
+};
diff --git a/docs/.sphinx/_static/header-nav.js b/docs/.sphinx/_static/header-nav.js
new file mode 100644
index 000000000..3608576e0
--- /dev/null
+++ b/docs/.sphinx/_static/header-nav.js
@@ -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();
+ });
+})
diff --git a/docs/.sphinx/_static/header.css b/docs/.sphinx/_static/header.css
new file mode 100644
index 000000000..0b9440903
--- /dev/null
+++ b/docs/.sphinx/_static/header.css
@@ -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);
+ }
+}
diff --git a/docs/.sphinx/_static/tag.png b/docs/.sphinx/_static/tag.png
new file mode 100644
index 000000000..f6f6e5aa4
Binary files /dev/null and b/docs/.sphinx/_static/tag.png differ
diff --git a/docs/.sphinx/_templates/404.html b/docs/.sphinx/_templates/404.html
new file mode 100644
index 000000000..4cb2d50d3
--- /dev/null
+++ b/docs/.sphinx/_templates/404.html
@@ -0,0 +1,17 @@
+{% extends "page.html" %}
+
+{% block content -%}
+Page not found
+
Sorry, but the documentation page that you are looking for was not found.
\n\nDocumentation changes over time, and pages are moved around. We try to redirect you to the updated content where possible, but unfortunately, that didn\'t work this time (maybe because the content you were looking for does not exist in this version of the documentation).
\nYou can try to use the navigation to locate the content you\'re looking for, or search for a similar page.
\n', +} + +# Default image for OGP (to prevent font errors, see +# https://github.com/canonical/sphinx-docs-starter-pack/pull/54 ) +if not 'ogp_image' in locals(): + ogp_image = 'https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg' + +############################################################ +### General configuration +############################################################ + +exclude_patterns = [ + '_build', + 'Thumbs.db', + '.DS_Store', + '.sphinx', +] +exclude_patterns.extend(custom_excludes) + +rst_epilog = ''' +.. include:: /reuse/links.txt +''' +if 'custom_rst_epilog' in locals(): + rst_epilog = custom_rst_epilog + +if 'custom_manpages_url' in locals(): + manpages_url = custom_manpages_url +else: + manpages_distribution = subprocess.check_output("distro-info --stable", + text=True, shell=True).strip() + manpages_url = ("https://manpages.ubuntu.com/manpages/" + f"{manpages_distribution}/en/" + "man{section}/{page}.{section}.html") + +source_suffix = { + '.rst': 'restructuredtext', + '.md': 'markdown', +} + +if not 'conf_py_path' in html_context and 'github_folder' in html_context: + html_context['conf_py_path'] = html_context['github_folder'] + +# For ignoring specific links +linkcheck_anchors_ignore_for_url = [ + r'https://github\.com/.*' +] +linkcheck_anchors_ignore_for_url.extend(custom_linkcheck_anchors_ignore_for_url) + +# Tags cannot be added directly in custom_conf.py, so add them here +for tag in custom_tags: + tags.add(tag) + +# html_context['get_contribs'] is a function and cannot be +# cached (see https://github.com/sphinx-doc/sphinx/issues/12300) +suppress_warnings = ["config.cache"] + +############################################################ +### Styling +############################################################ + +# Find the current builder +builder = 'dirhtml' +if '-b' in sys.argv: + builder = sys.argv[sys.argv.index('-b')+1] + +# Setting templates_path for epub makes the build fail +if builder == 'dirhtml' or builder == 'html': + templates_path = ['.sphinx/_templates'] + notfound_template = '404.html' + +# Theme configuration +html_theme = 'furo' +html_last_updated_fmt = '' +html_permalinks_icon = '¶' + +if html_title == '': + html_theme_options = { + 'sidebar_hide_name': True + } + +############################################################ +### Additional files +############################################################ + +html_static_path = ['.sphinx/_static'] + +html_css_files = [ + 'custom.css', + 'header.css', + 'github_issue_links.css', + 'furo_colors.css', + 'footer.css' +] +html_css_files.extend(custom_html_css_files) + +html_js_files = ['header-nav.js', 'footer.js'] +if 'github_issues' in html_context and html_context['github_issues'] and not disable_feedback_button: + html_js_files.append('github_issue_links.js') +html_js_files.extend(custom_html_js_files) + +############################################################# +# Display the contributors + +def get_contributors_for_file(github_url, github_folder, pagename, page_source_suffix, display_contributors_since=None): + filename = f"{pagename}{page_source_suffix}" + paths=html_context['github_folder'][1:] + filename + repo = Repo("../") + since = display_contributors_since if display_contributors_since and display_contributors_since.strip() else None + + commits = repo.iter_commits(paths=paths, since=since) + + contributors_dict = {} + for commit in commits: + contributor = commit.author.name + if contributor not in contributors_dict or commit.committed_date > contributors_dict[contributor]['date']: + contributors_dict[contributor] = { + 'date': commit.committed_date, + 'sha': commit.hexsha + } + # The github_page contains the link to the contributor's latest commit. + contributors_list = [{'name': name, 'github_page': f"{github_url}/commit/{data['sha']}"} for name, data in contributors_dict.items()] + sorted_contributors_list = sorted(contributors_list, key=lambda x: x['name']) + return sorted_contributors_list + +html_context['get_contribs'] = get_contributors_for_file +############################################################# diff --git a/docs/custom_conf.py b/docs/custom_conf.py new file mode 100644 index 000000000..616a2eba5 --- /dev/null +++ b/docs/custom_conf.py @@ -0,0 +1,217 @@ +import datetime + +# Custom configuration for the Sphinx documentation builder. +# All configuration specific to your project should be done in this file. +# +# The file is included in the common conf.py configuration file. +# You can modify any of the settings below or add any configuration that +# is not covered by the common conf.py file. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html +# +# If you're not familiar with Sphinx and don't want to use advanced +# features, it is sufficient to update the settings in the "Project +# information" section. + +############################################################ +### Project information +############################################################ + +# Product name +project = 'Documentation starter pack' +author = 'Canonical Group Ltd' + +# The title you want to display for the documentation in the sidebar. +# You might want to include a version number here. +# To not display any title, set this option to an empty string. +html_title = project + ' documentation' + +# The default value uses the current year as the copyright year. +# +# For static works, it is common to provide the year of first publication. +# Another option is to give the first year and the current year +# for documentation that is often changed, e.g. 2022–2023 (note the en-dash). +# +# A way to check a GitHub repo's creation date is to obtain a classic GitHub +# token with 'repo' permissions here: https://github.com/settings/tokens +# Next, use 'curl' and 'jq' to extract the date from the GitHub API's output: +# +# curl -H 'Authorization: token