diff --git a/.github/workflows/automatic-doc-checks.yml b/.github/workflows/automatic-doc-checks.yml new file mode 100644 index 0000000..66c917d --- /dev/null +++ b/.github/workflows/automatic-doc-checks.yml @@ -0,0 +1,23 @@ +# +name: Automatic doc checks + +on: + push: + branches: [ main ] + pull_request: + paths: + - 'docs/**' # Only run on changes to the docs directory + + workflow_dispatch: + # Manual trigger + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + documentation-checks: + uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main + with: + working-directory: "docs" + fetch-depth: 0 diff --git a/.github/workflows/check-removed-urls.yml b/.github/workflows/check-removed-urls.yml new file mode 100644 index 0000000..22f72ef --- /dev/null +++ b/.github/workflows/check-removed-urls.yml @@ -0,0 +1,55 @@ +name: Check for removed URLs + +on: + workflow_call: + pull_request: + branches: [main] + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout PR branch + uses: actions/checkout@v5 + with: + # This implicitly gets the PR branch. Making it explicit causes problems + # with private forks, but it is equivalent to the following: + # repository: ${{ github.event.pull_request.head.repo.full_name }} + # ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 + path: compare + - name: Checkout base branch + uses: actions/checkout@v5 + with: + ref: ${{ github.event.pull_request.base.ref }} + repository: ${{ github.event.pull_request.base.repo.full_name }} + fetch-depth: 0 + path: base + - uses: actions/setup-python@v6 + - name: Build docs + run: | + for dir in compare base; do + pushd ${dir}/docs + make html + popd + done + - name: Generate current URLs list + run: | + for dir in compare base; do + pushd ${dir}/docs + find ./_build/ -name '*.html' \ + | sed 's|/_build||;s|/index.html$|/|;s|.html$||' \ + | sort > urls.txt + popd + done + - name: Compare URLs + run: | + BASE_URLS_PATH="base/docs/urls.txt" + COMPARE_URLS_PATH="compare/docs/urls.txt" + removed=$(comm -23 ${BASE_URLS_PATH} ${COMPARE_URLS_PATH} ) + if [ -n "$removed" ]; then + echo "The following URLs were removed:" + echo "$removed" + echo "Please ensure removed pages are redirected" + exit 1 + fi diff --git a/.github/workflows/cla-check.yml b/.github/workflows/cla-check.yml new file mode 100644 index 0000000..7de3076 --- /dev/null +++ b/.github/workflows/cla-check.yml @@ -0,0 +1,17 @@ +# This workflow checks if the contributor has signed the Canonical Contributor Licence Agreement (CLA) +name: Canonical Contributor Licence Agreement check + +on: + pull_request: + branches: [main] + +permissions: + contents: read + pull-requests: read + +jobs: + cla-check: + runs-on: ubuntu-latest + steps: + - name: Check if CLA signed + uses: canonical/has-signed-canonical-cla@v2 diff --git a/.github/workflows/markdown-style-checks.yml b/.github/workflows/markdown-style-checks.yml new file mode 100644 index 0000000..c218164 --- /dev/null +++ b/.github/workflows/markdown-style-checks.yml @@ -0,0 +1,28 @@ +name: Markdown style checks + +on: + workflow_call: + push: + branches: + - main + paths: + - 'docs/**' # Only run on changes to the docs directory + pull_request: + branches: + - '*' + paths: + - 'docs/**' # Only run on changes to the docs directory + +jobs: + markdown-lint: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Create venv + working-directory: "docs" + run: make install + - name: Lint markdown + working-directory: "docs" + run: make lint-md diff --git a/.github/workflows/sphinx-python-dependency-build-checks.yml b/.github/workflows/sphinx-python-dependency-build-checks.yml index b9d6413..71571e7 100644 --- a/.github/workflows/sphinx-python-dependency-build-checks.yml +++ b/.github/workflows/sphinx-python-dependency-build-checks.yml @@ -9,48 +9,44 @@ # Depending on the architecture, pip may or may not have already built wheels # available, and as such we need to make sure building wheels from source can # succeed. -name: Check and document build requirements for Sphinx venv +name: Sphinx python dependency build checks + on: push: - paths: - - 'conf.py' - - 'custom_conf.py' + branches: [ main ] pull_request: - paths: - - 'conf.py' - - 'custom_conf.py' - workflow_dispatch: - + workflow_call: + workflow_dispatch: # manual trigger concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: true jobs: build: name: build runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - set -ex - sudo apt -y install \ - cargo \ - libpython3-dev \ - libxml2-dev \ - libxslt1-dev \ - make \ - python3-venv \ - rustc \ - libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev + - name: Checkout code + uses: actions/checkout@v5 - - name: Build Sphinx venv - run: | - set -ex - make -f Makefile.sp \ - sp-install \ - PIPOPTS="--no-binary :all:" \ - || ( cat .sphinx/venv/pip_install.log && exit 1 ) + - name: Install dependencies + run: | + set -ex + sudo apt-get --fix-missing update + sudo apt-get -y install \ + cargo \ + libpython3-dev \ + libxml2-dev \ + libxslt1-dev \ + make \ + python3-venv \ + rustc \ + libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev + - name: Build Sphinx venv + working-directory: "docs" + run: | + set -ex + make install \ + PIPOPTS="--no-binary :all:" \ + || ( cat .venv/pip_install.log && exit 1 ) diff --git a/.gitignore b/.gitignore index 25a54f0..2ad0dcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,9 @@ /*env*/ -.sphinx/venv/ -.sphinx/requirements.txt -.sphinx/warnings.txt -.sphinx/.wordlist.dic -.sphinx/.doctrees/ -.sphinx/node_modules/ +**/.venv/ +**/.doctrees/ package*.json -_build +docs/_build .DS_Store __pycache__ .idea/ .vscode/ -.sphinx/styles/* -.sphinx/vale.ini \ No newline at end of file diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 5482803..ec26cd6 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,21 +11,29 @@ build: tools: python: "3.11" jobs: - pre_install: - - python3 .sphinx/build_requirements.py - - git fetch --unshallow || true + post_checkout: + - git fetch --unshallow || true + # Cancel building pull requests when there aren't changed in the docs directory. + # If there are no changes (git diff exits with 0) we force the command to return with 183. + # This is a special exit code on Read the Docs that will cancel the build immediately. + # https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition + - | + if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- 'docs/' '.readthedocs.yaml'; + then + exit 183; + fi # Build documentation in the docs/ directory with Sphinx sphinx: builder: dirhtml - configuration: conf.py + configuration: docs/conf.py fail_on_warning: true # If using Sphinx, optionally build your docs in additional formats such as PDF -#formats: -# - pdf +formats: +- pdf # Optionally declare the Python requirements required to build your docs python: - install: - - requirements: .sphinx/requirements.txt + install: + - requirements: docs/requirements.txt diff --git a/.sphinx/_static/404.svg b/.sphinx/_static/404.svg deleted file mode 100644 index b353cd3..0000000 --- a/.sphinx/_static/404.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/.sphinx/_static/custom.css b/.sphinx/_static/custom.css deleted file mode 100644 index 2b9e81f..0000000 --- a/.sphinx/_static/custom.css +++ /dev/null @@ -1,392 +0,0 @@ -/** - 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)} - -/** Suppress link underlines outside on-hover **/ -a { - text-decoration: none; -} - -a:hover, a:visited:hover { - text-decoration: underline; -} - -.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; -} - -.rubric > .hclass2 { - display: block; - font-size: 2em; - border-radius: .5rem; - font-weight: 300; - line-height: 1.25; - margin-top: 1.75rem; - margin-right: -0.5rem; - margin-bottom: 0.5rem; - margin-left: -0.5rem; - padding-left: .5rem; - padding-right: .5rem; -} \ No newline at end of file diff --git a/.sphinx/_static/favicon.png b/.sphinx/_static/favicon.png deleted file mode 100644 index 7f175e4..0000000 Binary files a/.sphinx/_static/favicon.png and /dev/null differ diff --git a/.sphinx/_static/footer.css b/.sphinx/_static/footer.css deleted file mode 100644 index a0a1db4..0000000 --- a/.sphinx/_static/footer.css +++ /dev/null @@ -1,47 +0,0 @@ -.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/.sphinx/_static/footer.js b/.sphinx/_static/footer.js deleted file mode 100644 index 9a08b1e..0000000 --- a/.sphinx/_static/footer.js +++ /dev/null @@ -1,12 +0,0 @@ -$(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/.sphinx/_static/furo_colors.css b/.sphinx/_static/furo_colors.css deleted file mode 100644 index 4cfdbe7..0000000 --- a/.sphinx/_static/furo_colors.css +++ /dev/null @@ -1,89 +0,0 @@ -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-link-underline--visited: var(--color-link--visited); - --color-link-underline--visited--hover: var(--color-link--visited); - --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: #69C; - --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: #69C; - --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/.sphinx/_static/github_issue_links.css b/.sphinx/_static/github_issue_links.css deleted file mode 100644 index db166ed..0000000 --- a/.sphinx/_static/github_issue_links.css +++ /dev/null @@ -1,24 +0,0 @@ -.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/.sphinx/_static/github_issue_links.js b/.sphinx/_static/github_issue_links.js deleted file mode 100644 index f070603..0000000 --- a/.sphinx/_static/github_issue_links.js +++ /dev/null @@ -1,34 +0,0 @@ -// 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/.sphinx/_static/header-nav.js b/.sphinx/_static/header-nav.js deleted file mode 100644 index 3608576..0000000 --- a/.sphinx/_static/header-nav.js +++ /dev/null @@ -1,10 +0,0 @@ -$(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/.sphinx/_static/header.css b/.sphinx/_static/header.css deleted file mode 100644 index 0b94409..0000000 --- a/.sphinx/_static/header.css +++ /dev/null @@ -1,167 +0,0 @@ -.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/.sphinx/_static/tag.png b/.sphinx/_static/tag.png deleted file mode 100644 index f6f6e5a..0000000 Binary files a/.sphinx/_static/tag.png and /dev/null differ diff --git a/.sphinx/_templates/404.html b/.sphinx/_templates/404.html deleted file mode 100644 index 4cb2d50..0000000 --- a/.sphinx/_templates/404.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "page.html" %} - -{% block content -%} -
-

Page not found

-
-
-
- {{ body }} -
-
- Penguin with a question mark -
-
-
-
-{%- endblock content %} diff --git a/.sphinx/_templates/base.html b/.sphinx/_templates/base.html deleted file mode 100644 index 3308154..0000000 --- a/.sphinx/_templates/base.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "furo/base.html" %} - -{% block theme_scripts %} - -{% 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 %} diff --git a/.sphinx/_templates/header.html b/.sphinx/_templates/header.html deleted file mode 100644 index 1a128b6..0000000 --- a/.sphinx/_templates/header.html +++ /dev/null @@ -1,36 +0,0 @@ - diff --git a/.sphinx/_templates/page.html b/.sphinx/_templates/page.html deleted file mode 100644 index bda3061..0000000 --- a/.sphinx/_templates/page.html +++ /dev/null @@ -1,49 +0,0 @@ -{% extends "furo/page.html" %} - -{% block footer %} - {% include "footer.html" %} -{% endblock footer %} - -{% block body -%} - {% include "header.html" %} - {{ super() }} -{%- endblock body %} - -{% if meta and ((meta.discourse and discourse_prefix) or meta.relatedlinks) %} - {% set furo_hide_toc_orig = furo_hide_toc %} - {% set furo_hide_toc=false %} -{% endif %} - -{% block right_sidebar %} -
- {% if not furo_hide_toc_orig %} -
- - {{ _("Contents") }} - -
-
-
- {{ toc }} -
-
- {% endif %} - {% if meta and ((meta.discourse and discourse_prefix) or meta.relatedlinks) %} - - - {% endif %} -
-{% endblock right_sidebar %} diff --git a/.sphinx/_templates/sidebar/search.html b/.sphinx/_templates/sidebar/search.html deleted file mode 100644 index 644a5ef..0000000 --- a/.sphinx/_templates/sidebar/search.html +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/.sphinx/build_requirements.py b/.sphinx/build_requirements.py deleted file mode 100644 index df6f149..0000000 --- a/.sphinx/build_requirements.py +++ /dev/null @@ -1,127 +0,0 @@ -import sys - -sys.path.append('./') -from custom_conf import * - -# The file contains helper functions and the mechanism to build the -# .sphinx/requirements.txt file that is needed to set up the virtual -# environment. - -# You should not do any modifications to this file. Put your custom -# requirements into the custom_required_modules array in the custom_conf.py -# file. If you need to change this file, contribute the changes upstream. - -legacyCanonicalSphinxExtensionNames = [ - "youtube-links", - "related-links", - "custom-rst-roles", - "terminal-output" - ] - -def IsAnyCanonicalSphinxExtensionUsed(): - for extension in custom_extensions: - if (extension.startswith("canonical.") or - extension in legacyCanonicalSphinxExtensionNames): - return True - - return False - -def IsNotFoundExtensionUsed(): - return "notfound.extension" in custom_extensions - -def IsSphinxTabsUsed(): - for extension in custom_extensions: - if extension.startswith("sphinx_tabs."): - return True - - return False - -def AreRedirectsDefined(): - return ("sphinx_reredirects" in custom_extensions) or ( - ("redirects" in globals()) and \ - (redirects is not None) and \ - (len(redirects) > 0)) - -def IsOpenGraphConfigured(): - if "sphinxext.opengraph" in custom_extensions: - return True - - for global_variable_name in list(globals()): - if global_variable_name.startswith("ogp_"): - return True - - return False - -def IsMyStParserUsed(): - return ("myst_parser" in custom_extensions) or \ - ("custom_myst_extensions" in globals()) - -def DeduplicateExtensions(extensionNames: [str]): - extensionNames = dict.fromkeys(extensionNames) - resultList = [] - encounteredCanonicalExtensions = [] - - for extensionName in extensionNames: - if extensionName in legacyCanonicalSphinxExtensionNames: - extensionName = "canonical." + extensionName - - if extensionName.startswith("canonical."): - if extensionName not in encounteredCanonicalExtensions: - encounteredCanonicalExtensions.append(extensionName) - resultList.append(extensionName) - else: - resultList.append(extensionName) - - return resultList - -if __name__ == "__main__": - requirements = [ - "furo", - "pyspelling", - "sphinx", - "sphinx-autobuild", - "sphinx-copybutton", - "sphinx-design", - "sphinxcontrib-jquery", - "watchfiles", - "GitPython" - - ] - - requirements.extend(custom_required_modules) - - if IsAnyCanonicalSphinxExtensionUsed(): - requirements.append("canonical-sphinx-extensions") - - if IsNotFoundExtensionUsed(): - requirements.append("sphinx-notfound-page") - - if IsSphinxTabsUsed(): - requirements.append("sphinx-tabs") - - if AreRedirectsDefined(): - requirements.append("sphinx-reredirects") - - if IsOpenGraphConfigured(): - requirements.append("sphinxext-opengraph") - - if IsMyStParserUsed(): - requirements.append("myst-parser") - requirements.append("linkify-it-py") - - # removes duplicate entries - requirements = list(dict.fromkeys(requirements)) - requirements.sort() - - with open(".sphinx/requirements.txt", 'w') as requirements_file: - requirements_file.write( - "# DO NOT MODIFY THIS FILE DIRECTLY!\n" - "#\n" - "# This file is generated automatically.\n" - "# Add custom requirements to the custom_required_modules\n" - "# array in the custom_conf.py file and run:\n" - "# make clean && make install\n") - - for requirement in requirements: - requirements_file.write(requirement) - requirements_file.write('\n') diff --git a/.sphinx/fonts/Ubuntu-B.ttf b/.sphinx/fonts/Ubuntu-B.ttf deleted file mode 100644 index b173da2..0000000 Binary files a/.sphinx/fonts/Ubuntu-B.ttf and /dev/null differ diff --git a/.sphinx/fonts/Ubuntu-R.ttf b/.sphinx/fonts/Ubuntu-R.ttf deleted file mode 100644 index d748728..0000000 Binary files a/.sphinx/fonts/Ubuntu-R.ttf and /dev/null differ diff --git a/.sphinx/fonts/Ubuntu-RI.ttf b/.sphinx/fonts/Ubuntu-RI.ttf deleted file mode 100644 index 4f2d2bc..0000000 Binary files a/.sphinx/fonts/Ubuntu-RI.ttf and /dev/null differ diff --git a/.sphinx/fonts/UbuntuMono-B.ttf b/.sphinx/fonts/UbuntuMono-B.ttf deleted file mode 100644 index 7bd6665..0000000 Binary files a/.sphinx/fonts/UbuntuMono-B.ttf and /dev/null differ diff --git a/.sphinx/fonts/UbuntuMono-R.ttf b/.sphinx/fonts/UbuntuMono-R.ttf deleted file mode 100644 index fdd309d..0000000 Binary files a/.sphinx/fonts/UbuntuMono-R.ttf and /dev/null differ diff --git a/.sphinx/fonts/UbuntuMono-RI.ttf b/.sphinx/fonts/UbuntuMono-RI.ttf deleted file mode 100644 index 18f81a2..0000000 Binary files a/.sphinx/fonts/UbuntuMono-RI.ttf and /dev/null differ diff --git a/.sphinx/fonts/ubuntu-font-licence-1.0.txt b/.sphinx/fonts/ubuntu-font-licence-1.0.txt deleted file mode 100644 index ae78a8f..0000000 --- a/.sphinx/fonts/ubuntu-font-licence-1.0.txt +++ /dev/null @@ -1,96 +0,0 @@ -------------------------------- -UBUNTU FONT LICENCE Version 1.0 -------------------------------- - -PREAMBLE -This licence allows the licensed fonts to be used, studied, modified and -redistributed freely. The fonts, including any derivative works, can be -bundled, embedded, and redistributed provided the terms of this licence -are met. The fonts and derivatives, however, cannot be released under -any other licence. The requirement for fonts to remain under this -licence does not require any document created using the fonts or their -derivatives to be published under this licence, as long as the primary -purpose of the document is not to be a vehicle for the distribution of -the fonts. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this licence and clearly marked as such. This may -include source files, build scripts and documentation. - -"Original Version" refers to the collection of Font Software components -as received under this licence. - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to -a new environment. - -"Copyright Holder(s)" refers to all individuals and companies who have a -copyright ownership of the Font Software. - -"Substantially Changed" refers to Modified Versions which can be easily -identified as dissimilar to the Font Software by users of the Font -Software comparing the Original Version with the Modified Version. - -To "Propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification and with or without charging -a redistribution fee), making available to the public, and in some -countries other activities as well. - -PERMISSION & CONDITIONS -This licence does not grant any rights under trademark law and all such -rights are reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of the Font Software, to propagate the Font Software, subject to -the below conditions: - -1) Each copy of the Font Software must contain the above copyright -notice and this licence. These can be included either as stand-alone -text files, human-readable headers or in the appropriate machine- -readable metadata fields within text or binary files as long as those -fields can be easily viewed by the user. - -2) The font name complies with the following: -(a) The Original Version must retain its name, unmodified. -(b) Modified Versions which are Substantially Changed must be renamed to -avoid use of the name of the Original Version or similar names entirely. -(c) Modified Versions which are not Substantially Changed must be -renamed to both (i) retain the name of the Original Version and (ii) add -additional naming elements to distinguish the Modified Version from the -Original Version. The name of such Modified Versions must be the name of -the Original Version, with "derivative X" where X represents the name of -the new work, appended to that name. - -3) The name(s) of the Copyright Holder(s) and any contributor to the -Font Software shall not be used to promote, endorse or advertise any -Modified Version, except (i) as required by this licence, (ii) to -acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with -their explicit written permission. - -4) The Font Software, modified or unmodified, in part or in whole, must -be distributed entirely under this licence, and must not be distributed -under any other licence. The requirement for fonts to remain under this -licence does not affect any document created using the Font Software, -except any version of the Font Software extracted from a document -created using the Font Software may only be distributed under this -licence. - -TERMINATION -This licence becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF -COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER -DEALINGS IN THE FONT SOFTWARE. diff --git a/.sphinx/get_vale_conf.py b/.sphinx/get_vale_conf.py deleted file mode 100644 index 23d8901..0000000 --- a/.sphinx/get_vale_conf.py +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env python - -import requests -import os - -DIR=os.getcwd() - -def main(): - - if os.path.exists(f"{DIR}/.sphinx/styles/Canonical"): - print("Vale directory exists") - else: - os.makedirs(f"{DIR}/.sphinx/styles/Canonical") - - url = "https://api.github.com/repos/canonical/praecepta/contents/styles/Canonical" - r = requests.get(url) - for item in r.json(): - download = requests.get(item["download_url"]) - file = open(".sphinx/styles/Canonical/" + item["name"], "w") - file.write(download.text) - file.close() - - if os.path.exists(f"{DIR}/.sphinx/styles/config/vocabularies/Canonical"): - print("Vocab directory exists") - else: - os.makedirs(f"{DIR}/.sphinx/styles/config/vocabularies/Canonical") - - url = "https://api.github.com/repos/canonical/praecepta/contents/styles/config/vocabularies/Canonical" - r = requests.get(url) - for item in r.json(): - download = requests.get(item["download_url"]) - file = open(".sphinx/styles/config/vocabularies/Canonical/" + item["name"], "w") - file.write(download.text) - file.close() - config = requests.get("https://raw.githubusercontent.com/canonical/praecepta/main/vale.ini") - file = open(".sphinx/vale.ini", "w") - file.write(config.text) - file.close() - -if __name__ == "__main__": - main() diff --git a/.sphinx/images/Canonical-logo-4x.png b/.sphinx/images/Canonical-logo-4x.png deleted file mode 100644 index fd75696..0000000 Binary files a/.sphinx/images/Canonical-logo-4x.png and /dev/null differ diff --git a/.sphinx/images/front-page-light.pdf b/.sphinx/images/front-page-light.pdf deleted file mode 100644 index bb68cdf..0000000 Binary files a/.sphinx/images/front-page-light.pdf and /dev/null differ diff --git a/.sphinx/images/front-page.png b/.sphinx/images/front-page.png deleted file mode 100644 index c80e843..0000000 Binary files a/.sphinx/images/front-page.png and /dev/null differ diff --git a/.sphinx/images/normal-page-footer.pdf b/.sphinx/images/normal-page-footer.pdf deleted file mode 100644 index dfd73cb..0000000 Binary files a/.sphinx/images/normal-page-footer.pdf and /dev/null differ diff --git a/.sphinx/latex_elements_template.txt b/.sphinx/latex_elements_template.txt deleted file mode 100644 index 2b13b51..0000000 --- a/.sphinx/latex_elements_template.txt +++ /dev/null @@ -1,119 +0,0 @@ -{ - 'papersize': 'a4paper', - 'pointsize': '11pt', - 'fncychap': '', - 'preamble': r''' -%\usepackage{charter} -%\usepackage[defaultsans]{lato} -%\usepackage{inconsolata} -\setmainfont[UprightFont = *-R, BoldFont = *-B, ItalicFont=*-RI, Extension = .ttf]{Ubuntu} -\setmonofont[UprightFont = *-R, BoldFont = *-B, ItalicFont=*-RI, Extension = .ttf]{UbuntuMono} -\usepackage[most]{tcolorbox} -\tcbuselibrary{breakable} -\usepackage{lastpage} -\usepackage{tabto} -\usepackage{ifthen} -\usepackage{etoolbox} -\usepackage{fancyhdr} -\usepackage{graphicx} -\usepackage{titlesec} -\usepackage{fontspec} -\usepackage{tikz} -\usepackage{changepage} -\usepackage{array} -\usepackage{tabularx} -\definecolor{yellowgreen}{RGB}{154, 205, 50} -\definecolor{title}{RGB}{76, 17, 48} -\definecolor{subtitle}{RGB}{116, 27, 71} -\definecolor{label}{RGB}{119, 41, 100} -\definecolor{copyright}{RGB}{174, 167, 159} -\makeatletter -\def\tcb@finalize@environment{% - \color{.}% hack for xelatex - \tcb@layer@dec% -} -\makeatother -\newenvironment{sphinxclassprompt}{\color{yellowgreen}\setmonofont[Color = 9ACD32, UprightFont = *-R, Extension = .ttf]{UbuntuMono}}{} -\tcbset{enhanced jigsaw, colback=black, fontupper=\color{white}} -\newtcolorbox{termbox}{use color stack, breakable, colupper=white, halign=flush left} -\newenvironment{sphinxclassterminal}{\setmonofont[Color = white, UprightFont = *-R, Extension = .ttf]{UbuntuMono}\sphinxsetup{VerbatimColor={black}}\begin{termbox}}{\end{termbox}} -\newcommand{\dimtorightedge}{% - \dimexpr\paperwidth-1in-\hoffset-\oddsidemargin\relax} -\newcommand{\dimtotop}{% - \dimexpr\height-1in-\voffset-\topmargin-\headheight-\headsep\relax} -\newtoggle{tpage} -\AtBeginEnvironment{titlepage}{\global\toggletrue{tpage}} -\fancypagestyle{plain}{ - \fancyhf{} - \fancyfoot[R]{\thepage\ of \pageref*{LastPage}} - \renewcommand{\headrulewidth}{0pt} - \renewcommand{\footrulewidth}{0pt} -} -\fancypagestyle{normal}{ - \fancyhf{} - \fancyfoot[R]{\thepage\ of \pageref*{LastPage}} - \renewcommand{\headrulewidth}{0pt} - \renewcommand{\footrulewidth}{0pt} -} -\fancypagestyle{titlepage}{% - \fancyhf{} - \fancyfoot[L]{\footnotesize \textcolor{copyright}{© 2024 Canonical Ltd. All rights reserved.}} -} -\newcommand\sphinxbackoftitlepage{\thispagestyle{titlepage}} -\titleformat{\chapter}[block]{\Huge \color{title} \bfseries\filright}{\thechapter .}{1.5ex}{} -\titlespacing{\chapter}{0pt}{0pt}{0pt} -\titleformat{\section}[block]{\huge \bfseries\filright}{\thesection .}{1.5ex}{} -\titlespacing{\section}{0pt}{0pt}{0pt} -\titleformat{\subsection}[block]{\Large \bfseries\filright}{\thesubsection .}{1.5ex}{} -\titlespacing{\subsection}{0pt}{0pt}{0pt} -\setcounter{tocdepth}{1} -\renewcommand\pagenumbering[1]{} -''', - 'sphinxsetup': 'verbatimwithframe=false, pre_border-radius=0pt, verbatimvisiblespace=\\phantom{}, verbatimcontinued=\\phantom{}', - 'extraclassoptions': 'openany,oneside', - 'maketitle': r''' -\begin{titlepage} -\begin{flushleft} - \begin{tikzpicture}[remember picture,overlay] - \node[anchor=south east, inner sep=0] at (current page.south east) { - \includegraphics[width=\paperwidth, height=\paperheight]{front-page-light} - }; - \end{tikzpicture} -\end{flushleft} - -\vspace*{3cm} - -\begin{adjustwidth}{8cm}{0pt} -\begin{flushleft} - \huge \textcolor{black}{\textbf{}{\raggedright{$PROJECT}}} -\end{flushleft} -\end{adjustwidth} - -\vfill - -\begin{adjustwidth}{8cm}{0pt} -\begin{tabularx}{0.5\textwidth}{ l l } - \textcolor{lightgray}{© 2024 Canonical Ltd.} & \hspace{3cm} \\ - \textcolor{lightgray}{All rights reserved.} & \hspace{3cm} \\ - & \hspace{3cm} \\ - & \hspace{3cm} \\ - -\end{tabularx} -\end{adjustwidth} - -\end{titlepage} -\RemoveFromHook{shipout/background} -\AddToHook{shipout/background}{ - \begin{tikzpicture}[remember picture,overlay] - \node[anchor=south west, align=left, inner sep=0] at (current page.south west) { - \includegraphics[width=\paperwidth]{normal-page-footer} - }; - \end{tikzpicture} - \begin{tikzpicture}[remember picture,overlay] - \node[anchor=north east, opacity=0.5, inner sep=35] at (current page.north east) { - \includegraphics[width=4cm]{Canonical-logo-4x} - }; - \end{tikzpicture} - } -''', -} \ No newline at end of file diff --git a/.sphinx/spellingcheck.yaml b/.sphinx/spellingcheck.yaml deleted file mode 100644 index c0f7e03..0000000 --- a/.sphinx/spellingcheck.yaml +++ /dev/null @@ -1,30 +0,0 @@ -matrix: -- name: rST files - aspell: - lang: en - d: en_US - dictionary: - wordlists: - - .wordlist.txt - - .custom_wordlist.txt - output: .sphinx/.wordlist.dic - sources: - - _build/**/*.html - pipeline: - - pyspelling.filters.html: - comments: false - attributes: - - title - - alt - ignores: - - code - - pre - - spellexception - - link - - title - - div.relatedlinks - - strong.command - - div.visually-hidden - - img - - a.p-navigation__link - - a.contributor diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..aeba442 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,337 @@ +# Contributing to Canonical OpenStack Docs development + +The Canonical OpenStack Docs is the home of the documentation project for the +Canonical OpenStack distribution. Contributions help improve the documentation +for all of its users. The Canonical OpenStack team performs most of the work, +but all contributyors are welcome. + +Common contributions include: + +- Bug fixes: Build errors, broken links, configuration issues +- Improvements: Better defaults, new extensions, workflow enhancements, new or improved + style rules +- Dependency updates: Security patches, compatibility fixes, better tooling + +If you run into any problems or see room for improvement, we encourage you to open an +issue or even contribute a fix. + +> This guide only covers contributions to the Canonical OpenStack documentation. +> If you're interested in contributing to the Canonical OpenStack project, refer to the +> [source code repository's guide](https://github.com/canonical/snap-openstack/blob/main/docs/CONTRIBUTING.md). + +## Review the project expectations + +Review these three documents before contributing: + +### Ubuntu Code of Conduct + +When contributing, you must abide by the [Ubuntu Code of +Conduct](https://ubuntu.com/community/ethos/code-of-conduct). Projects governed by +Canonical expect good conduct and excellence from every member. + +### Canonical Contributor License Agreement + +Code contributions can only be accepted from contributors who have signed our +[Contributor License Agreement (CLA)](https://ubuntu.com/legal/contributors). Signing +the agreement grants Canonical permission to use your contributions, and you remain the +copyright owner of your work (no copyright assignment occurs). + +Review the terms of the agreement before signing it or committing anything. If you agree +and choose to sign it, your work can be incorporated into the repository. + +### Open source license + +The Canonical OpenStack documentation is licensed under [GPL-3.0](LICENSE). + +## Report an issue or open a request + +If you find a bug or feature gap in the Canonical OpenStack distribution or documentation, +look for it in the [documentation project's GitHub issues](https://github.com/canonical/canonical-openstack-docs/issues) +or the [project's Launchpad bugs](https://bugs.launchpad.net/snap-openstack) first. +Add your voice to the thread if you have fresh input. + +If the bug or feature doesn't have an issue, [open +one against the documentation](https://github.com/canonical/canonical-openstack-docs/issues/new/choose) +or the [project itself ](https://bugs.launchpad.net/snap-openstack/+filebug). + +## Development setup + +Create a [personal fork](https://github.com/canonical/canonical-openstack-docs/fork) of +the repository, then clone it and add the upstream remote: + +With +[SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account): + +```bash +git clone git@github.com:/canonical-openstack-docs +cd canonical-openstack-docs +git remote add upstream git@github.com:canonical/canonical-openstack-docs +git fetch upstream +``` + +With +[HTTPS](https://docs.github.com/en/get-started/git-basics/about-remote-repositories#cloning-with-https-urls): + +```bash +git clone https://github.com//canonical-openstack-docs +cd canonical-openstack-docs +git remote add upstream https://github.com/canonical/canonical-openstack-docs +git fetch upstream +``` + +Install dependencies and verify the build: + +```bash +cd docs +make install +make html +``` + +## Contribute a change + +### Research the topic + +All significant work should be tied to an existing issue. Before starting, comment on +the issue to have it assigned to you. + +#### Minor changes + +Check [GitHub issues](https://github.com/canonical/sphinx-stack/issues) for +existing reports. If none exist, [open +one](https://github.com/canonical/sphinx-stack/issues/new/choose) and state +your interest in working on it. + +#### Major changes + +Describe your proposal in the issue thread, including the plan, tests, and +documentation. For new documentation pages, propose a [Diátaxis](https://diataxis.fr) +category. + +### Create a development branch + +Sync and create a new branch: + +```bash +git fetch upstream +git checkout -b +``` + +Name your branch `-` (e.g., `issue-235-add-string-sanitizer`), +keeping it under 80 characters. + +### Make your changes + +Follow these guidelines: + +- Use separate commits for each logical change, and for changes to different components + +### Commit a change + +```bash +git add -A +git commit +``` + +Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format: + +``` +feat: add text sanitizer +``` + +To determine the commit type, check the file history with `git log --oneline `. + +> **Tip** +> +> If you're unsure which type to use, the commit may be doing too much, so split it into +> smaller commits instead. Select the highest-ranked type that fits: +> +> - `ci` +> - `build` +> - `feat` +> - `fix` +> - `perf` +> - `refactor` +> - `style` +> - `test` +> - `docs` +> - `chore` + +### Sign your commits + +All commits require cryptographic signatures ([DCO +1.1](https://developercertificate.org/)). You can sign commits by adding `-S` to the +`git commit` command from the previous section, for example: + +```bash +git commit -S -m "feat: add logging levels to updage script" +``` + +Signed commits display a "Verified" badge in GitHub. Set up signing via [GitHub Docs - +About commit signature +verification](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification). + +> **Tip** +> +> You can configure your Git client to sign commits by default for any local repository +> by running `git config --global commit.gpgsign true`. Once you have done this, you no +> longer need to add `-S` to your commits explicitly. +> +> See [GitHub Docs - Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) for more information. + +If you've made an unsigned commit and encounter the "Commits must have verified +signatures" error when pushing your changes to the remote: + +1. Amend the most recent commit by signing it without changing the commit message, and + push again: + + ```bash + git commit --amend --no-edit -n -S + git push + ``` + +2. If you still encounter the same error, confirm that your GitHub account has been set + up properly to sign commits as described in the [GitHub Docs - About commit signature + verification](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification). + + > **Tip** + > + > If you use SSH keys to sign your commits, make sure to add a "Signing Key" type in + > your GitHub account. See [GitHub Docs - Adding a new SSH key to your + > account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account) + > for more information. + +### Test the change + +Build and run the checks locally before submitting: + +```bash +cd docs +make html +``` + +```bash +make spelling # Check spelling +make linkcheck # Validate links +make woke # Check inclusive language +make lint-md # Check Markdown style +make vale # Check style guide compliance (optional) +``` + +To preview locally with live reload at `http://127.0.0.1:8000`, run: + +```bash +make run +``` + +### Document the change + +This documentation is sourced from +[canonical/canonical-openstack-docs](https://github.com/canonical/canonical-openstack-docs) and uses +[Diátaxis](https://diataxis.fr). For small changes, update existing how-to guides and +references. For major changes or new flows, create new pages +in the appropriate category. + +Run the same basic checks locally that GitHub runs on PRs; see [Test the +change](#test-the-change). + +#### Changelog guidance + +Ensure that feature changes and fixes are documented in the relevant release notes. + +### Push the branch and open a PR + +```bash +git push -u origin +``` + +Next, open a PR on GitHub. Format its title as a conventional commit (GitHub may do this +automatically for single-commit branches). + +### Describing PRs + +Your PR should include the following details: + +- Title: Short, descriptive summary +- Description: Problem solved, features added, or bugs fixed +- Relevant issues: [Link related issues and PRs](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls) +- Testing: How reviewers can verify the change or test the fix +- Reversibility: For costly-to-reverse decisions, explain reasoning and reversal steps + +## CI/CD pipeline + +The repository configures multiple automated checks. Some are conditional based on +target branch or changed files. + +If a check fails, review the logs for remediation guidance. For failures unrelated to +your changes, rebase against the latest base branch. + +### Checks on all PRs + +These run on every PR and on pushes to `main`: + +- Documentation build: Builds the documentation and checks for errors +- Spelling check: Verifies spelling using Vale +- Link check: Validates all links in the documentation +- Inclusive language check: Runs woke to check for non-inclusive language +- Python dependency build: Verifies dependencies can be built from source + +### Checks on PRs to `main` only + +- CLA check: Verifies you have signed the Canonical Contributor License Agreement +- Removed URLs check: Detects if any URLs were removed without redirects + +#### CLA check in CI + +When you open a pull request (PR) against the `main` branch, a mandatory automated check +verifies that you have signed the CLA. It uses the +[canonical/has-signed-canonical-cla](https://github.com/canonical/has-signed-canonical-cla) +GitHub Action. + +If you haven't signed the CLA: +1. The check will fail with a message indicating the CLA requirement +2. Visit to review and sign the agreement +3. Once signed, re-run the check if you have permissions, or ask a maintainer to do so. + Pushing a new commit also triggers re-evaluation. + +The CLA check only runs on PRs to `main`. Internal team members working on other +branches should ensure they have signed the CLA before their changes are merged to +`main`. + +### Checks on changes to `docs/` only + +- Markdown style check: Runs `pymarkdownlnt` on Markdown files +- Automatic documentation checks: Runs upstream documentation workflow checks.The + project uses + [canonical/documentation-workflows](https://github.com/canonical/documentation-workflows) + for automatic documentation checks. To modify this part of CI behavior, pass inputs to + upstream workflows rather than creating or customizing local copies. + +### Optional checks (allowed to fail) + +- Style guide check (`vale`): Checks compliance with the Canonical style guide +- Accessibility check (`pa11y`): Checks accessibility of generated HTML + +## Review process + +PRs are typically reviewed within a week. + +### Responding to feedback + +Push additional commits to address feedback (commit locally rather than via GitHub UI to +avoid sync conflicts). + +Rebase your branch before requesting a review to keep your commits clean. Once review +has started, avoid rebasing to maintain the review history and make it easier for +reviewers to see what changed. + +### Common feedback themes + +Reviewers may request: + +- Wording, terminology, or formatting changes +- Consistency with existing patterns +- Proper reST or MyST markup style +- Minimal examples before listing options +- Cross-references: Use proper reST or MyST syntax +- Examples: Start minimal, then show options; include verification steps +- Theme compatibility: Test in both light and dark modes diff --git a/Makefile b/Makefile deleted file mode 100644 index a861ba8..0000000 --- a/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# This Makefile stub allows you to customize starter pack (SP) targets. -# Consider this file as a bridge between your project -# and the starter pack's predefined targets that reside in Makefile.sp. -# -# You can add your own, non-SP targets here or override SP targets -# to fit your project's needs. For example, you can define and use targets -# named "install" or "run", but continue to use SP targets like "sp-install" -# or "sp-run" when working on the documentation. - -# Put it first so that "make" without argument is like "make help". -help: - @echo "\n" \ - "------------------------------------------------------------- \n" \ - "* watch, build and serve the documentation: make run \n" \ - "* only build: make html \n" \ - "* only serve: make serve \n" \ - "* clean built doc files: make clean-doc \n" \ - "* clean full environment: make clean \n" \ - "* check links: make linkcheck \n" \ - "* check spelling: make spelling \n" \ - "* check spelling (without building again): make spellcheck \n" \ - "* check inclusive language: make woke \n" \ - "* check accessibility: make pa11y \n" \ - "* check style guide compliance: make vale \n" \ - "* check style guide compliance on target: make vale TARGET=* \n" \ - "* other possible targets: make \n" \ - "------------------------------------------------------------- \n" - -%: - $(MAKE) -f Makefile.sp sp-$@ diff --git a/Makefile.sp b/Makefile.sp deleted file mode 100644 index 0265d6b..0000000 --- a/Makefile.sp +++ /dev/null @@ -1,144 +0,0 @@ -# Minimal makefile for Sphinx documentation -# -# `Makefile.sp` is from the Sphinx starter pack and should not be -# modified. -# Add your customisation to `Makefile` instead. - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXDIR = .sphinx -SPHINXOPTS ?= -c . -d $(SPHINXDIR)/.doctrees -j auto -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build -VENVDIR = $(SPHINXDIR)/venv -PA11Y = $(SPHINXDIR)/node_modules/pa11y/bin/pa11y.js --config $(SPHINXDIR)/pa11y.json -VENV = $(VENVDIR)/bin/activate -TARGET = * -ALLFILES = *.rst **/*.rst -ADDPREREQS ?= -REQPDFPACKS = latexmk fonts-freefont-otf texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-font-utils texlive-lang-cjk texlive-xetex plantuml xindy tex-gyre dvipng - -.PHONY: sp-full-help sp-woke-install sp-pa11y-install sp-install sp-run sp-html \ - sp-epub sp-serve sp-clean sp-clean-doc sp-spelling sp-spellcheck sp-linkcheck sp-woke \ - sp-pa11y sp-pdf-prep-force sp-pdf-prep sp-pdf Makefile.sp sp-vale - -sp-full-help: $(VENVDIR) - @. $(VENV); $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - @echo "\n\033[1;31mNOTE: This help texts shows unsupported targets!\033[0m" - @echo "Run 'make help' to see supported targets." - -# Shouldn't assume that venv is available on Ubuntu by default; discussion here: -# https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1290847 -$(SPHINXDIR)/requirements.txt: - @python3 -c "import venv" || \ - (echo "You must install python3-venv before you can build the documentation."; exit 1) - python3 -m venv $(VENVDIR) - @if [ ! -z "$(ADDPREREQS)" ]; then \ - . $(VENV); pip install \ - $(PIPOPTS) --require-virtualenv $(ADDPREREQS); \ - fi - . $(VENV); python3 $(SPHINXDIR)/build_requirements.py - -# If requirements are updated, venv should be rebuilt and timestamped. -$(VENVDIR): $(SPHINXDIR)/requirements.txt - @echo "... setting up virtualenv" - python3 -m venv $(VENVDIR) - . $(VENV); pip install $(PIPOPTS) --require-virtualenv \ - --upgrade -r $(SPHINXDIR)/requirements.txt \ - --log $(VENVDIR)/pip_install.log - @test ! -f $(VENVDIR)/pip_list.txt || \ - mv $(VENVDIR)/pip_list.txt $(VENVDIR)/pip_list.txt.bak - @. $(VENV); pip list --local --format=freeze > $(VENVDIR)/pip_list.txt - @touch $(VENVDIR) - -sp-woke-install: - @type woke >/dev/null 2>&1 || \ - { echo "Installing \"woke\" snap... \n"; sudo snap install woke; } - -sp-pa11y-install: - @type $(PA11Y) >/dev/null 2>&1 || { \ - echo "Installing \"pa11y\" from npm... \n"; \ - mkdir -p $(SPHINXDIR)/node_modules/ ; \ - npm install --prefix $(SPHINXDIR) pa11y; \ - } - -sp-install: $(VENVDIR) - -sp-run: sp-install - . $(VENV); sphinx-autobuild -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) - -# Doesn't depend on $(BUILDDIR) to rebuild properly at every run. -sp-html: sp-install - . $(VENV); $(SPHINXBUILD) -W --keep-going -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) - -sp-epub: sp-install - . $(VENV); $(SPHINXBUILD) -b epub "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) - -sp-serve: sp-html - cd "$(BUILDDIR)"; python3 -m http.server --bind 127.0.0.1 8000 - -sp-clean: sp-clean-doc - @test ! -e "$(VENVDIR)" -o -d "$(VENVDIR)" -a "$(abspath $(VENVDIR))" != "$(VENVDIR)" - rm -rf $(VENVDIR) - rm -f $(SPHINXDIR)/requirements.txt - rm -rf $(SPHINXDIR)/node_modules/ - rm -rf $(SPHINXDIR)/styles - rm -rf $(SPHINXDIR)/vale.ini - -sp-clean-doc: - git clean -fx "$(BUILDDIR)" - rm -rf $(SPHINXDIR)/.doctrees - -sp-spellcheck: - . $(VENV) ; python3 -m pyspelling -c $(SPHINXDIR)/spellingcheck.yaml -j $(shell nproc) - -sp-spelling: sp-html sp-spellcheck - -sp-linkcheck: sp-install - . $(VENV) ; $(SPHINXBUILD) -b linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) || { grep --color -F "[broken]" "$(BUILDDIR)/output.txt"; exit 1; } - exit 0 - -sp-woke: sp-woke-install - woke $(ALLFILES) --exit-1-on-failure \ - -c https://github.com/canonical/Inclusive-naming/raw/main/config.yml - -sp-pa11y: sp-pa11y-install sp-html - find $(BUILDDIR) -name *.html -print0 | xargs -n 1 -0 $(PA11Y) - -sp-vale: sp-install - @. $(VENV); test -d $(SPHINXDIR)/venv/lib/python*/site-packages/vale || pip install vale - @. $(VENV); test -f $(SPHINXDIR)/vale.ini || python3 $(SPHINXDIR)/get_vale_conf.py - @. $(VENV); find $(SPHINXDIR)/venv/lib/python*/site-packages/vale/vale_bin -size 195c -exec vale --config "$(SPHINXDIR)/vale.ini" $(TARGET) > /dev/null \; - @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt - @cat $(SOURCEDIR)/.wordlist.txt $(SOURCEDIR)/.custom_wordlist.txt >> $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt - @echo "" - @echo "Running Vale against $(TARGET). To change target set TARGET= with make command" - @echo "" - @. $(VENV); vale --config "$(SPHINXDIR)/vale.ini" --glob='*.{md,txt,rst}' $(TARGET) || true - @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt && rm $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt - -sp-pdf-prep: sp-install - @for packageName in $(REQPDFPACKS); do (dpkg-query -W -f='$${Status}' $$packageName 2>/dev/null | \ - grep -c "ok installed" >/dev/null && echo "Package $$packageName is installed") && continue || \ - (echo "\nPDF generation requires the installation of the following packages: $(REQPDFPACKS)" && \ - echo "" && echo "Run sudo make pdf-prep-force to install these packages" && echo "" && echo \ - "Please be aware these packages will be installed to your system") && exit 1 ; done - -sp-pdf-prep-force: - apt-get update - apt-get upgrade -y - apt-get install --no-install-recommends -y $(REQPDFPACKS) \ - -sp-pdf: sp-pdf-prep - @. $(VENV); sphinx-build -M latexpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) - @rm ./$(BUILDDIR)/latex/front-page-light.pdf || true - @rm ./$(BUILDDIR)/latex/normal-page-footer.pdf || true - @find ./$(BUILDDIR)/latex -name "*.pdf" -exec mv -t ./$(BUILDDIR) {} + - @rm -r $(BUILDDIR)/latex - @echo "\nOutput can be found in ./$(BUILDDIR)\n" - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile.sp - . $(VENV); $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/README.md b/README.md new file mode 100644 index 0000000..0655bbf --- /dev/null +++ b/README.md @@ -0,0 +1,89 @@ +# Canonical OpenStack Documentation + +[![Automatic doc checks](https://github.com/canonical/canonical-openstack-docs/actions/workflows/automatic-doc-checks.yml/badge.svg)](https://github.com/canonical/canonical-openstack-docs/actions/workflows/automatic-doc-checks.yml) + +This repository contains the source for the [Canonical OpenStack documentation](https://canonical-openstack.readthedocs.io/). + +Canonical OpenStack is an enterprise-grade cloud platform that delivers distilled upstream OpenStack excellence in a human-friendly product. It provides elastic, on-demand compute, network, and storage resources through a self-service portal or upstream OpenStack APIs. + +## Documentation Structure + +The documentation follows the [Diátaxis](https://diataxis.fr) framework: + +- **Tutorials** – Hands-on introduction for new users +- **How-to guides** – Step-by-step guides for key operations and common tasks +- **Reference** – Technical specifications, APIs, architecture +- **Explanation** – Discussion and clarification of key topics + +## Quickstart + +### Prerequisites + +- Python 3.10+ +- `make` +- `git` + +### Build Locally + +```bash +git clone git@github.com:canonical/canonical-openstack-docs.git +cd canonical-openstack-docs/docs +make install +make html +``` + +To preview with live reload at `http://127.0.0.1:8000`: + +```bash +make run +``` + +### Run Checks Locally + +```bash +make spelling # Check spelling +make linkcheck # Validate links +make woke # Check inclusive language +make lint-md # Check Markdown style +make vale # Check style guide compliance (optional) +``` + +## Contributing + +We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on: + +- Reporting issues +- Development setup +- Making changes +- Running tests +- Opening pull requests +- Code review process + +### Quick Contribution Steps + +1. Fork the repository +2. Create a branch: `git checkout -b -` +3. Make your changes in the `docs/` directory +4. Build and test locally: `cd docs && make html && make spelling && make linkcheck` +5. Commit with a signed commit: `git commit -S -m "feat: your change"` +6. Push and open a PR + +All contributions require a signed [Canonical Contributor License Agreement](https://ubuntu.com/legal/contributors). + +## Community and Support + +### Community (Sunbeam / Open Source) + +- [Report a bug](https://bugs.launchpad.net/snap-openstack/+filebug) +- [Join the community chat](https://matrix.to/#/#openstack-sunbeam:ubuntu.com) +- [Contribute to Sunbeam](https://github.com/canonical/snap-openstack) + +### Commercial (Canonical OpenStack) + +- [Explore Canonical OpenStack](https://canonical.com/openstack) +- [Get Ubuntu Pro subscription](https://ubuntu.com/pro/subscribe) +- [Contact Canonical cloud experts](https://canonical.com/openstack#get-in-touch) + +## License + +This documentation is licensed under [GPL-3.0](LICENSE). \ No newline at end of file diff --git a/conf.py b/conf.py deleted file mode 100644 index 56cdcf9..0000000 --- a/conf.py +++ /dev/null @@ -1,241 +0,0 @@ -import sys -import os -import requests -from urllib.parse import urlparse -from git import Repo, InvalidGitRepositoryError -import time -import ast - -sys.path.append('./') -from custom_conf import * -sys.path.append('.sphinx/') -from build_requirements import * - -# Configuration file for the Sphinx documentation builder. -# You should not do any modifications to this file. Put your custom -# configuration into the custom_conf.py file. -# If you need to change this file, contribute the changes upstream. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -############################################################ -### Extensions -############################################################ - -extensions = [ - 'sphinx_design', - 'sphinx_copybutton', - 'sphinxcontrib.jquery', - "sphinx_tabs.tabs", - 'canonical.related-links', - 'canonical.terminal-output', -] - -# Only add redirects extension if any redirects are specified. -if AreRedirectsDefined(): - extensions.append('sphinx_reredirects') - -# Only add myst extensions if any configuration is present. -if IsMyStParserUsed(): - extensions.append('myst_parser') - - # Additional MyST syntax - myst_enable_extensions = [ - 'substitution', - 'deflist', - 'linkify' - ] - myst_enable_extensions.extend(custom_myst_extensions) - -# Only add Open Graph extension if any configuration is present. -if IsOpenGraphConfigured(): - extensions.append('sphinxext.opengraph') - -extensions.extend(custom_extensions) -extensions = DeduplicateExtensions(extensions) - -### Configuration for extensions - -# Used for related links -if not 'discourse_prefix' in html_context and 'discourse' in html_context: - html_context['discourse_prefix'] = html_context['discourse'] + '/t/' - -# The URL prefix for the notfound extension depends on whether the documentation uses versions. -# For documentation on documentation.ubuntu.com, we also must add the slug. -url_version = '' -url_lang = '' - -# Determine if the URL uses versions and language -if 'READTHEDOCS_CANONICAL_URL' in os.environ and os.environ['READTHEDOCS_CANONICAL_URL']: - url_parts = os.environ['READTHEDOCS_CANONICAL_URL'].split('/') - - if len(url_parts) >= 2 and 'READTHEDOCS_VERSION' in os.environ and os.environ['READTHEDOCS_VERSION'] == url_parts[-2]: - url_version = url_parts[-2] + '/' - - if len(url_parts) >= 3 and 'READTHEDOCS_LANGUAGE' in os.environ and os.environ['READTHEDOCS_LANGUAGE'] == url_parts[-3]: - url_lang = url_parts[-3] + '/' - -# Set notfound_urls_prefix to the slug (if defined) and the version/language affix -if slug: - notfound_urls_prefix = '/' + slug + '/' + url_lang + url_version -elif len(url_lang + url_version) > 0: - notfound_urls_prefix = '/' + url_lang + url_version -else: - notfound_urls_prefix = '' - -notfound_context = { - 'title': 'Page not found', - 'body': '

Sorry, but the documentation page that you are looking for was not found.

\n\n

Documentation 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).

\n

You 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 - -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 - - try: - repo = Repo(".") - except InvalidGitRepositoryError: - cwd = os.getcwd() - ghfolder = html_context['github_folder'][:-1] - if ghfolder and cwd.endswith(ghfolder): - repo = Repo(cwd.rpartition(ghfolder)[0]) - else: - print("The local Git repository could not be found.") - return - - 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 - -############################################################ -### PDF configuration -############################################################ - -latex_additional_files = [ - "./.sphinx/fonts/Ubuntu-B.ttf", - "./.sphinx/fonts/Ubuntu-R.ttf", - "./.sphinx/fonts/Ubuntu-RI.ttf", - "./.sphinx/fonts/UbuntuMono-R.ttf", - "./.sphinx/fonts/UbuntuMono-RI.ttf", - "./.sphinx/fonts/UbuntuMono-B.ttf", - "./.sphinx/images/Canonical-logo-4x.png", - "./.sphinx/images/front-page-light.pdf", - "./.sphinx/images/normal-page-footer.pdf", -] - -latex_engine = 'xelatex' -latex_show_pagerefs = True -latex_show_urls = 'footnote' - -with open(".sphinx/latex_elements_template.txt", "rt") as file: - latex_config = file.read() - -latex_elements = ast.literal_eval(latex_config.replace("$PROJECT", project)) \ No newline at end of file diff --git a/custom_conf.py b/custom_conf.py deleted file mode 100644 index c786757..0000000 --- a/custom_conf.py +++ /dev/null @@ -1,248 +0,0 @@ -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 = 'Canonical OpenStack' -author = 'Canonical 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 CC-BY-SA as the license and the current year -# as the copyright year. -# -# If your documentation needs a different copyright license, use that -# instead of 'CC-BY-SA'. Also, if your documentation is included as -# part of the code repository of your project, it'll inherit the license -# of the code. So you'll need to specify that license here (instead of -# 'CC-BY-SA'). -# -# 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 ' \ -# -H 'Accept: application/vnd.github.v3.raw' \ -# https://api.github.com/repos/canonical/ | jq '.created_at' - -copyright = '%s CC-BY-SA, %s' % (datetime.date.today().year, author) - -## Open Graph configuration - defines what is displayed as a link preview -## when linking to the documentation from another website (see https://ogp.me/) -# The URL where the documentation will be hosted (leave empty if you -# don't know yet) -# NOTE: If no ogp_* variable is defined (e.g. if you remove this section) the -# sphinxext.opengraph extension will be disabled. -ogp_site_url = 'https://canonical-openstack.readthedocs-hosted.com/' -# The documentation website name (usually the same as the product name) -ogp_site_name = project -# The URL of an image or logo that is used in the preview -ogp_image = 'https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg' - -# Update with the local path to the favicon for your product -# (default is the circle of friends) -html_favicon = '.sphinx/_static/favicon.png' - -# (Some settings must be part of the html_context dictionary, while others -# are on root level. Don't move the settings.) -html_context = { - - # Change to the link to the website of your product (without "https://") - # For example: "ubuntu.com/lxd" or "microcloud.is" - # If there is no product website, edit the header template to remove the - # link (see the readme for instructions). - 'product_page': 'canonical.com/openstack', - - # Add your product tag (the orange part of your logo, will be used in the - # header) to ".sphinx/_static" and change the path here (start with "_static") - # (default is the circle of friends) - 'product_tag': '_static/tag.png', - - # Change to the discourse instance you want to be able to link to - # using the :discourse: metadata at the top of a file - # (use an empty value if you don't want to link) - 'discourse': 'https://discourse.ubuntu.com', - - # Change to the Mattermost channel you want to link to - # (use an empty value if you don't want to link) - 'mattermost': '', - - # Change to the Matrix channel you want to link to - # (use an empty value if you don't want to link) - 'matrix': 'https://matrix.to/#/#openstack-sunbeam:ubuntu.comm', - - # Change to the GitHub URL for your project - # This is used, for example, to link to the source files and allow creating GitHub issues directly from the documentation. - 'github_url': 'https://github.com/canonical/canonical-openstack-docs', - - # Change to the branch for this version of the documentation - 'github_version': 'main', - - # Change to the folder that contains the documentation - # (usually "/" or "/docs/") - 'github_folder': '/', - - # Change to an empty value if your GitHub repo doesn't have issues enabled. - # This will disable the feedback button and the issue link in the footer. - 'github_issues': 'enabled', - - # Controls the existence of Previous / Next buttons at the bottom of pages - # Valid options: none, prev, next, both - 'sequential_nav': "none", - - # Controls if to display the contributors of a file or not - "display_contributors": True, - - # Controls time frame for showing the contributors - "display_contributors_since": "" -} - -# If your project is on documentation.ubuntu.com, specify the project -# slug (for example, "lxd") here. -slug = "" - -############################################################ -### Redirects -############################################################ - -# Set up redirects (https://documatt.gitlab.io/sphinx-reredirects/usage.html) -# For example: 'explanation/old-name.html': '../how-to/prettify.html', -# You can also configure redirects in the Read the Docs project dashboard -# (see https://docs.readthedocs.io/en/stable/guides/redirects.html). -# NOTE: If this variable is not defined, set to None, or the dictionary is empty, -# the sphinx_reredirects extension will be disabled. -redirects = {} - -############################################################ -### Link checker exceptions -############################################################ - -# Links to ignore when checking links -linkcheck_ignore = [ - 'http://127.0.0.1:8000', - 'http://10.121.193.112:3128', - # TODO(wolsen) remove when this site is active - 'https://canonical.com/openstack', - 'https://matrix.to/#/#openstack-sunbeam:ubuntu.com', - # Extremely slow to load, times out even after 30s - 'https://bugs.launchpad.net/sunbeam-charms', -] - -linkcheck_retries = 10 -linkcheck_timeout = 30 - -# Pages on which to ignore anchors -# (This list will be appended to linkcheck_anchors_ignore_for_url) -custom_linkcheck_anchors_ignore_for_url = [ - '^https://ubuntu.com/server/docs/.*$', - '^https://juju.is/docs/juju/.*$', -] - -############################################################ -### Additions to default configuration -############################################################ - -## The following settings are appended to the default configuration. -## Use them to extend the default functionality. - -# Remove this variable to disable the MyST parser extensions. -custom_myst_extensions = [] - -# Add custom Sphinx extensions as needed. -# This array contains recommended extensions that should be used. -# NOTE: The following extensions are handled automatically and do -# not need to be added here: myst_parser, sphinx_copybutton, sphinx_design, -# sphinx_reredirects, sphinxcontrib.jquery, sphinxext.opengraph -custom_extensions = [ - 'sphinx_tabs.tabs', - 'sphinx.ext.todo', - 'canonical.youtube-links', - 'canonical.related-links', - 'canonical.custom-rst-roles', - 'canonical.terminal-output', - 'notfound.extension', - 'sphinxcontrib.cairosvgconverter', - ] - -# Add custom required Python modules that must be added to the -# .sphinx/requirements.txt file. -# NOTE: The following modules are handled automatically and do not need to be -# added here: canonical-sphinx-extensions, furo, linkify-it-py, myst-parser, -# pyspelling, sphinx, sphinx-autobuild, sphinx-copybutton, sphinx-design, -# sphinx-notfound-page, sphinx-reredirects, sphinx-tabs, sphinxcontrib-jquery, -# sphinxext-opengraph -custom_required_modules = [ - 'sphinxcontrib-svg2pdfconverter[CairoSVG]', - 'sphinxcontrib-spelling', -] - -# Add files or directories that should be excluded from processing. -custom_excludes = [ - 'doc-cheat-sheet*', - '/reuse/**', - '**/_include/*' - ] - -# Add CSS files (located in .sphinx/_static/) -custom_html_css_files = [] - -# Add JavaScript files (located in .sphinx/_static/) -custom_html_js_files = [] - -## The following settings override the default configuration. - -# Specify a reST string that is included at the end of each file. -# If commented out, use the default (which pulls the reuse/links.txt -# file into each reST file). -custom_rst_epilog = """ -.. include:: /reuse/links.txt -""" - -# By default, the documentation includes a feedback button at the top. -# You can disable it by setting the following configuration to True. -disable_feedback_button = False - -# Add tags that you want to use for conditional inclusion of text -# (https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#tags) -custom_tags = [] - -# If you are using the :manpage: role, set this variable to the URL for the version -# that you want to link to: -# manpages_url = "https://manpages.ubuntu.com/manpages/noble/en/man{section}/{page}.{section}.html" - -############################################################ -### Additional configuration -############################################################ - -## Add any configuration that is not covered by the common conf.py file. - -# Define a :center: role that can be used to center the content of table cells. -rst_prolog = ''' -.. role:: center - :class: align-center -.. role:: h2 - :class: hclass2 -''' diff --git a/doc-cheat-sheet-myst.md b/doc-cheat-sheet-myst.md deleted file mode 100644 index 6257c9d..0000000 --- a/doc-cheat-sheet-myst.md +++ /dev/null @@ -1,261 +0,0 @@ ---- -orphan: true -myst: - substitutions: - reuse_key: "This is **included** text." - advanced_reuse_key: "This is a substitution that includes a code block: - ``` - code block - ```" ---- - - - -(cheat-sheet-myst)= -# Markdown/MyST cheat sheet - - - -This file contains the syntax for commonly used Markdown and MyST markup. -Open it in your text editor to quickly copy and paste the markup you need. - -See the [MyST style guide](https://canonical-documentation-with-sphinx-and-readthedocscom.readthedocs-hosted.com/style-guide-myst/) for detailed information and conventions. - -Also see the [MyST documentation](https://myst-parser.readthedocs.io/en/latest/index.html) for detailed information on MyST, and the [Canonical Documentation Style Guide](https://docs.ubuntu.com/styleguide/en) for general style conventions. - -## H2 heading - -### H3 heading - -#### H4 heading - -##### H5 heading - -## Inline formatting - -- {guilabel}`UI element` -- `code` -- {command}`command` -- {kbd}`Key` -- *Italic* -- **Bold** - -## Code blocks - -Start a code block: - - code: - - example: true - -``` -# Demonstrate a code block -code: - - example: true -``` - -```yaml -# Demonstrate a code block -code: - - example: true -``` - -(a_section_target_myst)= -## Links - -- [Canonical website](https://canonical.com/) -- {ref}`a_section_target_myst` -- {ref}`Link text ` -- {doc}`index` -- {doc}`Link text ` - -## Navigation - -Use the following syntax:: - - ```{toctree} - :hidden: - - sub-page1 - sub-page2 - ``` - -## Lists - -1. Step 1 - - Item 1 - * Sub-item - - Item 2 - 1. Sub-step 1 - 1. Sub-step 2 -1. Step 2 - 1. Sub-step 1 - - Item - 1. Sub-step 2 - -Term 1 -: Definition - -Term 2 -: Definition - -## Tables - -## Markdown tables - -| Header 1 | Header 2 | -|------------------------------------|----------| -| Cell 1
Second paragraph | Cell 2 | -| Cell 3 | Cell 4 | - -Centred: - -| Header 1 | Header 2 | -|:----------------------------------:|:--------:| -| Cell 1
Second paragraph | Cell 2 | -| Cell 3 | Cell 4 | - -## List tables - -```{list-table} - :header-rows: 1 - -* - Header 1 - - Header 2 -* - Cell 1 - - Second paragraph - - Cell 2 -* - Cell 3 - - Cell 4 -``` - -Centred: - -```{list-table} - :header-rows: 1 - :align: center - -* - Header 1 - - Header 2 -* - Cell 1 - - Second paragraph - - Cell 2 -* - Cell 3 - - Cell 4 -``` - -## Notes - -```{note} -A note. -``` - -```{tip} -A tip. -``` - -```{important} -Important information -``` - -```{caution} -This might damage your hardware! -``` - -## Images - -![Alt text](https://assets.ubuntu.com/v1/b3b72cb2-canonical-logo-166.png) - -```{figure} https://assets.ubuntu.com/v1/b3b72cb2-canonical-logo-166.png - :width: 100px - :alt: Alt text - - Figure caption -``` - -## Reuse - -### Keys - -Keys can be defined at the top of a file, or in a `myst_substitutions` option in `conf.py`. - -{{reuse_key}} - -{{advanced_reuse_key}} - -### File inclusion - -```{include} index.md - :start-after: include_start - :end-before: include_end -``` - -## Tabs - -````{tabs} -```{group-tab} Tab 1 - -Content Tab 1 -``` - -```{group-tab} Tab 2 -Content Tab 2 -``` -```` - -## Glossary - -```{glossary} - -some term - Definition of the example term. -``` - -{term}`some term` - -## More useful markup - -- ```{versionadded} X.Y -- {abbr}`API (Application Programming Interface)` - ----- - -## Custom extensions - -Related links at the top of the page (surrounded by `---`): - - relatedlinks: https://github.com/canonical/lxd-sphinx-extensions, [RTFM](https://www.google.com) - discourse: 12345 - -Terms that should not be checked by the spelling checker: {spellexception}`PurposelyWrong` - -A single-line terminal view that separates input from output: - -```{terminal} - :input: command - :user: root - :host: vampyr - :dir: /home/user/directory/ - -the output -``` - -A multi-line version of the same: - -```{terminal} - :user: root - :host: vampyr - :dir: /home/user/directory/ - -:input: command 1 -output 1 -:input: command 2 -output 2 -``` - -A link to a YouTube video: - -```{youtube} https://www.youtube.com/watch?v=iMLiK1fX4I0 - :title: Demo -``` diff --git a/doc-cheat-sheet.rst b/doc-cheat-sheet.rst deleted file mode 100644 index 7481bd3..0000000 --- a/doc-cheat-sheet.rst +++ /dev/null @@ -1,317 +0,0 @@ -:orphan: - -.. vale off - -.. _cheat-sheet: - -ReStructuredText cheat sheet -============================ - -.. vale on - -This file contains the syntax for commonly used reST markup. -Open it in your text editor to quickly copy and paste the markup you need. - -See the `reStructuredText style guide `_ for detailed information and conventions. - -Also see the `Sphinx reStructuredText Primer `_ for more details on reST, and the `Canonical Documentation Style Guide `_ for general style conventions. - -H2 heading ----------- - -.. rubric:: :h2:`H2 heading without TOC entry` - -H3 heading -~~~~~~~~~~ - -H4 heading -^^^^^^^^^^ - -H5 heading -.......... - -Inline formatting ------------------ - -- :guilabel:`UI element` -- ``code`` -- :file:`file path` -- :command:`command` -- :kbd:`Key` -- *Italic* -- **Bold** - -Code blocks ------------ - -Start a code block:: - - code: - - example: true - -.. code:: - - # Demonstrate a code block - code: - - example: true - -.. code:: yaml - - # Demonstrate a code block - code: - - example: true - -.. _a_section_target: - -Links ------ - -- `Canonical website `_ -- `Canonical website`_ (defined in ``reuse/links.txt`` or at the bottom of the page) -- https:\ //canonical.com/ -- :ref:`a_section_target` -- :ref:`Link text ` -- :doc:`index` -- :doc:`Link text ` - - -Navigation ----------- - -Use the following syntax:: - - .. toctree:: - :hidden: - - sub-page1 - sub-page2 - - -Lists ------ - -1. Step 1 - - - Item 1 - - * Sub-item - - Item 2 - - i. Sub-step 1 - #. Sub-step 2 -#. Step 2 - - a. Sub-step 1 - - - Item - #. Sub-step 2 - -Term 1: - Definition -Term 2: - Definition - -Tables ------- - -+----------------------+------------+ -| Header 1 | Header 2 | -+======================+============+ -| Cell 1 | Cell 2 | -| | | -| Second paragraph | | -+----------------------+------------+ -| Cell 3 | Cell 4 | -+----------------------+------------+ - -+----------------------+------------------+ -| :center:`Header 1` | Header 2 | -+======================+==================+ -| Cell 1 | Cell 2 | -| | | -| Second paragraph | | -+----------------------+------------------+ -| Cell 3 | :center:`Cell 4` | -+----------------------+------------------+ - -.. list-table:: - :header-rows: 1 - - * - Header 1 - - Header 2 - * - Cell 1 - - Second paragraph - - Cell 2 - * - Cell 3 - - Cell 4 - -.. rst-class:: align-center - - +----------------------+------------+ - | Header 1 | Header 2 | - +======================+============+ - | Cell 1 | Cell 2 | - | | | - | Second paragraph | | - +----------------------+------------+ - | Cell 3 | Cell 4 | - +----------------------+------------+ - -.. list-table:: - :header-rows: 1 - :align: center - - * - Header 1 - - Header 2 - * - Cell 1 - - Second paragraph - - Cell 2 - * - Cell 3 - - Cell 4 - -Notes ------ - -.. note:: - A note. - -.. tip:: - A tip. - -.. important:: - Important information - -.. caution:: - This might damage your hardware! - -Images ------- - -.. image:: https://assets.ubuntu.com/v1/b3b72cb2-canonical-logo-166.png - -.. figure:: https://assets.ubuntu.com/v1/b3b72cb2-canonical-logo-166.png - :width: 100px - :alt: Alt text - - Figure caption - -Reuse ------ - -.. |reuse_key| replace:: This is **included** text. - -|reuse_key| - -.. include:: index.rst - :start-after: include_start - :end-before: include_end - -Include code fragments from a file ----------------------------------- - -Minimal syntax: - -.. literalinclude:: /explanation/_include/deployment-manifest.yaml - :language: yaml - -This syntax includes the whole file. -Empty lines at the beginning and at the end of the document are trimmed. - -You can optionally define lines to start at/after and end at/before: - -.. literalinclude:: /explanation/_include/deployment-manifest.yaml - :language: yaml - :start-at: software: - :end-before: storage: - -This syntax is checked on builds, including CI builds. -Sphinx-build throws an error if search pattern wasn't found in the included file. - -Indentation is preserved. -When including an indented fragment, you can dedent it: - -.. literalinclude:: /explanation/_include/deployment-manifest.yaml - :language: yaml - :start-at: juju: - :end-before: charms: - :dedent: - -Tabs ----- - -.. tabs:: - - .. group-tab:: Tab 1 - - Content Tab 1 - - .. group-tab:: Tab 2 - - Content Tab 2 - - -Glossary --------- - -.. glossary:: - - example term - Definition of the example term. - -:term:`example term` - -More useful markup ------------------- - -- .. versionadded:: X.Y -- | Line 1 - | Line 2 - | Line 3 -- .. This is a comment -- :abbr:`API (Application Programming Interface)` - ----- - -Custom extensions ------------------ - -Related links at the top of the page:: - - :relatedlinks: https://github.com/canonical/lxd-sphinx-extensions, [RTFM](https://www.google.com) - :discourse: 12345 - -Terms that should not be checked by the spelling checker: :spellexception:`PurposelyWrong` - -A single-line terminal view that separates input from output: - -.. terminal:: - :input: command - :user: root - :host: vampyr - :dir: /home/user/directory/ - - the output - -A multi-line version of the same: - -.. terminal:: - :user: root - :host: vampyr - :dir: /home/user/directory/ - - :input: command 1 - output 1 - :input: command 2 - output 2 - -A link to a YouTube video: - -.. youtube:: https://www.youtube.com/watch?v=iMLiK1fX4I0 - :title: Demo - - - -.. LINKS -.. _Canonical website: https://canonical.com/ diff --git a/.custom_wordlist.txt b/docs/.custom_wordlist.txt similarity index 96% rename from .custom_wordlist.txt rename to docs/.custom_wordlist.txt index 961c934..7ccff1b 100644 --- a/.custom_wordlist.txt +++ b/docs/.custom_wordlist.txt @@ -6,6 +6,8 @@ Ansible ACL ACLs APIs +AZ +AZs Aodh Autoscaling Barbican @@ -31,6 +33,7 @@ CTRL DHCP DNS DPDK +Enablement Entra Failover Flavors @@ -111,6 +114,7 @@ RTO SAML SEV SHUTOFF +SLAs SSD SimpleStreams StatefulSet @@ -121,6 +125,7 @@ TPM Traefik ULA Uncordon +Ussuri VF VFs VMs @@ -128,18 +133,20 @@ VMDK VMware VXLAN VLAN +VLANs amd apache api args auth aws -balancers -balancer's backend backends backport backported +balancers +balancer's +baremetal br ceph cirros @@ -160,6 +167,7 @@ distro dom dpdk dqlite +enablement eno entityID entra @@ -219,6 +227,7 @@ mysubnet myuser nameserver nameservers +netconf noout ok okta @@ -257,6 +266,7 @@ scalability schedulable sdb sev +sharding snapd subnet subnets diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..3006f13 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,26 @@ +# Environment +*env*/ +.venv/ + +# Sphinx +_dev/warnings.txt +_dev/.wordlist.dic +_dev/.doctrees/ +_dev/update/ +_dev/node_modules/ + +# Vale +_dev/styles/* +_dev/vale.ini + +# Build outputs +_build + +# Node.js +package*.json + +# Unrelated cache and config files +.DS_Store +__pycache__ +.idea/ +.vscode/ diff --git a/.wokeignore b/docs/.wokeignore similarity index 73% rename from .wokeignore rename to docs/.wokeignore index ca5de25..5f4fff4 100644 --- a/.wokeignore +++ b/docs/.wokeignore @@ -5,3 +5,6 @@ doc-cheat-sheet* # the baremetal-nodes document contains links containing blocked words. explanation/baremetal-nodes.rst + +# The configuring sriov pages reference command options we cannot ignore +how-to/misc/configuring-sriov.rst diff --git a/.wordlist.txt b/docs/.wordlist.txt similarity index 100% rename from .wordlist.txt rename to docs/.wordlist.txt diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d207fb9 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,192 @@ +# Minimal makefile for Sphinx documentation +# +# Add your customisation to `Makefile` instead. + +# You can set these variables from the command line, and also +# from the environment for the first two. + +DEV_DIR ?= _dev +SPHINX_OPTS ?= -c . -d $(DEV_DIR)/.doctrees -j auto +SPHINX_BUILD ?= $(DOCS_VENVDIR)/bin/sphinx-build +SPHINX_HOST ?= 127.0.0.1 +SPHINX_PORT ?= 8000 +SPHINX_AUTOBUILD_OPTS ?= -D llms_txt_enabled=0 +DOCS_VENVDIR ?= .venv +DOCS_VENV ?= $(DOCS_VENVDIR)/bin/activate +DOCS_SOURCEDIR ?= . +DOCS_BUILDDIR ?= _build +DOCS_PDFPACKAGES ?= latexmk fonts-freefont-otf texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-font-utils texlive-lang-cjk texlive-xetex plantuml xindy tex-gyre dvipng +DOCS_VOCAB ?= $(DEV_DIR)/styles/config/vocabularies/Canonical +VALE_DIR ?= $(DOCS_VENVDIR)/lib/python*/site-packages/vale +VALE_CONFIG ?= $(DEV_DIR)/vale.ini +PA11Y_CMD ?= $(DEV_DIR)/node_modules/pa11y/bin/pa11y.js --config $(DEV_DIR)/pa11y.json +CONFIRM_SUDO ?= N +CHECK_PATH ?= $(filter-out $(DOCS_VENVDIR) $(DOCS_BUILDDIR) $(DEV_DIR),$(wildcard *)) + +# Put it first so that "make" without argument is like "make help". +help: + @echo + @echo "-------------------------------------------------------------" + @echo "* watch, build and serve the documentation: make run" + @echo "* only build: make html" + @echo "* only serve: make serve" + @echo "* clean built doc files: make clean-doc" + @echo "* clean full environment: make clean" + @echo "* check links: make linkcheck" + @echo "* check markdown: make lint-md" + @echo "* check spelling: make spelling" + @echo "* check spelling (without building again): make spellcheck" + @echo "* check inclusive language: make woke" + @echo "* check accessibility: make pa11y" + @echo "* check style guide compliance: make vale" + @echo "* check style guide compliance on target: make vale CHECK_PATH=*" + @echo "* other possible targets: make " + @echo "-------------------------------------------------------------" + @echo + +.PHONY: help full-help html epub pdf linkcheck spelling spellcheck woke \ + vale pa11y run serve install pa11y-install \ + vale-install pdf-prep pdf-prep-force clean clean-doc \ + update lint-md + +full-help: $(DOCS_VENVDIR) + @. $(DOCS_VENV); $(SPHINX_BUILD) -M help "$(DOCS_SOURCEDIR)" "$(DOCS_BUILDDIR)" $(SPHINX_OPTS) $(O) + @echo "\n\033[1;31mNOTE: This help texts shows unsupported targets!\033[0m" + @echo "Run 'make help' to see supported targets." + +# If requirements are updated, venv should be rebuilt and timestamped. +$(DOCS_VENVDIR): + @echo "... setting up virtualenv" + python3 -m venv $(DOCS_VENVDIR) || { echo "You must install python3-venv before you can build the documentation."; exit 1; } + . $(DOCS_VENV); pip install $(PIPOPTS) --require-virtualenv \ + --upgrade -r requirements.txt \ + --log $(DOCS_VENVDIR)/pip_install.log + @test ! -f $(DOCS_VENVDIR)/pip_list.txt || \ + mv $(DOCS_VENVDIR)/pip_list.txt $(DOCS_VENVDIR)/pip_list.txt.bak + @. $(DOCS_VENV); pip list --local --format=freeze > $(DOCS_VENVDIR)/pip_list.txt + @touch $(DOCS_VENVDIR) + +pa11y-install: + @command -v $(PA11Y_CMD) >/dev/null || { \ + echo "Installing \"pa11y\" from npm..."; echo; \ + mkdir -p $(DEV_DIR)/node_modules/ ; \ + npm install --prefix $(DEV_DIR) pa11y; \ + } + +pymarkdownlnt-install: install + @. $(DOCS_VENV); test -d $(DOCS_VENVDIR)/lib/python*/site-packages/pymarkdown || pip install pymarkdownlnt==0.9.35 + +install: $(DOCS_VENVDIR) + +run: install + . $(DOCS_VENV); $(DOCS_VENVDIR)/bin/sphinx-autobuild -b dirhtml --host $(SPHINX_HOST) --port $(SPHINX_PORT) "$(DOCS_SOURCEDIR)" "$(DOCS_BUILDDIR)" $(SPHINX_OPTS) $(SPHINX_AUTOBUILD_OPTS) + +# Does not depend on $(DOCS_BUILDDIR) to rebuild properly at every run. +html: install + . $(DOCS_VENV); $(SPHINX_BUILD) --fail-on-warning --keep-going -b dirhtml "$(DOCS_SOURCEDIR)" "$(DOCS_BUILDDIR)" -w $(DEV_DIR)/warnings.txt $(SPHINX_OPTS) + +epub: install + . $(DOCS_VENV); $(SPHINX_BUILD) -b epub "$(DOCS_SOURCEDIR)" "$(DOCS_BUILDDIR)" -w $(DEV_DIR)/warnings.txt $(SPHINX_OPTS) + +serve: html + cd "$(DOCS_BUILDDIR)"; python3 -m http.server --bind $(SPHINX_HOST) $(SPHINX_PORT) + +clean: clean-doc + @test ! -e "$(DOCS_VENVDIR)" -o -d "$(DOCS_VENVDIR)" -a "$(abspath $(DOCS_VENVDIR))" != "$(DOCS_VENVDIR)" + rm -rf $(DOCS_VENVDIR) + rm -rf $(DEV_DIR)/node_modules/ + rm -rf $(DEV_DIR)/styles + rm -rf $(VALE_CONFIG) + +clean-doc: + git clean -fx "$(DOCS_BUILDDIR)" + rm -rf $(DEV_DIR)/.doctrees + +linkcheck: install + . $(DOCS_VENV) ; $(SPHINX_BUILD) -b linkcheck -q "$(DOCS_SOURCEDIR)" "$(DOCS_BUILDDIR)" $(SPHINX_OPTS) || { grep --color -F "[broken]" "$(DOCS_BUILDDIR)/output.txt"; exit 1; } + exit 0 + +pa11y: pa11y-install html + find $(DOCS_BUILDDIR) -name *.html -print0 | xargs -n 1 -0 $(PA11Y_CMD) + +# Without --return-code-scheme explicit, pymarkdownlnt returns 1 for multiple scenarios +# By using the explicit scheme, it only returns 1 when no files are found, +# which should not result in failure +lint-md: pymarkdownlnt-install + @. $(DOCS_VENV); pymarkdownlnt \ + --config $(DEV_DIR)/.pymarkdown.json \ + --return-code-scheme explicit \ + scan \ + --recurse \ + --exclude=$(DEV_DIR)/** \ + --exclude=$(DOCS_VENVDIR)/** \ + $(DOCS_SOURCEDIR); \ + status=$$?; \ + if [ $$status -eq 1 ]; then \ + echo "No Markdown files selected for linting"; \ + exit 0; \ + fi; \ + echo "pymarkdownlnt exited with code $$status"; \ + exit $$status; + +vale-install: install + @. $(DOCS_VENV); test -f $(VALE_CONFIG) || python3 $(DEV_DIR)/get_vale_conf.py + @echo '.Name=="Canonical.400-Enforce-inclusive-terms"' > $(DEV_DIR)/styles/woke.filter + @echo '.Level=="error" and .Name!="Canonical.500-Repeated-words" and .Name!="Canonical.000-US-spellcheck"' > $(DEV_DIR)/styles/error.filter + @echo '.Name=="Canonical.000-US-spellcheck"' > $(DEV_DIR)/styles/spelling.filter + @. $(DOCS_VENV); find $(VALE_DIR)/vale_bin -size 195c -exec vale --version \; + +woke: vale-install + @cat $(DOCS_VOCAB)/accept.txt > $(DOCS_VOCAB)/accept_backup.txt + @cat $(DOCS_SOURCEDIR)/.custom_wordlist.txt >> $(DOCS_VOCAB)/accept.txt + @echo "Running Vale acceptable term check against $(CHECK_PATH). To change target set CHECK_PATH= with make command" + @. $(DOCS_VENV); vale --config="$(VALE_CONFIG)" --filter='$(DEV_DIR)/styles/woke.filter' --glob='*.{md,rst}' $(CHECK_PATH) + @cat $(DOCS_VOCAB)/accept_backup.txt > $(DOCS_VOCAB)/accept.txt && rm $(DOCS_VOCAB)/accept_backup.txt + +vale: vale-install + @cat $(DOCS_VOCAB)/accept.txt > $(DOCS_VOCAB)/accept_backup.txt + @cat $(DOCS_SOURCEDIR)/.custom_wordlist.txt >> $(DOCS_VOCAB)/accept.txt + @echo "Running Vale against $(CHECK_PATH). To change target set CHECK_PATH= with make command" + @. $(DOCS_VENV); vale --config="$(VALE_CONFIG)" --filter='$(DEV_DIR)/styles/error.filter' --glob='*.{md,rst}' $(CHECK_PATH) + @cat $(DOCS_VOCAB)/accept_backup.txt > $(DOCS_VOCAB)/accept.txt && rm $(DOCS_VOCAB)/accept_backup.txt + +spelling: vale-install + @cat $(DOCS_VOCAB)/accept.txt > $(DOCS_VOCAB)/accept_backup.txt + @cat $(DOCS_SOURCEDIR)/.custom_wordlist.txt >> $(DOCS_VOCAB)/accept.txt + @echo "Running Vale against $(CHECK_PATH). To change target set CHECK_PATH= with make command" + @. $(DOCS_VENV); vale --config="$(VALE_CONFIG)" --filter='$(DEV_DIR)/styles/spelling.filter' --glob='*.{md,rst}' $(CHECK_PATH) + @cat $(DOCS_VOCAB)/accept_backup.txt > $(DOCS_VOCAB)/accept.txt && rm $(DOCS_VOCAB)/accept_backup.txt + +spellcheck: spelling + @echo "Please note that the \`make spellcheck\` command is being deprecated in favor of \`make spelling\`" + +pdf-prep: install + @for packageName in $(DOCS_PDFPACKAGES); do (dpkg-query -W -f='$${Status}' $$packageName 2>/dev/null | \ + grep -c "ok installed" >/dev/null && echo "Package $$packageName is installed") && continue || \ + (echo; echo "PDF generation requires the installation of the following packages: $(DOCS_PDFPACKAGES)" && \ + echo "" && echo "Run 'sudo make pdf-prep-force' to install these packages" && echo "" && echo \ + "Please be aware these packages will be installed to your system") && exit 1 ; done + +pdf-prep-force: + apt-get update + apt-get upgrade -y + apt-get install --no-install-recommends -y $(DOCS_PDFPACKAGES) \ + +pdf: pdf-prep + @. $(DOCS_VENV); $(SPHINX_BUILD) -M latexpdf "$(DOCS_SOURCEDIR)" "$(DOCS_BUILDDIR)" $(SPHINX_OPTS) + @rm ./$(DOCS_BUILDDIR)/latex/front-page-light.pdf || true + @rm ./$(DOCS_BUILDDIR)/latex/normal-page-footer.pdf || true + @find ./$(DOCS_BUILDDIR)/latex -name "*.pdf" -exec mv -t ./$(DOCS_BUILDDIR) {} + + @rm -r $(DOCS_BUILDDIR)/latex + @echo + @echo "Output can be found in ./$(DOCS_BUILDDIR)" + @echo + +update: install + @. $(DOCS_VENV); _dev/update_sp.py + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINX_OPTS). +%: + $(MAKE) --no-print-directory install + . $(DOCS_VENV); $(SPHINX_BUILD) -M $@ "$(DOCS_SOURCEDIR)" "$(DOCS_BUILDDIR)" $(SPHINX_OPTS) $(O) diff --git a/docs/_dev/.pre-commit-config.yaml b/docs/_dev/.pre-commit-config.yaml new file mode 100644 index 0000000..07e0b48 --- /dev/null +++ b/docs/_dev/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +repos: + - repo: local + hooks: + - id: make-spelling + name: Run make spelling + entry: make -C docs spelling + language: system + pass_filenames: false + files: ^docs/.*\.(rst|md|txt)$ + + - id: make-linkcheck + name: Run make linkcheck + entry: make -C docs linkcheck + language: system + pass_filenames: false + files: ^docs/.*\.(rst|md|txt)$ + + - id: make-woke + name: Run make woke + entry: make -C docs woke + language: system + pass_filenames: false + files: ^docs/.*\.(rst|md|txt)$ diff --git a/docs/_dev/.pymarkdown.json b/docs/_dev/.pymarkdown.json new file mode 100644 index 0000000..2c4c669 --- /dev/null +++ b/docs/_dev/.pymarkdown.json @@ -0,0 +1,46 @@ +{ + "plugins": { + "selectively_enable_rules": true, + "heading-style": { + "enabled": true, + "style": "atx" + }, + "commands-show-output": { + "enabled": true + }, + "no-missing-space-atx": { + "enabled": true + }, + "blanks-around-headings": { + "enabled": true + }, + "heading-start-left": { + "enabled": true + }, + "no-trailing-punctuation": { + "enabled": true, + "punctuation": ".,;。,;" + }, + "blanks-around-fences": { + "enabled": true, + "list_items": false + }, + "blanks-around-lists": { + "enabled": true + }, + "hr-style": { + "enabled": true + }, + "no-empty-links": { + "enabled": true + }, + "no-alt-text": { + "enabled": true + } + }, + "extensions": { + "front-matter" : { + "enabled" : true + } + } +} diff --git a/docs/_dev/get_vale_conf.py b/docs/_dev/get_vale_conf.py new file mode 100755 index 0000000..b09404a --- /dev/null +++ b/docs/_dev/get_vale_conf.py @@ -0,0 +1,151 @@ +#! /usr/bin/env python + +import os +import shutil +import subprocess +import tempfile +import sys +import logging +import argparse + +# Configure logging +logging.basicConfig( + level=logging.INFO, + format='%(asctime)s - %(levelname)s - %(message)s', + datefmt='%Y-%m-%d %H:%M:%S' +) + +DEV_DIR = os.path.join(os.getcwd(), "_dev") + +GITHUB_REPO = "canonical/documentation-style-guide" +GITHUB_CLONE_URL = f"https://github.com/{GITHUB_REPO}.git" + +# Source paths to copy from repo +VALE_FILE_LIST = [ + "styles/Canonical", + "styles/config/vocabularies/Canonical", + "styles/config/dictionaries", + "vale.ini" +] + +def clone_repo_and_copy_paths(file_source_dest, overwrite=False): + """ + Clone the repository to a temporary directory and copy required files + + Args: + file_source_dest: dictionary of file paths to copy from the repository, + and their destination paths + overwrite: boolean flag to overwrite existing files in the destination + + Returns: + bool: True if all files were copied successfully, False otherwise + """ + + if not file_source_dest: + logging.error("No files to copy") + return False + + # Create temporary directory on disk for cloning + temp_dir = tempfile.mkdtemp() + logging.info("Cloning repository <%s> to temporary directory: %s", GITHUB_REPO, temp_dir) + clone_cmd = ["git", "clone", "--depth", "1", GITHUB_CLONE_URL, temp_dir] + + try: + result = subprocess.run( + clone_cmd, + capture_output=True, + text=True, + check=True + ) + logging.debug("Git clone output: %s", result.stdout) + except subprocess.CalledProcessError as e: + logging.error("Git clone failed: %s", e.stderr) + return False + + # Copy files from the cloned repository to the destination paths + is_copy_success = True + for source, dest in file_source_dest.items(): + source_path = os.path.join(temp_dir, source) + + if not os.path.exists(source_path): + is_copy_success = False + logging.error("Source path not found: %s", source_path) + continue + + if not copy_files_to_path(source_path, dest, overwrite): + is_copy_success = False + logging.error("Failed to copy %s to %s", source_path, dest) + + # Clean up temporary directory + logging.info("Cleaning up temporary directory: %s", temp_dir) + shutil.rmtree(temp_dir) + + return is_copy_success + +def copy_files_to_path(source_path, dest_path, overwrite=False): + """ + Copy a file or directory from source to destination + + Args: + source_path: Path to the source file or directory + dest_path: Path to the destination + overwrite: Boolean flag to overwrite existing files in the destination + + Returns: + bool: True if copy was successful, False otherwise + """ + # Skip if source file doesn't exist + if not os.path.exists(source_path): + logging.warning("Source path not found: %s", source_path) + return False + + logging.info("Copying %s to %s", source_path, dest_path) + # Handle existing files + if os.path.exists(dest_path): + if overwrite: + logging.info(" Destination exists, overwriting: %s", dest_path) + if os.path.isdir(dest_path): + shutil.rmtree(dest_path) + else: + os.remove(dest_path) + else: + logging.info(" Destination exists, skip copying (use overwrite=True to replace): %s", + dest_path) + return True # Skip copying + + # Copy the source to destination + try: + if os.path.isdir(source_path): + # entire directory + shutil.copytree(source_path, dest_path) + else: + # individual files + shutil.copy2(source_path, dest_path) + return True + except (shutil.Error, OSError) as e: + logging.error("Copy failed: %s", e) + return False + +def parse_arguments(): + parser = argparse.ArgumentParser(description="Download Vale configuration files") + parser.add_argument("--no-overwrite", action="store_true", help="Don't overwrite existing files") + return parser.parse_args() + +def main(): + # Define local directory paths + vale_files_dict = {file: os.path.join(DEV_DIR, file) for file in VALE_FILE_LIST} + + # Parse command line arguments, default to overwrite_enabled = True + overwrite_enabled = not parse_arguments().no_overwrite + + # Download into /tmp through git clone + if not clone_repo_and_copy_paths(vale_files_dict, overwrite=overwrite_enabled): + logging.error("Failed to download files from repository") + return 1 + + logging.info("Download complete") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) # Keep return code diff --git a/.sphinx/pa11y.json b/docs/_dev/pa11y.json similarity index 98% rename from .sphinx/pa11y.json rename to docs/_dev/pa11y.json index 8df0cb9..04dc1e1 100644 --- a/.sphinx/pa11y.json +++ b/docs/_dev/pa11y.json @@ -6,4 +6,4 @@ }, "reporter": "cli", "standard": "WCAG2AA" -} \ No newline at end of file +} diff --git a/docs/_dev/update_sp.py b/docs/_dev/update_sp.py new file mode 100755 index 0000000..3014a84 --- /dev/null +++ b/docs/_dev/update_sp.py @@ -0,0 +1,270 @@ +#! /usr/bin/env python + +# Initial update script for the Sphinx Stack. +# +# Requires some manual intervention, but makes identifying updates and differences easier. +# +# For debugging, please run this script with DEBUGGING=1 +# e.g. user@device:~/git/Canonical/sphinx-stack/docs$ DEBUGGING=1 python _dev/update_sp.py + + +import glob +import logging +import os +import re +import subprocess +import sys + +import requests +from packaging.version import parse as parse_version +from requests.exceptions import RequestException + +SPHINX_DIR = os.path.abspath(os.path.dirname(__file__)) +DOCS_DIR = os.path.abspath(os.path.join(SPHINX_DIR, "..")) +REQUIREMENTS = os.path.join(DOCS_DIR, "requirements.txt") +SPHINX_UPDATE_DIR = os.path.join(SPHINX_DIR, "update") +GITHUB_REPO = "canonical/sphinx-stack" +GITHUB_API_BASE = f"https://api.github.com/repos/{GITHUB_REPO}" +GITHUB_API_DEV_DIR = f"{GITHUB_API_BASE}/contents/docs/_dev" +GITHUB_RAW_BASE = f"https://raw.githubusercontent.com/{GITHUB_REPO}/main" + +TIMEOUT = 10 # seconds + +# Check if debugging +if os.getenv("DEBUGGING"): + logging.basicConfig(level=logging.DEBUG) + + +def main(): + # Check local version + logging.debug("Checking local version") + try: + with open(os.path.join(SPHINX_DIR, "version")) as f: + local_version = f.read().strip() + except FileNotFoundError: + print("WARNING\nWARNING\nWARNING") + print( + "You need to update to at least version 1.0.0 of the Sphinx Stack to start using the update function." + ) + print("You may experience issues using this functionality.") + logging.debug("No local version found. Setting version to None") + local_version = "None" + except Exception as e: + logging.debug(e) + raise Exception("ERROR executing check local version") + logging.debug(f"Local version = {local_version}") + + # Check release version + latest_release = query_api(GITHUB_API_BASE + "/releases/latest").json()["tag_name"] + logging.debug(f"Latest release = {latest_release}") + + # Perform actions only if local version is older than release version + logging.debug("Comparing versions") + if parse_version(local_version) < parse_version(latest_release): + logging.debug("Local version is older than the release version.") + print("Sphinx Stack is out of date.\n") + + # Identify and download '_dev' dir files to '_dev/update' + files_updated, new_files = update_static_files() + + # Write new version to file to '_dev/update' + + download_file( + GITHUB_RAW_BASE + "/docs/_dev/version", + os.path.join(SPHINX_UPDATE_DIR, "version"), + ) + + # Provide changelog to identify other significant changes + changelog = query_api(GITHUB_RAW_BASE + "/CHANGELOG.md") + logging.debug("Changelog obtained") + version_regex = re.compile(r"#+ +" + re.escape(local_version) + r" *\n") + print("SEE CURRENT CHANGELOG:") + print(re.split(version_regex, changelog.text)[0]) + + # Provide information on any files identified for updates + if files_updated: + logging.debug("Updated files found and downloaded") + print("Differences have been identified in static files.") + print("Updated files have been downloaded to '_dev/update'.") + print("Validate and move these files into your '_dev/' directory.") + else: + logging.debug("No files found to update") + # Provide information on NEW files + if new_files: + logging.debug("New files found and downloaded") + print( + "NOTE: New files have been downloaded\n", + "See 'NEWFILES.txt' for all downloaded files\n", + "Validate and merge these files into your '_dev/' directory", + ) + else: + logging.debug("No new files found to download") + else: + logging.debug("Local version and release version are the same") + print("This version is up to date.") + + # Check requirements are the same + new_requirements = [] + try: + with open(REQUIREMENTS, "r") as file: + logging.debug("Checking requirements") + + local_reqs = set(file.read().splitlines()) - {""} + requirements = set( + query_api(GITHUB_RAW_BASE + "/docs/requirements.txt").text.splitlines() + ) + + new_requirements = requirements - local_reqs + + for req in new_requirements: + logging.debug(f"{req} not found in local requirements.txt") + + for req in requirements & local_reqs: + logging.debug(f"{req} already exists in local requirements.txt") + + if new_requirements != set(): + print( + "You may need to add the following packages to your requirements.txt file:" + ) + for r in new_requirements: + print(f"{r}\n") + except FileNotFoundError: + print("requirements.txt not found") + print( + "The updated Sphinx Stack has moved requirements.txt out of the '_dev' dir" + ) + print("requirements.txt not checked, please update your requirements manually") + + +def update_static_files(): + """Checks local files against remote for new and different files, downloads to '_dev/updates'""" + files, paths = get_local_files_and_paths() + new_file_list = [] + + for item in query_api(GITHUB_API_DEV_DIR).json(): + logging.debug(f"Checking {item['name']}") + # Checks existing files in '_dev' Sphinx Stack static root for changed SHA + if item["name"] in files and item["type"] == "file": + index = files.index(item["name"]) + if item["sha"] != get_git_revision_hash(paths[index]): + logging.debug(f"Local {item['name']} is different to remote") + download_file( + item["download_url"], os.path.join(SPHINX_UPDATE_DIR, item["name"]) + ) + if item["name"] == "update_sp.py": + # Indicate update script needs to be updated and re-run + print("WARNING") + print( + "THIS UPDATE SCRIPT IS OUT OF DATE. YOU MAY NEED TO RUN ANOTHER UPDATE AFTER UPDATING TO THE FILE IN '_dev/updates'." + ) + print("WARNING\n") + else: + logging.debug("File hashes are equal") + # Checks nested files '_dev/**/**.*' for changed SHA (single level of depth) + elif item["type"] == "dir": + logging.debug(item["name"] + " is a directory") + for nested_item in query_api(f"{GITHUB_API_DEV_DIR}/{item['name']}").json(): + logging.debug(f"Checking {nested_item['name']}") + if nested_item["name"] in files: + index = files.index(nested_item["name"]) + if nested_item["sha"] != get_git_revision_hash(paths[index]): + logging.debug( + f"Local {nested_item['name']} is different to remote" + ) + download_file( + nested_item["download_url"], + os.path.join( + SPHINX_UPDATE_DIR, item["name"], nested_item["name"] + ), + ) + # Downloads NEW nested files + else: + logging.debug(f"No local version found of {nested_item['name']}") + if nested_item["type"] == "file": + new_file_list.append(nested_item["name"]) + download_file( + nested_item["download_url"], + os.path.join( + SPHINX_UPDATE_DIR, item["name"], nested_item["name"] + ), + ) + # Downloads NEW files in '_dev' Sphinx Stack static root + else: + if item["type"] == "file": + logging.debug(f"No local version found of {item['name']}") + download_file( + item["download_url"], os.path.join(SPHINX_UPDATE_DIR, item["name"]) + ) + if item["name"] != "version": + new_file_list.append(item["name"]) + # Writes return value for parent function + if os.path.exists(os.path.join(SPHINX_UPDATE_DIR)): + logging.debug("Files have been downloaded") + files_updated = True + else: + logging.debug("No downloads found") + files_updated = False + # Writes return value for parent function + if new_file_list != []: + # Provides more information on new files + with open(f"{SPHINX_DIR}/NEWFILES.txt", "w") as f: + for entry in new_file_list: + f.write(f"{entry}\n") + logging.debug("Some downloaded files are new") + return files_updated, True + return files_updated, False + + +# Checks git hash of a file +def get_git_revision_hash(file) -> str: + """Get SHA of local files""" + logging.debug(f"Getting hash of {os.path.basename(file)}") + return subprocess.check_output(["git", "hash-object", file]).decode("ascii").strip() + + +# Examines local files +def get_local_files_and_paths(): + """Identify '_dev' local files and paths""" + logging.debug("Checking local files and paths") + try: + files = [] + paths = [] + patterns = [".*", "**.*"] + files, paths = [], [] + + for pattern in patterns: + for file in glob.iglob(os.path.join(SPHINX_DIR, pattern), recursive=True): + files.append(os.path.basename(file)) + paths.append(file) + return files, paths + except Exception as e: + logging.debug(e) + raise RuntimeError("get_local_files_and_paths()") from e + + +# General API query with timeout and RequestException +def query_api(url): + """Query an API with a globally set timeout""" + logging.debug(f"Querying {url}") + try: + r = requests.get(url, timeout=TIMEOUT) + return r + except RequestException as e: + raise RuntimeError(f"Failed query_api(): {url}") from e + + +# General file download function +def download_file(url, output_path): + """Download a file to a specified path""" + logging.debug(f"Downloading {os.path.basename(output_path)}") + try: + os.makedirs(os.path.dirname(output_path), exist_ok=True) + with open(output_path, "wb") as file: + file.write(query_api(url).content) + except Exception as e: + logging.debug(e) + raise RuntimeError(f"Failed download_file(): {url}") from e + + +if __name__ == "__main__": + sys.exit(main()) # Keep return code diff --git a/docs/_dev/version b/docs/_dev/version new file mode 100644 index 0000000..cd5ac03 --- /dev/null +++ b/docs/_dev/version @@ -0,0 +1 @@ +2.0 diff --git a/docs/_dev/warnings.txt b/docs/_dev/warnings.txt new file mode 100644 index 0000000..e69de29 diff --git a/.sphinx/_templates/footer.html b/docs/_templates/footer.html similarity index 59% rename from .sphinx/_templates/footer.html rename to docs/_templates/footer.html index 6839f01..e1d1088 100644 --- a/.sphinx/_templates/footer.html +++ b/docs/_templates/footer.html @@ -1,11 +1,9 @@ -{# ru-fu: copied from Furo, with modifications as stated below. Modifications are marked 'mod:'. #} -
- {% if github_url and github_folder and pagename and page_source_suffix and display_contributors %} - {% set contributors = get_contribs(github_url, github_folder, pagename, page_source_suffix, display_contributors_since) %} - {% if contributors %} + {% if has_contributor_listing and display_contributors and pagename and page_source_suffix %} + {% set contributors = get_contributors_for_file(pagename, page_source_suffix) %} + {% if contributors %} {% if contributors | length > 1 %} Thanks to the {{ contributors |length }} contributors! {% else %} @@ -83,49 +92,12 @@ - {% endif %} - {% endif %} + {% endif %} + {% endif %}
-
- - {# mod: replaced RTD icons with our links #} - - {% if discourse %} - - {% endif %} - - {% if mattermost %} - - {% endif %} - - {% if matrix %} - - {% endif %} - - {% if github_url and github_version and github_folder %} - - {% if github_issues %} - - {% endif %} - - - {% endif %} - - -
- - + + \ No newline at end of file diff --git a/docs/_templates/header.html b/docs/_templates/header.html new file mode 100644 index 0000000..9ee3c77 --- /dev/null +++ b/docs/_templates/header.html @@ -0,0 +1,72 @@ + \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..424d774 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,281 @@ +import datetime +import os +import textwrap + +# Configuration for the Sphinx documentation builder. +# All configuration specific to your project should be done in this file. +# +# If you're new to Sphinx and don't want any advanced or custom features, +# just go through the items marked 'TODO'. +# +# A complete list of built-in Sphinx configuration values: +# https://www.sphinx-doc.org/en/master/usage/configuration.html +# +# The Sphinx Stack uses the Canonical Sphinx theme to keep all documentation consistent +# and on brand: +# https://github.com/canonical/canonical-sphinx + +####################### +# Project information # +####################### + +# Project name +project = "Canonical OpenStack" + +# Author name; used in the default copyright statement in the page footer +author = "Canonical Ltd." + +# The year in the copyright statement +copyright = f"{datetime.date.today().year}" + +# Sidebar documentation title +# To disable the title, set it to an empty string. +html_title = project + " documentation" + +# Documentation website URL +ogp_site_url = os.environ.get("READTHEDOCS_CANONICAL_URL", "/") + +# Preview name of the documentation website +ogp_site_name = project + +# Preview image URL +# TODO: To customise the preview image, update the next line. +ogp_image = "https://assets.ubuntu.com/v1/cc828679-docs_illustration.svg" + +# Product favicon; shown in bookmarks, browser tabs, etc. +# TODO: To customise the favicon, uncomment and update the next line. +# html_favicon = "_static/favicon.png" + +# Dictionary of values to pass into the Sphinx context for all pages: +# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_context +html_context = { + # Product page URL; can be different from product docs URL + "product_page": "canonical.com/openstack", + # Product tag image; the orange part of your logo, shown in the page header + # TODO: To add a tag image, uncomment and update as needed. + # 'product_tag': '_static/tag.png', + # Your Discourse instance URL + # TODO: Change to your Discourse instance URL or leave empty. + "discourse": "https://discourse.ubuntu.com", + # Your Mattermost channel URL + "mattermost": "", + # Your Matrix channel URL + "matrix": "https://matrix.to/#/#openstack-sunbeam:ubuntu.com", + # Your documentation GitHub repository URL If set, links for viewing the + # documentation source files and creating GitHub issues are added at the bottom of + # each page. + "github_url": "https://github.com/canonical/canonical-openstack-docs", + # Docs branch in the repo; used in links for viewing the source files + "repo_default_branch": "main", + # Docs location in the repo; used in links for viewing the source files + "repo_folder": "/docs/", + # Valid options: none, prev, next, both + # "sequential_nav": "", + "display_contributors": False, + # Required for feedback button + "github_issues": "enabled", + # Passes the top-level 'author' value to the theme + "author": author, + # Documentation license information + "license": { + "name": "Apache-2.0", + "url": "https://github.com/canonical/snap-openstack/blob/main/LICENSE", + }, +} + +# TODO: To enable the edit button on pages, uncomment and change the link to a +# public repository on GitHub or Launchpad. Any of the following link domains +# are accepted: +# - https://github.com/example-org/example" +# - https://launchpad.net/example +# - https://git.launchpad.net/example +# +# html_theme_options = { +# 'source_edit_link': 'https://github.com/canonical/sphinx-stack', +# } + +# Project slug +# TODO: If your documentation is hosted on https://documentation.ubuntu.com/, +# uncomment and set to the RTD slug. +# slug = '' + +####################### +# Sitemap configuration: https://sphinx-sitemap.readthedocs.io/ +####################### + +# Use RTD canonical URL to ensure duplicate pages have a specific canonical URL +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "/") + +# sphinx-sitemap uses html_baseurl to generate the full URL for each page: +sitemap_url_scheme = "{link}" + +# Include `lastmod` dates in the sitemap: +sitemap_show_lastmod = True + +# TODO: Exclude pages that aren't user-facing from the sitemap (e.g., module pages +# generated by autodoc). +# Pages excluded from the sitemap: +sitemap_excludes = [ + "404/", + "genindex/", + "search/", +] + +################################ +# Template and asset locations # +################################ + +# html_static_path = ["_static"] +# templates_path = ["_templates"] + +############# +# Redirects # +############# + +# Add redirects to the 'redirects.txt' file +# https://sphinxext-rediraffe.readthedocs.io/en/latest/ + +# To set up redirects in the Read the Docs project dashboard: +# https://docs.readthedocs.io/en/stable/guides/redirects.html + +rediraffe_redirects = "redirects.txt" + +# Strips '/index.html' from destination URLs when building with 'dirhtml' +rediraffe_dir_only = True + + +############################ +# sphinx-llm configuration # +############################ + +# This description is included in llms.txt to provide some initial context for your +# product docs. +# TODO: Add a description in the form "This is the documentation for , +# ". +llms_txt_description = textwrap.dedent( + """\ + This is the documentation for Canonical OpenStack, an enterprise-grade cloud + platform that delivers distilled upstream OpenStack excellence in the form of + a human-friendly product. + """ +) + +# The base URL for references built by sphinx-markdown-builder. +if os.environ.get("READTHEDOCS"): + markdown_http_base = html_baseurl + +########################### +# Link checker exceptions # +########################### + +# A regex list of URLs that are ignored by 'make linkcheck' +linkcheck_ignore = [ + "https://github.com", + r"https://matrix\.to/.*", + "https://example.com", + # SourceForge domains often block linkcheck + r"https://.*\.sourceforge\.(net|io)/.*", + # DMTF appears to block linkchecks + "https://www.dmtf.org/standards/cadf", + # Exclude RFC1918 URLs as they are used for examples in the documentation + r'^https?://127\.', + r'^https?://192\.', + r'^https?://10\.', + r'^https?://172\.(1[6-9]|2[0-9]|3[0-1])\.', + r'^https?://192\.168\.', +] + +# A regex list of URLs where anchors are ignored by 'make linkcheck' +linkcheck_anchors_ignore_for_url = [ + r"https://github\.com/.*", + '^https://ubuntu.com/server/docs/.*$', + '^https://juju.is/docs/juju/.*$', + '^https://canonical.com/openstack.*$', +] + +# How long the link checker will wait for a response for each request +# TODO: Decrease to improve run time or increase if links frequently time out. +# linkcheck_timeout = 30 + +# Give linkcheck multiple tries on failure +linkcheck_retries = 3 + +######################## +# Configuration extras # +######################## + +# Custom MyST syntax extensions; see +# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html +# NOTE: By default, the following MyST extensions are enabled: +# - substitution +# - deflist +# - linkify +# myst_enable_extensions = set() + +# Custom Sphinx extensions; see +# https://www.sphinx-doc.org/en/master/usage/extensions/index.html +extensions = [ + "canonical_sphinx", + "notfound.extension", + "sphinx_design", + "sphinx_rerediraffe", + "sphinx_reredirects", + "sphinx_tabs.tabs", + "sphinxcontrib.jquery", + "sphinxext.opengraph", + "sphinx_config_options", + "sphinx_contributor_listing", + "sphinx_filtered_toctree", + "sphinx_llm.txt", + "sphinx_related_links", + "sphinx_roles", + "sphinx_terminal", + "sphinx_ubuntu_images", + "sphinx_youtube_links", + "sphinxcontrib.cairosvgconverter", + "sphinx_last_updated_by_git", + "sphinx.ext.intersphinx", + "sphinx_sitemap", +] + +# Excludes files or directories from processing +exclude_patterns = [ + "doc-cheat-sheet*", + ".venv*", + "_dev", +] + +# Adds custom CSS files, located remotely or in 'html_static_path'. +# html_css_files = [ +# "https://assets.ubuntu.com/v1/d86746ef-cookie_banner.css", +# ] + +# Adds custom JavaScript files, located remotely or in 'html_static_path'. +# html_js_files = [ +# "https://assets.ubuntu.com/v1/287a5e8f-bundle.js", +# ] + +# Appends extra markup to the end of every document written in reST +rst_epilog = """ +.. include:: /reuse/links.txt +""" + +# Specifies a reST snippet to be prepended to each .rst file +# This defines a :center: role that centers table cell content. +# This defines a :h2: role that styles content for use with PDF generation. +rst_prolog = """ +.. role:: center + :class: align-center +.. role:: h2 + :class: hclass2 +.. role:: woke-ignore + :class: woke-ignore +.. role:: vale-ignore + :class: vale-ignore +""" + +# Configuration for Intersphinx projects +# +# intersphinx_mapping = { +# "snap": ("https://snapcraft.io/docs/", None), +# } diff --git a/contributor/index.rst b/docs/contributor/index.rst similarity index 100% rename from contributor/index.rst rename to docs/contributor/index.rst diff --git a/contributor/reference/index.rst b/docs/contributor/reference/index.rst similarity index 100% rename from contributor/reference/index.rst rename to docs/contributor/reference/index.rst diff --git a/contributor/reference/stable-release.rst b/docs/contributor/reference/stable-release.rst similarity index 100% rename from contributor/reference/stable-release.rst rename to docs/contributor/reference/stable-release.rst diff --git a/explanation/_include/deployment-manifest.yaml b/docs/explanation/_include/deployment-manifest.yaml similarity index 100% rename from explanation/_include/deployment-manifest.yaml rename to docs/explanation/_include/deployment-manifest.yaml diff --git a/explanation/architecture.rst b/docs/explanation/architecture.rst similarity index 100% rename from explanation/architecture.rst rename to docs/explanation/architecture.rst diff --git a/explanation/baremetal-nodes.rst b/docs/explanation/baremetal-nodes.rst similarity index 100% rename from explanation/baremetal-nodes.rst rename to docs/explanation/baremetal-nodes.rst diff --git a/explanation/deployment-manifest.rst b/docs/explanation/deployment-manifest.rst similarity index 100% rename from explanation/deployment-manifest.rst rename to docs/explanation/deployment-manifest.rst diff --git a/explanation/design-considerations.rst b/docs/explanation/design-considerations.rst similarity index 100% rename from explanation/design-considerations.rst rename to docs/explanation/design-considerations.rst diff --git a/explanation/epa-orchestrator.rst b/docs/explanation/epa-orchestrator.rst similarity index 100% rename from explanation/epa-orchestrator.rst rename to docs/explanation/epa-orchestrator.rst diff --git a/explanation/images/canonical-openstack-software-architecture.png b/docs/explanation/images/canonical-openstack-software-architecture.png similarity index 100% rename from explanation/images/canonical-openstack-software-architecture.png rename to docs/explanation/images/canonical-openstack-software-architecture.png diff --git a/explanation/images/multi-node-topology.png b/docs/explanation/images/multi-node-topology.png similarity index 100% rename from explanation/images/multi-node-topology.png rename to docs/explanation/images/multi-node-topology.png diff --git a/explanation/images/single-node-topology.png b/docs/explanation/images/single-node-topology.png similarity index 100% rename from explanation/images/single-node-topology.png rename to docs/explanation/images/single-node-topology.png diff --git a/explanation/index.rst b/docs/explanation/index.rst similarity index 94% rename from explanation/index.rst rename to docs/explanation/index.rst index 9f29b3a..553c8e5 100644 --- a/explanation/index.rst +++ b/docs/explanation/index.rst @@ -1,3 +1,5 @@ +.. _explanation: + Explanation =========== diff --git a/explanation/instance-recovery.rst b/docs/explanation/instance-recovery.rst similarity index 100% rename from explanation/instance-recovery.rst rename to docs/explanation/instance-recovery.rst diff --git a/explanation/maintenance-mode.rst b/docs/explanation/maintenance-mode.rst similarity index 100% rename from explanation/maintenance-mode.rst rename to docs/explanation/maintenance-mode.rst diff --git a/explanation/network-traffic-isolation-with-maas.rst b/docs/explanation/network-traffic-isolation-with-maas.rst similarity index 100% rename from explanation/network-traffic-isolation-with-maas.rst rename to docs/explanation/network-traffic-isolation-with-maas.rst diff --git a/explanation/service-endpoint-encryption.rst b/docs/explanation/service-endpoint-encryption.rst similarity index 100% rename from explanation/service-endpoint-encryption.rst rename to docs/explanation/service-endpoint-encryption.rst diff --git a/explanation/technical-motives.rst b/docs/explanation/technical-motives.rst similarity index 100% rename from explanation/technical-motives.rst rename to docs/explanation/technical-motives.rst diff --git a/how-to/features/baremetal.rst b/docs/how-to/features/baremetal.rst similarity index 100% rename from how-to/features/baremetal.rst rename to docs/how-to/features/baremetal.rst diff --git a/how-to/features/caas.rst b/docs/how-to/features/caas.rst similarity index 99% rename from how-to/features/caas.rst rename to docs/how-to/features/caas.rst index 8515547..84a0e7a 100644 --- a/how-to/features/caas.rst +++ b/docs/how-to/features/caas.rst @@ -77,7 +77,8 @@ Sample output: :user: ubuntu :host: sunbeam01 :dir: ~ - :input: openstack coe cluster template + + openstack coe cluster template create ck8s-cluster-template-ovn \ --image ubuntu \ --external-network external-network \ @@ -297,7 +298,8 @@ Existing cluster can be upgraded to enable keystone auth by running the followin :user: ubuntu :host: sunbeam01 :dir: ~ - :input: openstack coe cluster upgrade CLUSTER_UUID NEW_CLUSTER_TEMPLATE_UUID + + openstack coe cluster upgrade CLUSTER_UUID NEW_CLUSTER_TEMPLATE_UUID Request to upgrade cluster fc5724ae-aef8-4c89-aef8-78bc41f54325 has been accepted. diff --git a/how-to/features/dns.rst b/docs/how-to/features/dns.rst similarity index 100% rename from how-to/features/dns.rst rename to docs/how-to/features/dns.rst diff --git a/how-to/features/grafana-capacity-overview.png b/docs/how-to/features/grafana-capacity-overview.png similarity index 100% rename from how-to/features/grafana-capacity-overview.png rename to docs/how-to/features/grafana-capacity-overview.png diff --git a/how-to/features/grafana-compute-overview.png b/docs/how-to/features/grafana-compute-overview.png similarity index 100% rename from how-to/features/grafana-compute-overview.png rename to docs/how-to/features/grafana-compute-overview.png diff --git a/how-to/features/grafana-dashboards.png b/docs/how-to/features/grafana-dashboards.png similarity index 100% rename from how-to/features/grafana-dashboards.png rename to docs/how-to/features/grafana-dashboards.png diff --git a/how-to/features/grafana-days-until-threshold.png b/docs/how-to/features/grafana-days-until-threshold.png similarity index 100% rename from how-to/features/grafana-days-until-threshold.png rename to docs/how-to/features/grafana-days-until-threshold.png diff --git a/how-to/features/grafana-landing.png b/docs/how-to/features/grafana-landing.png similarity index 100% rename from how-to/features/grafana-landing.png rename to docs/how-to/features/grafana-landing.png diff --git a/how-to/features/grafana-login.png b/docs/how-to/features/grafana-login.png similarity index 100% rename from how-to/features/grafana-login.png rename to docs/how-to/features/grafana-login.png diff --git a/how-to/features/grafana-openstack-cloud-usage.png b/docs/how-to/features/grafana-openstack-cloud-usage.png similarity index 100% rename from how-to/features/grafana-openstack-cloud-usage.png rename to docs/how-to/features/grafana-openstack-cloud-usage.png diff --git a/how-to/features/grafana-openstack-dashboard-overview.jpeg b/docs/how-to/features/grafana-openstack-dashboard-overview.jpeg similarity index 100% rename from how-to/features/grafana-openstack-dashboard-overview.jpeg rename to docs/how-to/features/grafana-openstack-dashboard-overview.jpeg diff --git a/how-to/features/grafana-openstack-http-status-codes-dashboard.png b/docs/how-to/features/grafana-openstack-http-status-codes-dashboard.png similarity index 100% rename from how-to/features/grafana-openstack-http-status-codes-dashboard.png rename to docs/how-to/features/grafana-openstack-http-status-codes-dashboard.png diff --git a/how-to/features/grafana-openstack-service-logs.png b/docs/how-to/features/grafana-openstack-service-logs.png similarity index 100% rename from how-to/features/grafana-openstack-service-logs.png rename to docs/how-to/features/grafana-openstack-service-logs.png diff --git a/how-to/features/grafana-project-overview.png b/docs/how-to/features/grafana-project-overview.png similarity index 100% rename from how-to/features/grafana-project-overview.png rename to docs/how-to/features/grafana-project-overview.png diff --git a/how-to/features/images-sync.rst b/docs/how-to/features/images-sync.rst similarity index 100% rename from how-to/features/images-sync.rst rename to docs/how-to/features/images-sync.rst diff --git a/how-to/features/index.rst b/docs/how-to/features/index.rst similarity index 100% rename from how-to/features/index.rst rename to docs/how-to/features/index.rst diff --git a/how-to/features/instance-recovery.rst b/docs/how-to/features/instance-recovery.rst similarity index 100% rename from how-to/features/instance-recovery.rst rename to docs/how-to/features/instance-recovery.rst diff --git a/how-to/features/ldap.rst b/docs/how-to/features/ldap.rst similarity index 100% rename from how-to/features/ldap.rst rename to docs/how-to/features/ldap.rst diff --git a/how-to/features/load-balancer.rst b/docs/how-to/features/load-balancer.rst similarity index 100% rename from how-to/features/load-balancer.rst rename to docs/how-to/features/load-balancer.rst diff --git a/how-to/features/managing-tls/implement-tls-using-a-third-party-ca.rst b/docs/how-to/features/managing-tls/implement-tls-using-a-third-party-ca.rst similarity index 100% rename from how-to/features/managing-tls/implement-tls-using-a-third-party-ca.rst rename to docs/how-to/features/managing-tls/implement-tls-using-a-third-party-ca.rst diff --git a/how-to/features/managing-tls/index.rst b/docs/how-to/features/managing-tls/index.rst similarity index 100% rename from how-to/features/managing-tls/index.rst rename to docs/how-to/features/managing-tls/index.rst diff --git a/how-to/features/managing-tls/tls-ca.rst b/docs/how-to/features/managing-tls/tls-ca.rst similarity index 100% rename from how-to/features/managing-tls/tls-ca.rst rename to docs/how-to/features/managing-tls/tls-ca.rst diff --git a/how-to/features/managing-tls/tls-vault.rst b/docs/how-to/features/managing-tls/tls-vault.rst similarity index 100% rename from how-to/features/managing-tls/tls-vault.rst rename to docs/how-to/features/managing-tls/tls-vault.rst diff --git a/how-to/features/object-storage.rst b/docs/how-to/features/object-storage.rst similarity index 100% rename from how-to/features/object-storage.rst rename to docs/how-to/features/object-storage.rst diff --git a/how-to/features/observability.rst b/docs/how-to/features/observability.rst similarity index 100% rename from how-to/features/observability.rst rename to docs/how-to/features/observability.rst diff --git a/how-to/features/orchestration.rst b/docs/how-to/features/orchestration.rst similarity index 100% rename from how-to/features/orchestration.rst rename to docs/how-to/features/orchestration.rst diff --git a/how-to/features/resource-optimization.rst b/docs/how-to/features/resource-optimization.rst similarity index 100% rename from how-to/features/resource-optimization.rst rename to docs/how-to/features/resource-optimization.rst diff --git a/how-to/features/secrets.rst b/docs/how-to/features/secrets.rst similarity index 100% rename from how-to/features/secrets.rst rename to docs/how-to/features/secrets.rst diff --git a/how-to/features/shared-filesystem.rst b/docs/how-to/features/shared-filesystem.rst similarity index 100% rename from how-to/features/shared-filesystem.rst rename to docs/how-to/features/shared-filesystem.rst diff --git a/how-to/features/telemetry.rst b/docs/how-to/features/telemetry.rst similarity index 100% rename from how-to/features/telemetry.rst rename to docs/how-to/features/telemetry.rst diff --git a/how-to/features/ubuntu-pro.rst b/docs/how-to/features/ubuntu-pro.rst similarity index 100% rename from how-to/features/ubuntu-pro.rst rename to docs/how-to/features/ubuntu-pro.rst diff --git a/how-to/features/validation.rst b/docs/how-to/features/validation.rst similarity index 100% rename from how-to/features/validation.rst rename to docs/how-to/features/validation.rst diff --git a/how-to/features/validation_800x533.png b/docs/how-to/features/validation_800x533.png similarity index 100% rename from how-to/features/validation_800x533.png rename to docs/how-to/features/validation_800x533.png diff --git a/how-to/features/vault.rst b/docs/how-to/features/vault.rst similarity index 100% rename from how-to/features/vault.rst rename to docs/how-to/features/vault.rst diff --git a/how-to/index.rst b/docs/how-to/index.rst similarity index 97% rename from how-to/index.rst rename to docs/how-to/index.rst index ac28f42..6f6f5fb 100644 --- a/how-to/index.rst +++ b/docs/how-to/index.rst @@ -1,3 +1,5 @@ +.. _howto: + How-to Guides ============= diff --git a/how-to/install/images/install-canonical-openstack-using-canonical-maas-01.png b/docs/how-to/install/images/install-canonical-openstack-using-canonical-maas-01.png similarity index 100% rename from how-to/install/images/install-canonical-openstack-using-canonical-maas-01.png rename to docs/how-to/install/images/install-canonical-openstack-using-canonical-maas-01.png diff --git a/how-to/install/images/install-canonical-openstack-using-canonical-maas-02.png b/docs/how-to/install/images/install-canonical-openstack-using-canonical-maas-02.png similarity index 100% rename from how-to/install/images/install-canonical-openstack-using-canonical-maas-02.png rename to docs/how-to/install/images/install-canonical-openstack-using-canonical-maas-02.png diff --git a/how-to/install/images/install-canonical-openstack-using-canonical-maas-03.png b/docs/how-to/install/images/install-canonical-openstack-using-canonical-maas-03.png similarity index 100% rename from how-to/install/images/install-canonical-openstack-using-canonical-maas-03.png rename to docs/how-to/install/images/install-canonical-openstack-using-canonical-maas-03.png diff --git a/how-to/install/images/install-canonical-openstack-using-canonical-maas-04.png b/docs/how-to/install/images/install-canonical-openstack-using-canonical-maas-04.png similarity index 100% rename from how-to/install/images/install-canonical-openstack-using-canonical-maas-04.png rename to docs/how-to/install/images/install-canonical-openstack-using-canonical-maas-04.png diff --git a/how-to/install/index.rst b/docs/how-to/install/index.rst similarity index 100% rename from how-to/install/index.rst rename to docs/how-to/install/index.rst diff --git a/how-to/install/install-canonical-openstack-using-canonical-maas.rst b/docs/how-to/install/install-canonical-openstack-using-canonical-maas.rst similarity index 100% rename from how-to/install/install-canonical-openstack-using-canonical-maas.rst rename to docs/how-to/install/install-canonical-openstack-using-canonical-maas.rst diff --git a/how-to/install/install-canonical-openstack-using-the-manual-bare-metal-provider.rst b/docs/how-to/install/install-canonical-openstack-using-the-manual-bare-metal-provider.rst similarity index 100% rename from how-to/install/install-canonical-openstack-using-the-manual-bare-metal-provider.rst rename to docs/how-to/install/install-canonical-openstack-using-the-manual-bare-metal-provider.rst diff --git a/how-to/misc/adding-amd-sev-enabled-compute-node.rst b/docs/how-to/misc/adding-amd-sev-enabled-compute-node.rst similarity index 100% rename from how-to/misc/adding-amd-sev-enabled-compute-node.rst rename to docs/how-to/misc/adding-amd-sev-enabled-compute-node.rst diff --git a/how-to/misc/backup-and-restore-maas-deployment.rst b/docs/how-to/misc/backup-and-restore-maas-deployment.rst similarity index 100% rename from how-to/misc/backup-and-restore-maas-deployment.rst rename to docs/how-to/misc/backup-and-restore-maas-deployment.rst diff --git a/how-to/misc/bootstrap-highly-available-juju-controller-on-top-of-a-lxd-cluster.rst b/docs/how-to/misc/bootstrap-highly-available-juju-controller-on-top-of-a-lxd-cluster.rst similarity index 100% rename from how-to/misc/bootstrap-highly-available-juju-controller-on-top-of-a-lxd-cluster.rst rename to docs/how-to/misc/bootstrap-highly-available-juju-controller-on-top-of-a-lxd-cluster.rst diff --git a/how-to/misc/configuring-dpdk.rst b/docs/how-to/misc/configuring-dpdk.rst similarity index 100% rename from how-to/misc/configuring-dpdk.rst rename to docs/how-to/misc/configuring-dpdk.rst diff --git a/how-to/misc/configuring-gpu-passthrough.rst b/docs/how-to/misc/configuring-gpu-passthrough.rst similarity index 89% rename from how-to/misc/configuring-gpu-passthrough.rst rename to docs/how-to/misc/configuring-gpu-passthrough.rst index 4d1d8b0..363a9a7 100644 --- a/how-to/misc/configuring-gpu-passthrough.rst +++ b/docs/how-to/misc/configuring-gpu-passthrough.rst @@ -26,21 +26,21 @@ Manual mode Canonical Openstack will determine if there are any GPU devices. `PCI device classes`_ of type Display Controller (0x03) and Processing Accelerators (0x1200) -are filtered as GPU devices. The devices are automatically added to `Nova PCI -whitelist`_ and no user intervention is required. +are filtered as GPU devices. The devices are automatically added to +`Nova PCI passthrough list`_ and no user intervention is required. Maas mode --------- Maas mode works similar to Manual mode and the detected GPU devices are added -to `Nova PCI whitelist`_ with no user intervention. +to `Nova PCI passthrough list`_ with no user intervention. Ensure that MAAS is configured to apply the necessary kernel parameters. Manifest configuration ---------------------- -Arbitrary PCI devices may be whitelisted through the Canonical Openstack manifest. +Arbitrary PCI devices may be allowed through the Canonical Openstack manifest. Example: @@ -66,7 +66,7 @@ Example: The device spec filters are highly flexible and can contain PCI address wildcards or PCI vendor/product IDs. See the `Nova device spec reference`_ for more details. -The device whitelist will be applied to all the compute nodes. If needed, use +The device list will be applied to all the compute nodes. If needed, use the exclusion list to define per-node lists of devices that should not be exposed to Openstack instances. @@ -119,7 +119,7 @@ Above example shows the passthrough device Nvidia 3D controller in the guest. .. Links -.. _Nova PCI whitelist: https://docs.openstack.org/nova/latest/admin/pci-passthrough.html +.. _Nova PCI passthrough list: https://docs.openstack.org/nova/latest/admin/pci-passthrough.html .. _Nova device spec reference: https://docs.openstack.org/nova/latest/configuration/config.html#pci.device_spec .. _PCI device aliases: https://docs.openstack.org/nova/latest/configuration/config.html#pci.alias .. _PCI device classes: https://admin.pci-ids.ucw.cz/read/PD/ diff --git a/how-to/misc/configuring-sriov.rst b/docs/how-to/misc/configuring-sriov.rst similarity index 97% rename from how-to/misc/configuring-sriov.rst rename to docs/how-to/misc/configuring-sriov.rst index 9e9438b..0a12297 100644 --- a/how-to/misc/configuring-sriov.rst +++ b/docs/how-to/misc/configuring-sriov.rst @@ -145,7 +145,7 @@ Example: Add network adapter to PCI whitelist? Intel Corporation Ethernet 10G 2P X520 Adapter (enp130s0f1) [y/n] (n): All the VFs that belong to the specified SR-IOV PFs will be added to the -`Nova PCI whitelist`_, in addition to the devices that may have been specified +`Nova PCI device list`_, in addition to the devices that may have been specified in the :ref:`manifest file`. The ``openstack-hypervisor`` snap determines if the specified adapters support @@ -185,7 +185,7 @@ following command: Manifest configuration ---------------------- -Arbitrary PCI devices may be whitelisted through the Canonical Openstack manifest. +Arbitrary PCI devices may be specified through the Canonical Openstack manifest. Apart from SR-IOV network adapters, this can also include vGPUs or FPGAs. Example: @@ -213,7 +213,7 @@ Example: The device spec filters are highly flexible and can contain PCI address wildcards or PCI vendor/product IDs. See the `Nova device spec reference`_ for more details. -The device whitelist will be applied to all the compute nodes. If needed, use +The PCI device specs will be applied to all the compute nodes. If needed, use the exclusion list to define per-node lists of devices that should not be exposed to Openstack instances. @@ -365,7 +365,7 @@ manually to avoid subsequent port binding failures. .. Links .. _representor functions: https://docs.kernel.org/networking/representors.html -.. _Nova PCI whitelist: https://docs.openstack.org/nova/latest/admin/pci-passthrough.html +.. _Nova PCI device list: https://docs.openstack.org/nova/latest/admin/pci-passthrough.html .. _Neutron SR-IOV agent: https://docs.openstack.org/neutron/latest/admin/config-sriov.html#enable-neutron-sriov-nic-agent-compute .. _Nova device spec reference: https://docs.openstack.org/nova/latest/configuration/config.html#pci.device_spec -.. _PCI device aliases: https://docs.openstack.org/nova/latest/configuration/config.html#pci.alias \ No newline at end of file +.. _PCI device aliases: https://docs.openstack.org/nova/latest/configuration/config.html#pci.alias diff --git a/how-to/misc/configuring-the-openstack-dashboard-theme.rst b/docs/how-to/misc/configuring-the-openstack-dashboard-theme.rst similarity index 100% rename from how-to/misc/configuring-the-openstack-dashboard-theme.rst rename to docs/how-to/misc/configuring-the-openstack-dashboard-theme.rst diff --git a/how-to/misc/configuring-vtpm.rst b/docs/how-to/misc/configuring-vtpm.rst similarity index 100% rename from how-to/misc/configuring-vtpm.rst rename to docs/how-to/misc/configuring-vtpm.rst diff --git a/how-to/misc/horizon-login.png b/docs/how-to/misc/horizon-login.png similarity index 100% rename from how-to/misc/horizon-login.png rename to docs/how-to/misc/horizon-login.png diff --git a/how-to/misc/horizon-overview.png b/docs/how-to/misc/horizon-overview.png similarity index 100% rename from how-to/misc/horizon-overview.png rename to docs/how-to/misc/horizon-overview.png diff --git a/how-to/misc/identity-provider-enablement.rst b/docs/how-to/misc/identity-provider-enablement.rst similarity index 100% rename from how-to/misc/identity-provider-enablement.rst rename to docs/how-to/misc/identity-provider-enablement.rst diff --git a/how-to/misc/index.rst b/docs/how-to/misc/index.rst similarity index 100% rename from how-to/misc/index.rst rename to docs/how-to/misc/index.rst diff --git a/how-to/misc/manage-a-proxied-environment.rst b/docs/how-to/misc/manage-a-proxied-environment.rst similarity index 100% rename from how-to/misc/manage-a-proxied-environment.rst rename to docs/how-to/misc/manage-a-proxied-environment.rst diff --git a/how-to/misc/manage-external-juju-controllers.rst b/docs/how-to/misc/manage-external-juju-controllers.rst similarity index 100% rename from how-to/misc/manage-external-juju-controllers.rst rename to docs/how-to/misc/manage-external-juju-controllers.rst diff --git a/how-to/misc/manage-workloads-with-juju.rst b/docs/how-to/misc/manage-workloads-with-juju.rst similarity index 100% rename from how-to/misc/manage-workloads-with-juju.rst rename to docs/how-to/misc/manage-workloads-with-juju.rst diff --git a/how-to/misc/managing-deployment-manifests.rst b/docs/how-to/misc/managing-deployment-manifests.rst similarity index 100% rename from how-to/misc/managing-deployment-manifests.rst rename to docs/how-to/misc/managing-deployment-manifests.rst diff --git a/how-to/misc/multiregion-deployments.rst b/docs/how-to/misc/multiregion-deployments.rst similarity index 100% rename from how-to/misc/multiregion-deployments.rst rename to docs/how-to/misc/multiregion-deployments.rst diff --git a/how-to/misc/reconfigure-k8s-api-endpoint-juju.rst b/docs/how-to/misc/reconfigure-k8s-api-endpoint-juju.rst similarity index 100% rename from how-to/misc/reconfigure-k8s-api-endpoint-juju.rst rename to docs/how-to/misc/reconfigure-k8s-api-endpoint-juju.rst diff --git a/how-to/misc/using-an-existing-juju-controller.rst b/docs/how-to/misc/using-an-existing-juju-controller.rst similarity index 100% rename from how-to/misc/using-an-existing-juju-controller.rst rename to docs/how-to/misc/using-an-existing-juju-controller.rst diff --git a/how-to/misc/using-the-epa-orchestrator.rst b/docs/how-to/misc/using-the-epa-orchestrator.rst similarity index 89% rename from how-to/misc/using-the-epa-orchestrator.rst rename to docs/how-to/misc/using-the-epa-orchestrator.rst index 5d14d98..2bf1f0f 100644 --- a/how-to/misc/using-the-epa-orchestrator.rst +++ b/docs/how-to/misc/using-the-epa-orchestrator.rst @@ -13,6 +13,6 @@ To use the EPA orchestrator, the host system must be preconfigured with the foll For MAAS deployments, configure these via the MAAS UI/CLI for each node. For detailed instructions on setting kernel boot parameters via the CLI, refer to the -`MAAS documentation on machine customization `_. +`MAAS documentation on machine customization `_. -For **single-node deployments**, configure these parameters manually on the node and reboot the machine. \ No newline at end of file +For **single-node deployments**, configure these parameters manually on the node and reboot the machine. diff --git a/how-to/misc/using-the-openstack-cli.rst b/docs/how-to/misc/using-the-openstack-cli.rst similarity index 96% rename from how-to/misc/using-the-openstack-cli.rst rename to docs/how-to/misc/using-the-openstack-cli.rst index 9fb0ee0..9d81d9c 100644 --- a/how-to/misc/using-the-openstack-cli.rst +++ b/docs/how-to/misc/using-the-openstack-cli.rst @@ -32,6 +32,3 @@ command. Here, the file ``admin-openrc`` is chosen as init file: sunbeam openrc > admin-openrc -.. raw:: html - - diff --git a/how-to/misc/using-the-openstack-dashboard.rst b/docs/how-to/misc/using-the-openstack-dashboard.rst similarity index 100% rename from how-to/misc/using-the-openstack-dashboard.rst rename to docs/how-to/misc/using-the-openstack-dashboard.rst diff --git a/how-to/operations/backup-and-restore.rst b/docs/how-to/operations/backup-and-restore.rst similarity index 100% rename from how-to/operations/backup-and-restore.rst rename to docs/how-to/operations/backup-and-restore.rst diff --git a/how-to/operations/cluster-upgrades.rst b/docs/how-to/operations/cluster-upgrades.rst similarity index 100% rename from how-to/operations/cluster-upgrades.rst rename to docs/how-to/operations/cluster-upgrades.rst diff --git a/how-to/operations/deploy-pure-storage-backend.rst b/docs/how-to/operations/deploy-pure-storage-backend.rst similarity index 100% rename from how-to/operations/deploy-pure-storage-backend.rst rename to docs/how-to/operations/deploy-pure-storage-backend.rst diff --git a/how-to/operations/enable-a-gated-storage-backend.rst b/docs/how-to/operations/enable-a-gated-storage-backend.rst similarity index 100% rename from how-to/operations/enable-a-gated-storage-backend.rst rename to docs/how-to/operations/enable-a-gated-storage-backend.rst diff --git a/how-to/operations/index.rst b/docs/how-to/operations/index.rst similarity index 100% rename from how-to/operations/index.rst rename to docs/how-to/operations/index.rst diff --git a/how-to/operations/live-migration.rst b/docs/how-to/operations/live-migration.rst similarity index 100% rename from how-to/operations/live-migration.rst rename to docs/how-to/operations/live-migration.rst diff --git a/how-to/operations/maintenance-mode.rst b/docs/how-to/operations/maintenance-mode.rst similarity index 100% rename from how-to/operations/maintenance-mode.rst rename to docs/how-to/operations/maintenance-mode.rst diff --git a/how-to/operations/manage-experimental-features.rst b/docs/how-to/operations/manage-experimental-features.rst similarity index 100% rename from how-to/operations/manage-experimental-features.rst rename to docs/how-to/operations/manage-experimental-features.rst diff --git a/how-to/operations/removing-the-primary-node.rst b/docs/how-to/operations/removing-the-primary-node.rst similarity index 100% rename from how-to/operations/removing-the-primary-node.rst rename to docs/how-to/operations/removing-the-primary-node.rst diff --git a/how-to/operations/scaling-the-cluster-in.rst b/docs/how-to/operations/scaling-the-cluster-in.rst similarity index 100% rename from how-to/operations/scaling-the-cluster-in.rst rename to docs/how-to/operations/scaling-the-cluster-in.rst diff --git a/how-to/operations/scaling-the-cluster-out.rst b/docs/how-to/operations/scaling-the-cluster-out.rst similarity index 100% rename from how-to/operations/scaling-the-cluster-out.rst rename to docs/how-to/operations/scaling-the-cluster-out.rst diff --git a/how-to/troubleshooting/index.rst b/docs/how-to/troubleshooting/index.rst similarity index 100% rename from how-to/troubleshooting/index.rst rename to docs/how-to/troubleshooting/index.rst diff --git a/how-to/troubleshooting/inspecting-the-cluster.rst b/docs/how-to/troubleshooting/inspecting-the-cluster.rst similarity index 100% rename from how-to/troubleshooting/inspecting-the-cluster.rst rename to docs/how-to/troubleshooting/inspecting-the-cluster.rst diff --git a/index.rst b/docs/index.rst similarity index 74% rename from index.rst rename to docs/index.rst index 65035a1..552052e 100644 --- a/index.rst +++ b/docs/index.rst @@ -26,32 +26,41 @@ experience. --------- -.. rubric:: :h2:`In this documentation` +In this documentation +--------------------- -.. grid:: 1 1 2 2 +.. grid:: 1 1 2 2 - .. grid-item:: :doc:`Tutorials ` + .. grid-item-card:: Get started + :link: /tutorial/index + :link-type: doc - **Start here**: a hands-on introduction to Canonical OpenStack for new users + A hands-on introduction to Canonical OpenStack for new users. - .. grid-item:: :doc:`How-to guides ` + .. grid-item-card:: How-to guides + :link: /how-to/index + :link-type: doc - **Step-by-step guides** covering key operations and common tasks + **Step-by-step guides** - learn key operations and customization. .. grid:: 1 1 2 2 - :reverse: - .. grid-item:: :doc:`Reference ` + .. grid-item-card:: Reference + :link: /reference/index + :link-type: doc - **Technical information** - specifications, APIs, architecture + **Technical information** - review the specifications, architecture and more. - .. grid-item:: :doc:`Explanation ` + .. grid-item-card:: Explanation + :link: /explanation/index + :link-type: doc - **Discussion and clarification** of key topics + **Concepts** - understand the key topics and design of Canonical OpenStack. --------- -.. rubric:: :h2:`Community and commercial usage` +Community and commercial usage +------------------------------ Canonical OpenStack is based on Sunbeam - an open source project that warmly welcomes a free-of-charge usage, constructive feedback, community discussions diff --git a/docs/redirects.txt b/docs/redirects.txt new file mode 100644 index 0000000..e4e5e8b --- /dev/null +++ b/docs/redirects.txt @@ -0,0 +1,8 @@ +# Client-side page redirects. Each mapping takes the format: +# +# "" "" +# +# Paths must be represented as source files relative to the root of the docs directory. +# The old path must be a file that doesn't exist in the source. The current path must be +# a file that does exist in the source. Redirecting to a specific section is not supported. + diff --git a/reference/_include/manifest-file-reference.yaml b/docs/reference/_include/manifest-file-reference.yaml similarity index 100% rename from reference/_include/manifest-file-reference.yaml rename to docs/reference/_include/manifest-file-reference.yaml diff --git a/reference/api-auditing.rst b/docs/reference/api-auditing.rst similarity index 100% rename from reference/api-auditing.rst rename to docs/reference/api-auditing.rst diff --git a/reference/enterprise-requirements.rst b/docs/reference/enterprise-requirements.rst similarity index 100% rename from reference/enterprise-requirements.rst rename to docs/reference/enterprise-requirements.rst diff --git a/reference/example-physical-configuration.rst b/docs/reference/example-physical-configuration.rst similarity index 100% rename from reference/example-physical-configuration.rst rename to docs/reference/example-physical-configuration.rst diff --git a/reference/images/canonical-openstack-based-on-openstack-charms-release-cycle.png b/docs/reference/images/canonical-openstack-based-on-openstack-charms-release-cycle.png similarity index 100% rename from reference/images/canonical-openstack-based-on-openstack-charms-release-cycle.png rename to docs/reference/images/canonical-openstack-based-on-openstack-charms-release-cycle.png diff --git a/reference/images/canonical-openstack-based-on-sunbeam-release-cycle.png b/docs/reference/images/canonical-openstack-based-on-sunbeam-release-cycle.png similarity index 100% rename from reference/images/canonical-openstack-based-on-sunbeam-release-cycle.png rename to docs/reference/images/canonical-openstack-based-on-sunbeam-release-cycle.png diff --git a/reference/images/example-physical-configuration-layout.png b/docs/reference/images/example-physical-configuration-layout.png similarity index 100% rename from reference/images/example-physical-configuration-layout.png rename to docs/reference/images/example-physical-configuration-layout.png diff --git a/reference/images/openstack-packages-release-cycle.png b/docs/reference/images/openstack-packages-release-cycle.png similarity index 100% rename from reference/images/openstack-packages-release-cycle.png rename to docs/reference/images/openstack-packages-release-cycle.png diff --git a/reference/index.rst b/docs/reference/index.rst similarity index 95% rename from reference/index.rst rename to docs/reference/index.rst index bbd7618..437b6f9 100644 --- a/reference/index.rst +++ b/docs/reference/index.rst @@ -1,3 +1,5 @@ +.. _reference: + Reference ========= diff --git a/reference/interactive-configuration-prompts.rst b/docs/reference/interactive-configuration-prompts.rst similarity index 100% rename from reference/interactive-configuration-prompts.rst rename to docs/reference/interactive-configuration-prompts.rst diff --git a/reference/known-limitations.rst b/docs/reference/known-limitations.rst similarity index 100% rename from reference/known-limitations.rst rename to docs/reference/known-limitations.rst diff --git a/reference/manifest-file-reference.rst b/docs/reference/manifest-file-reference.rst similarity index 100% rename from reference/manifest-file-reference.rst rename to docs/reference/manifest-file-reference.rst diff --git a/reference/network-debugging.rst b/docs/reference/network-debugging.rst similarity index 98% rename from reference/network-debugging.rst rename to docs/reference/network-debugging.rst index b65a625..30b0760 100644 --- a/reference/network-debugging.rst +++ b/docs/reference/network-debugging.rst @@ -19,15 +19,8 @@ Contents: - `Resolving OpenFlow port numbers <#heading--resolving-openflow-port-numbers>`__ -.. raw:: html - -

- Accessing OVN databases - -.. raw:: html - -

+----------------------- There are four containers in each :code:`ovn-chassis` pod: @@ -66,15 +59,9 @@ Set up aliases: bash alias ovn-sbctl='ovn-sbctl --db=ssl:127.0.0.1:6642 -c /etc/ovn/cert_host -p /etc/ovn/key_host -C /etc/ovn/ovn-central.crt' -.. raw:: html - -

Querying OVN databases - -.. raw:: html - -

+---------------------- Assuming that all the defaults for a single-node install were used and ``sunbeam launch`` was used to create a guest, then there will be a @@ -233,15 +220,8 @@ The flows can also be listed: ovn-sbctl lflow-list ... -.. raw:: html - -

- Capturing and tracing an ingress packet - -.. raw:: html - -

+--------------------------------------- The example below captures and then traces an ICMP echo request packet destined for a guest. The first step is to capture an echo request @@ -442,15 +422,8 @@ This time the trace command ends with: 44. ip,reg0=0x200/0x200,reg15=0x3,metadata=0x2, priority 2001, cookie 0x5eeee244 drop -.. raw:: html - -

- Resolving OpenFlow port numbers - -.. raw:: html - -

+------------------------------- When looking at OpenFlow rules or tracing a packet, the ports are given numbers. These are the OpenFlow port numbers. For example, to find what diff --git a/reference/proxy-acl-access.rst b/docs/reference/proxy-acl-access.rst similarity index 100% rename from reference/proxy-acl-access.rst rename to docs/reference/proxy-acl-access.rst diff --git a/reference/release-cycle-and-supported-versions.rst b/docs/reference/release-cycle-and-supported-versions.rst similarity index 100% rename from reference/release-cycle-and-supported-versions.rst rename to docs/reference/release-cycle-and-supported-versions.rst diff --git a/reference/underlying-projects-and-charms.rst b/docs/reference/underlying-projects-and-charms.rst similarity index 100% rename from reference/underlying-projects-and-charms.rst rename to docs/reference/underlying-projects-and-charms.rst diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..c8c0535 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,34 @@ +# Canonical theme (still needed for Furo theme and custom templates) +canonical-sphinx~=0.6 + +# Extensions previously auto-loaded by canonical-sphinx +myst-parser~=4.0 # v5.0.0 causes version conflicts +sphinx-autobuild +sphinx-design==0.6.1 +sphinx-notfound-page~=1.1 +sphinx-reredirects==0.1.6 +sphinx-tabs~=3.5 +sphinxcontrib-jquery~=4.1 +sphinxext-opengraph~=0.13 +sphinx-rerediraffe>=0.0.3, <1.0.0 + +# Extra extensions, previously bundled as canonical-sphinx-extensions +sphinx-config-options~=0.1 +sphinx-contributor-listing~=0.1 +sphinx-filtered-toctree~=0.1 +sphinx-related-links~=0.1 +sphinx-roles~=0.1 +sphinx-terminal~=1.0 +sphinx-ubuntu-images~=0.1 +sphinx-youtube-links~=0.1 + +# Other dependencies +packaging~=26.1 +sphinxcontrib-svg2pdfconverter[CairoSVG]~=2.1 +sphinx-last-updated-by-git~=0.3 +sphinx-sitemap~=2.9 +sphinx-llm~=0.4 + +# Vale dependencies +rst2html +vale~=3.13 diff --git a/reuse/links.txt b/docs/reuse/links.txt similarity index 100% rename from reuse/links.txt rename to docs/reuse/links.txt diff --git a/tutorial/explore-full-potential-of-openstack.rst b/docs/tutorial/explore-full-potential-of-openstack.rst similarity index 100% rename from tutorial/explore-full-potential-of-openstack.rst rename to docs/tutorial/explore-full-potential-of-openstack.rst diff --git a/tutorial/get-familiar-with-openstack.rst b/docs/tutorial/get-familiar-with-openstack.rst similarity index 99% rename from tutorial/get-familiar-with-openstack.rst rename to docs/tutorial/get-familiar-with-openstack.rst index a34275b..8ac805a 100644 --- a/tutorial/get-familiar-with-openstack.rst +++ b/docs/tutorial/get-familiar-with-openstack.rst @@ -443,12 +443,10 @@ Once this command finishes, you should be able to see the following message on t Please check minimum hardware requirements for support: - https://microstack.run/docs/enterprise-reqs + https://canonical-openstack.readthedocs-hosted.com/en/latest/reference/enterprise-requirements Ubuntu Pro enabled. -.. TODO:: Update the link to the enterprise requirements page - Depending on the subscription type, your machine is now eligible for certain Ubuntu Pro services: .. code-block :: text diff --git a/tutorial/get-started-with-openstack.rst b/docs/tutorial/get-started-with-openstack.rst similarity index 100% rename from tutorial/get-started-with-openstack.rst rename to docs/tutorial/get-started-with-openstack.rst diff --git a/tutorial/images/explore-full-potential-of-openstack-01.png b/docs/tutorial/images/explore-full-potential-of-openstack-01.png similarity index 100% rename from tutorial/images/explore-full-potential-of-openstack-01.png rename to docs/tutorial/images/explore-full-potential-of-openstack-01.png diff --git a/tutorial/images/explore-full-potential-of-openstack-02.png b/docs/tutorial/images/explore-full-potential-of-openstack-02.png similarity index 100% rename from tutorial/images/explore-full-potential-of-openstack-02.png rename to docs/tutorial/images/explore-full-potential-of-openstack-02.png diff --git a/tutorial/images/get-familiar-with-openstack-01.png b/docs/tutorial/images/get-familiar-with-openstack-01.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-01.png rename to docs/tutorial/images/get-familiar-with-openstack-01.png diff --git a/tutorial/images/get-familiar-with-openstack-02.png b/docs/tutorial/images/get-familiar-with-openstack-02.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-02.png rename to docs/tutorial/images/get-familiar-with-openstack-02.png diff --git a/tutorial/images/get-familiar-with-openstack-03.png b/docs/tutorial/images/get-familiar-with-openstack-03.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-03.png rename to docs/tutorial/images/get-familiar-with-openstack-03.png diff --git a/tutorial/images/get-familiar-with-openstack-04.png b/docs/tutorial/images/get-familiar-with-openstack-04.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-04.png rename to docs/tutorial/images/get-familiar-with-openstack-04.png diff --git a/tutorial/images/get-familiar-with-openstack-05.png b/docs/tutorial/images/get-familiar-with-openstack-05.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-05.png rename to docs/tutorial/images/get-familiar-with-openstack-05.png diff --git a/tutorial/images/get-familiar-with-openstack-06.png b/docs/tutorial/images/get-familiar-with-openstack-06.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-06.png rename to docs/tutorial/images/get-familiar-with-openstack-06.png diff --git a/tutorial/images/get-familiar-with-openstack-07.png b/docs/tutorial/images/get-familiar-with-openstack-07.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-07.png rename to docs/tutorial/images/get-familiar-with-openstack-07.png diff --git a/tutorial/images/get-familiar-with-openstack-08.png b/docs/tutorial/images/get-familiar-with-openstack-08.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-08.png rename to docs/tutorial/images/get-familiar-with-openstack-08.png diff --git a/tutorial/images/get-familiar-with-openstack-09.png b/docs/tutorial/images/get-familiar-with-openstack-09.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-09.png rename to docs/tutorial/images/get-familiar-with-openstack-09.png diff --git a/tutorial/images/get-familiar-with-openstack-10.png b/docs/tutorial/images/get-familiar-with-openstack-10.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-10.png rename to docs/tutorial/images/get-familiar-with-openstack-10.png diff --git a/tutorial/images/get-familiar-with-openstack-11.png b/docs/tutorial/images/get-familiar-with-openstack-11.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-11.png rename to docs/tutorial/images/get-familiar-with-openstack-11.png diff --git a/tutorial/images/get-familiar-with-openstack-12.png b/docs/tutorial/images/get-familiar-with-openstack-12.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-12.png rename to docs/tutorial/images/get-familiar-with-openstack-12.png diff --git a/tutorial/images/get-familiar-with-openstack-13.png b/docs/tutorial/images/get-familiar-with-openstack-13.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-13.png rename to docs/tutorial/images/get-familiar-with-openstack-13.png diff --git a/tutorial/images/get-familiar-with-openstack-14.png b/docs/tutorial/images/get-familiar-with-openstack-14.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-14.png rename to docs/tutorial/images/get-familiar-with-openstack-14.png diff --git a/tutorial/images/get-familiar-with-openstack-15.png b/docs/tutorial/images/get-familiar-with-openstack-15.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-15.png rename to docs/tutorial/images/get-familiar-with-openstack-15.png diff --git a/tutorial/images/get-familiar-with-openstack-16.png b/docs/tutorial/images/get-familiar-with-openstack-16.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-16.png rename to docs/tutorial/images/get-familiar-with-openstack-16.png diff --git a/tutorial/images/get-familiar-with-openstack-17.png b/docs/tutorial/images/get-familiar-with-openstack-17.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-17.png rename to docs/tutorial/images/get-familiar-with-openstack-17.png diff --git a/tutorial/images/get-familiar-with-openstack-18.png b/docs/tutorial/images/get-familiar-with-openstack-18.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-18.png rename to docs/tutorial/images/get-familiar-with-openstack-18.png diff --git a/tutorial/images/get-familiar-with-openstack-19.png b/docs/tutorial/images/get-familiar-with-openstack-19.png similarity index 100% rename from tutorial/images/get-familiar-with-openstack-19.png rename to docs/tutorial/images/get-familiar-with-openstack-19.png diff --git a/tutorial/images/on-board-your-users-01.png b/docs/tutorial/images/on-board-your-users-01.png similarity index 100% rename from tutorial/images/on-board-your-users-01.png rename to docs/tutorial/images/on-board-your-users-01.png diff --git a/tutorial/images/on-board-your-users-02.png b/docs/tutorial/images/on-board-your-users-02.png similarity index 100% rename from tutorial/images/on-board-your-users-02.png rename to docs/tutorial/images/on-board-your-users-02.png diff --git a/tutorial/images/on-board-your-users-03.png b/docs/tutorial/images/on-board-your-users-03.png similarity index 100% rename from tutorial/images/on-board-your-users-03.png rename to docs/tutorial/images/on-board-your-users-03.png diff --git a/tutorial/images/on-board-your-users-04.png b/docs/tutorial/images/on-board-your-users-04.png similarity index 100% rename from tutorial/images/on-board-your-users-04.png rename to docs/tutorial/images/on-board-your-users-04.png diff --git a/tutorial/images/on-board-your-users-05.png b/docs/tutorial/images/on-board-your-users-05.png similarity index 100% rename from tutorial/images/on-board-your-users-05.png rename to docs/tutorial/images/on-board-your-users-05.png diff --git a/tutorial/images/on-board-your-users-06.png b/docs/tutorial/images/on-board-your-users-06.png similarity index 100% rename from tutorial/images/on-board-your-users-06.png rename to docs/tutorial/images/on-board-your-users-06.png diff --git a/tutorial/index.rst b/docs/tutorial/index.rst similarity index 97% rename from tutorial/index.rst rename to docs/tutorial/index.rst index bad3d92..9a1d198 100644 --- a/tutorial/index.rst +++ b/docs/tutorial/index.rst @@ -1,3 +1,5 @@ +.. _tutorial: + Tutorials ========= diff --git a/tutorial/on-board-your-users.rst b/docs/tutorial/on-board-your-users.rst similarity index 100% rename from tutorial/on-board-your-users.rst rename to docs/tutorial/on-board-your-users.rst diff --git a/init.sh b/init.sh deleted file mode 100755 index 976c75d..0000000 --- a/init.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -# Generate a unique directory name based on timestamp -timestamp=$(date +%Y%m%d%H%M%S) -temp_directory="temp-starter-pack-$timestamp" - -# Ask the user for the installation directory -read -p "Enter the installation directory (e.g., '.' or 'docs'): " install_directory - -# Clone the starter pack repository to the temporary directory -echo "Cloning the starter pack repository..." -git clone --depth 1 https://github.com/canonical/sphinx-docs-starter-pack "$temp_directory" -rm -rf "$temp_directory/.git" - -# Update file contents for the install directory -echo "Removing internal workflow files..." -rm -f $temp_directory/.github/workflows/sphinx-python-dependency-build-checks.yml -echo "Updating working directory in workflow files..." -sed -i "s|working-directory:\s*'\.'|working-directory: '$install_directory'|g" "$temp_directory/.github/workflows"/* -echo "Updating .readthedocs.yaml configuration..." -sed -i "s|-\s\s*python3\s\s*.sphinx/build_requirements\.py|- cd '$install_directory' \&\& python3 .sphinx/build_requirements.py|g" "$temp_directory/.readthedocs.yaml" -sed -i "s|configuration:\s*conf\.py|configuration: $install_directory/conf.py|g" "$temp_directory/.readthedocs.yaml" -sed -i "s|requirements:\s*\.sphinx/requirements\.txt|requirements: $install_directory/.sphinx/requirements.txt|g" "$temp_directory/.readthedocs.yaml" - -# Create the specified installation directory if it doesn't exist -if [ ! -d "$install_directory" ]; then - echo "Creating the installation directory: $install_directory" - mkdir -p "$install_directory" -fi - -# Copy the contents of the starter pack repository to the installation directory -echo "Copying contents to the installation directory..." -cp -R "$temp_directory"/* "$temp_directory"/.??* "$install_directory" - -# Move workflow files and configuration -if [ "$install_directory" != "." ]; then - echo "Moving workflow files and configuration..." - if [ ! -d .github/workflows ]; then - mkdir -p .github/workflows - fi - mv "$install_directory/.github/workflows"/* .github/workflows - rmdir -p --ignore-fail-on-non-empty "$install_directory/.github/workflows" - if [ ! -f .wokeignore ]; then - ln -s "$install_directory/.wokeignore" - else - echo "ACTION REQUIRED: Found a .wokeignore file in the root directory. Include the contents from $install_directory/.wokeignore in this file!" - fi -fi - -# Clean up -echo "Cleaning up..." -rm -rf "$temp_directory" - -echo "Setup completed!" diff --git a/make.bat b/make.bat deleted file mode 100644 index 32bb245..0000000 --- a/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd