diff --git a/.custom_wordlist.txt b/.custom_wordlist.txt index a8e16c9..04651b2 100644 --- a/.custom_wordlist.txt +++ b/.custom_wordlist.txt @@ -14,6 +14,7 @@ backend backends balancer balancers +Canonical's Charmcraft Charmhub CIdP @@ -135,6 +136,7 @@ SHA SSL stateful stdin +stdout subcommand subdirectories subnet @@ -174,4 +176,5 @@ wordlist xetex xindy yaml -YAML \ No newline at end of file +YAML +Makefiles diff --git a/.github/workflows/automatic-doc-checks.yml b/.github/workflows/automatic-doc-checks.yml deleted file mode 100644 index 609a552..0000000 --- a/.github/workflows/automatic-doc-checks.yml +++ /dev/null @@ -1,20 +0,0 @@ -# -name: Automatic doc checks - -on: - pull_request: - - 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: "." - fetch-depth: 0 diff --git a/.sphinx/get_vale_conf.py b/.sphinx/get_vale_conf.py index e2a81c0..13e7966 100644 --- a/.sphinx/get_vale_conf.py +++ b/.sphinx/get_vale_conf.py @@ -31,12 +31,12 @@ 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 """ @@ -52,8 +52,8 @@ def clone_repo_and_copy_paths(file_source_dest, overwrite=False): try: result = subprocess.run( - clone_cmd, - capture_output=True, + clone_cmd, + capture_output=True, text=True, check=True ) @@ -73,7 +73,7 @@ def clone_repo_and_copy_paths(file_source_dest, overwrite=False): continue if not copy_files_to_path(source_path, dest, overwrite): - is_copy_success = False + is_copy_success = False logging.error("Failed to copy %s to %s", source_path, dest) # Clean up temporary directory @@ -85,12 +85,12 @@ def clone_repo_and_copy_paths(file_source_dest, overwrite=False): 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 """ @@ -138,7 +138,7 @@ def main(): # Parse command line arguments, default to overwrite_enabled = True overwrite_enabled = not parse_arguments().no_overwrite - # Download into /tmp through git clone + # 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 diff --git a/.sphinx/metrics/build_metrics.py b/.sphinx/metrics/build_metrics.py new file mode 100755 index 0000000..529fb85 --- /dev/null +++ b/.sphinx/metrics/build_metrics.py @@ -0,0 +1,94 @@ +#!/usr/bin/python3 + +import sys +import argparse +from pathlib import Path +from html.parser import HTMLParser +from urllib.parse import urlsplit + + +class MetricsParser(HTMLParser): + def __init__(self): + super().__init__() + self.int_link_count = 0 + self.ext_link_count = 0 + self.fragment_count = 0 + self.image_count = 0 + self.in_object = 0 + + @property + def link_count(self): + return self.fragment_count + self.int_link_count + self.ext_link_count + + def read(self, file): + """ + Read *file* (a file-like object with a ``read`` method returning + strings) a chunk at a time, feeding each chunk to the parser. + """ + # Ensure the parser state is reset before each file (just in case + # there's an erroneous dangling ) + self.reset() + self.in_object = 0 + buf = '' + while True: + # Parse 1MB chunks at a time + buf = file.read(1024**2) + if not buf: + break + self.feed(buf) + + def handle_starttag(self, tag, attrs): + """ + Count , , and tags to determine the number of internal + and external links, and the number of images. + """ + attrs = dict(attrs) + if tag == 'a' and 'href' in attrs: + # If there's no href, it's an anchor; if there's no hostname + # (netloc) or path, it's just a fragment link within the page + url = urlsplit(attrs['href']) + if url.netloc: + self.ext_link_count += 1 + elif url.path: + self.int_link_count += 1 + else: + self.fragment_count += 1 + elif tag == 'object': + # tags are a bit complex as they nest to offer fallbacks + # and may contain an fallback. We only want to count the + # outer-most in this case + if self.in_object == 0: + self.image_count += 1 + self.in_object += 1 + elif tag == 'img' and self.in_object == 0: + self.image_count += 1 + + def handle_endtag(self, tag): + if tag == 'object': + # Never let in_object be negative + self.in_object = max(0, self.in_object - 1) + + +def main(args=None): + parser = argparse.ArgumentParser() + parser.add_argument( + 'build_dir', metavar='build-dir', nargs='?', default='.', + help="The directory to scan for HTML files") + config = parser.parse_args(args) + + parser = MetricsParser() + for path in Path(config.build_dir).rglob('*.html'): + with path.open('r', encoding='utf-8', errors='replace') as f: + parser.read(f) + + print('Summarising metrics for build files (.html)...') + print(f'\tlinks: {parser.link_count} (' + f'{parser.fragment_count} #frag…, ' + f'{parser.int_link_count} /int…, ' + f'{parser.ext_link_count} https://ext…' + ')') + print(f'\timages: {parser.image_count}') + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/.sphinx/metrics/source_metrics.sh b/.sphinx/metrics/source_metrics.sh new file mode 100755 index 0000000..07147d6 --- /dev/null +++ b/.sphinx/metrics/source_metrics.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# shellcheck disable=all + +VENV=".sphinx/venv/bin/activate" + +files=0 +words=0 +readabilityWords=0 +readabilitySentences=0 +readabilitySyllables=0 +readabilityAverage=0 +readable=true + +# measure number of files (.rst and .md), excluding those in .sphinx dir +files=$(find . -type d -path './.sphinx' -prune -o -type f \( -name '*.md' -o -name '*.rst' \) -print | wc -l) + +# calculate metrics only if source files are present +if [ "$files" -eq 0 ]; then + echo "There are no source files to calculate metrics" +else + # measure raw total number of words, excluding those in .sphinx dir + words=$(find . -type d -path './.sphinx' -prune -o \( -name '*.md' -o -name '*.rst' \) -exec cat {} + | wc -w) + + # calculate readability for markdown source files + echo "Activating virtual environment to run vale..." + source "${VENV}" + + for file in *.md *.rst; do + if [ -f "$file" ]; then + readabilityWords=$(vale ls-metrics "$file" | grep '"words"' | sed 's/[^0-9]*//g') + readabilitySentences=$(vale ls-metrics "$file" | grep '"sentences"' | sed 's/[^0-9]*//g') + readabilitySyllables=$(vale ls-metrics "$file" | grep '"syllables"' | sed 's/[^0-9]*//g') + fi + done + + echo "Deactivating virtual environment..." + deactivate + + # calculate mean number of words + if [ "$files" -ge 1 ]; then + meanval=$((readabilityWords / files)) + else + meanval=$readabilityWords + fi + + readabilityAverage=$(echo "scale=2; 0.39 * ($readabilityWords / $readabilitySentences) + (11.8 * ($readabilitySyllables / $readabilityWords)) - 15.59" | bc) + + # cast average to int for comparison + readabilityAverageInt=$(echo "$readabilityAverage / 1" | bc) + + # value below 8 is considered readable + if [ "$readabilityAverageInt" -lt 8 ]; then + readable=true + else + readable=false + fi + + # summarise latest metrics + echo "Summarising metrics for source files (.md, .rst)..." + echo -e "\ttotal files: $files" + echo -e "\ttotal words (raw): $words" + echo -e "\ttotal words (prose): $readabilityWords" + echo -e "\taverage word count: $meanval" + echo -e "\treadability: $readabilityAverage" + echo -e "\treadable: $readable" +fi diff --git a/.sphinx/update_sp.py b/.sphinx/update_sp.py index 1d6afd5..576cfcd 100755 --- a/.sphinx/update_sp.py +++ b/.sphinx/update_sp.py @@ -18,7 +18,9 @@ from requests.exceptions import RequestException from packaging.version import parse as parse_version -SPHINX_DIR = os.path.join(os.getcwd(), ".sphinx") +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-docs-starter-pack" GITHUB_API_BASE = f"https://api.github.com/repos/{GITHUB_REPO}" @@ -103,7 +105,7 @@ def main(): # Check requirements are the same new_requirements = [] try: - with open("requirements.txt", "r") as file: + with open(REQUIREMENTS, "r") as file: logging.debug("Checking requirements") local_reqs = set(file.read().splitlines()) - {""} @@ -206,7 +208,7 @@ def update_static_files(): # Writes return value for parent function if new_file_list != []: # Provides more information on new files - with open("NEWFILES.txt", "w") as f: + 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") diff --git a/.sphinx/version b/.sphinx/version index 26aaba0..f0bb29e 100644 --- a/.sphinx/version +++ b/.sphinx/version @@ -1 +1 @@ -1.2.0 +1.3.0 diff --git a/Makefile b/Makefile index 9640e5e..de174a9 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,12 @@ VENVDIR = $(SPHINXDIR)/venv PA11Y = $(SPHINXDIR)/node_modules/pa11y/bin/pa11y.js --config $(SPHINXDIR)/pa11y.json VENV = $(VENVDIR)/bin/activate TARGET = * -ALLFILES = *.rst **/*.rst METRICSDIR = $(SOURCEDIR)/.sphinx/metrics 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 CONFIRM_SUDO ?= N VALE_CONFIG = $(SPHINXDIR)/vale.ini +VALEDIR = $(SPHINXDIR)/venv/lib/python*/site-packages/vale +VOCAB_CANONICAL = $(SPHINXDIR)/styles/config/vocabularies/Canonical SPHINX_HOST ?= 127.0.0.1 SPHINX_PORT ?= 8000 @@ -78,21 +79,17 @@ pymarkdownlnt-install: install: $(VENVDIR) run: install - . $(VENV); $(VENVDIR)/bin/sphinx-autobuild -b dirhtml --host $(SPHINX_HOST) --port $(SPHINX_PORT) \ - --ignore "$(VENVDIR)/**" \ - --ignore "$(SPHINXDIR)/**" \ - --ignore "$(BUILDDIR)/**" \ - "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) + . $(VENV); $(VENVDIR)/bin/sphinx-autobuild -b dirhtml --host $(SPHINX_HOST) --port $(SPHINX_PORT) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) # Does not depend on $(BUILDDIR) to rebuild properly at every run. html: install - . $(VENV); $(SPHINXBUILD) -W --keep-going -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) + . $(VENV); $(SPHINXBUILD) --fail-on-warning --keep-going -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) epub: install . $(VENV); $(SPHINXBUILD) -b epub "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) serve: html - cd "$(BUILDDIR)"; python3 -m http.server --bind 127.0.0.1 8000 + cd "$(BUILDDIR)"; python3 -m http.server --bind $(SPHINX_HOST) $(SPHINX_PORT) clean: clean-doc @test ! -e "$(VENVDIR)" -o -d "$(VENVDIR)" -a "$(abspath $(VENVDIR))" != "$(VENVDIR)" @@ -116,33 +113,32 @@ lint-md: pymarkdownlnt-install @. $(VENV); pymarkdownlnt --config $(SPHINXDIR)/.pymarkdown.json scan --recurse --exclude=./$(SPHINXDIR)/** $(SOURCEDIR) vale-install: install - @. $(VENV); test -d $(SPHINXDIR)/venv/lib/python*/site-packages/vale || pip install rst2html vale @. $(VENV); test -f $(VALE_CONFIG) || python3 $(SPHINXDIR)/get_vale_conf.py @echo '.Name=="Canonical.400-Enforce-inclusive-terms"' > $(SPHINXDIR)/styles/woke.filter @echo '.Level=="error" and .Name!="Canonical.500-Repeated-words" and .Name!="Canonical.000-US-spellcheck"' > $(SPHINXDIR)/styles/error.filter @echo '.Name=="Canonical.000-US-spellcheck"' > $(SPHINXDIR)/styles/spelling.filter - @. $(VENV); find $(SPHINXDIR)/venv/lib/python*/site-packages/vale/vale_bin -size 195c -exec vale --version \; + @. $(VENV); find $(VALEDIR)/vale_bin -size 195c -exec vale --version \; woke: vale-install - @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt - @cat $(SOURCEDIR)/.custom_wordlist.txt >> $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt + @cat $(VOCAB_CANONICAL)/accept.txt > $(VOCAB_CANONICAL)/accept_backup.txt + @cat $(SOURCEDIR)/.custom_wordlist.txt >> $(VOCAB_CANONICAL)/accept.txt @echo "Running Vale acceptable term check against $(TARGET). To change target set TARGET= with make command" @. $(VENV); vale --config="$(VALE_CONFIG)" --filter='$(SPHINXDIR)/styles/woke.filter' --glob='*.{md,rst}' $(TARGET) - @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 + @cat $(VOCAB_CANONICAL)/accept_backup.txt > $(VOCAB_CANONICAL)/accept.txt && rm $(VOCAB_CANONICAL)/accept_backup.txt vale: vale-install - @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt - @cat $(SOURCEDIR)/.custom_wordlist.txt >> $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt + @cat $(VOCAB_CANONICAL)/accept.txt > $(VOCAB_CANONICAL)/accept_backup.txt + @cat $(SOURCEDIR)/.custom_wordlist.txt >> $(VOCAB_CANONICAL)/accept.txt @echo "Running Vale against $(TARGET). To change target set TARGET= with make command" @. $(VENV); vale --config="$(VALE_CONFIG)" --filter='$(SPHINXDIR)/styles/error.filter' --glob='*.{md,rst}' $(TARGET) - @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 + @cat $(VOCAB_CANONICAL)/accept_backup.txt > $(VOCAB_CANONICAL)/accept.txt && rm $(VOCAB_CANONICAL)/accept_backup.txt spelling: vale-install - @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt - @cat $(SOURCEDIR)/.custom_wordlist.txt >> $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt + @cat $(VOCAB_CANONICAL)/accept.txt > $(VOCAB_CANONICAL)/accept_backup.txt + @cat $(SOURCEDIR)/.custom_wordlist.txt >> $(VOCAB_CANONICAL)/accept.txt @echo "Running Vale against $(TARGET). To change target set TARGET= with make command" @. $(VENV); vale --config="$(VALE_CONFIG)" --filter='$(SPHINXDIR)/styles/spelling.filter' --glob='*.{md,rst}' $(TARGET) - @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 + @cat $(VOCAB_CANONICAL)/accept_backup.txt > $(VOCAB_CANONICAL)/accept.txt && rm $(VOCAB_CANONICAL)/accept_backup.txt spellcheck: spelling @echo "Please note that the \`make spellcheck\` command is being deprecated in favor of \`make spelling\`" @@ -173,11 +169,11 @@ allmetrics: html @echo "Recording documentation metrics..." @echo "Checking for existence of vale..." . $(VENV) - @. $(VENV); test -d $(SPHINXDIR)/venv/lib/python*/site-packages/vale || pip install vale + @. $(VENV); test -d $(VALEDIR) || pip install vale @. $(VENV); test -f $(VALE_CONFIG) || python3 $(SPHINXDIR)/get_vale_conf.py - @. $(VENV); find $(SPHINXDIR)/venv/lib/python*/site-packages/vale/vale_bin -size 195c -exec vale --config "$(VALE_CONFIG)" $(TARGET) > /dev/null \; + @. $(VENV); find $(VALEDIR)/vale_bin -size 195c -exec vale --config "$(VALE_CONFIG)" $(TARGET) > /dev/null \; @eval '$(METRICSDIR)/source_metrics.sh $(PWD)' - @$(METRICSDIR)/build_metrics.py $(BUILDDIR) + @. $(VENV); python3 $(METRICSDIR)/build_metrics.py $(BUILDDIR) update: install @. $(VENV); .sphinx/update_sp.py @@ -185,5 +181,5 @@ update: install # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: - $(MAKE) —no-print-directory install + $(MAKE) --no-print-directory install . $(VENV); $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/conf.py b/conf.py index 6c07269..5f3053b 100644 --- a/conf.py +++ b/conf.py @@ -1,5 +1,4 @@ import datetime -import ast import os import yaml @@ -29,7 +28,6 @@ author = 'Canonical Group Ltd' - # Sidebar documentation title; best kept reasonably short # # TODO: To include a version number, add it here (hardcoded or automated). @@ -144,11 +142,6 @@ slug = 'jaas' -# Template and asset locations - -html_static_path = [".sphinx/_static"] -templates_path = [".sphinx/_templates"] - ####################### # Sitemap configuration: https://sphinx-sitemap.readthedocs.io/ ####################### @@ -168,6 +161,25 @@ sitemap_show_lastmod = True +# Exclude generated pages from the sitemap: + +sitemap_excludes = [ + '404/', + 'genindex/', + 'search/', +] + +# TODO: Add more pages to sitemap_excludes if needed. Wildcards are supported. +# For example, to exclude module pages generated by autodoc, add '_modules/*'. + +####################### +# Template and asset locations +####################### + +html_static_path = [".sphinx/_static"] +templates_path = [".sphinx/_templates"] + + ############# # Redirects # ############# @@ -188,6 +200,7 @@ "reference/service-account": "https://canonical-terraform-provider-juju.readthedocs-hosted.com/latest/howto/manage-service-accounts/", } + ########################### # Link checker exceptions # ########################### @@ -206,8 +219,10 @@ "https://www.vaultproject.io/*" ] + # A regex list of URLs where anchors are ignored by 'make linkcheck' -# linkcheck_anchors_ignore_for_url = [r"https://github.com/.*"] + +linkcheck_anchors_ignore_for_url = [r"https://github\.com/.*"] # give linkcheck multiple tries on failure # linkcheck_timeout = 30 @@ -230,37 +245,31 @@ # https://www.sphinx-doc.org/en/master/usage/extensions/index.html # NOTE: The canonical_sphinx extension is required for the starter pack. -# It automatically enables the following extensions: -# - custom-rst-roles -# - myst_parser -# - notfound.extension -# - related-links -# - sphinx_copybutton -# - sphinx_design -# - sphinx_reredirects -# - sphinx_tabs.tabs -# - sphinxcontrib.jquery -# - sphinxext.opengraph -# - terminal-output -# - youtube-links extensions = [ "canonical_sphinx", + "notfound.extension", + "sphinx_design", + "sphinx_reredirects", + "sphinx_tabs.tabs", + "sphinxcontrib.jquery", + "sphinxext.opengraph", + "sphinx_config_options", + "sphinx_contributor_listing", + "sphinx_filtered_toctree", + "sphinx_related_links", + "sphinx_roles", + "sphinx_terminal", + "sphinx_ubuntu_images", + "sphinx_youtube_links", "sphinxcontrib.cairosvgconverter", "sphinx_last_updated_by_git", - # further extensions that jaas already had: - # 'sphinx_copybutton', - # 'sphinxcontrib.jquery' - # further extensions that we also enable in juju: - # Make it possible to link to related RTD projects using their internal anchors - # with, e.g., {external+ops:ref}`manage-configurations`: - 'sphinx.ext.intersphinx', + "sphinx.ext.intersphinx", + "sphinx_sitemap", + # Project specific extensions 'sphinxext.rediraffe', - # Display an external link icon and open link in new tab: - # new_tab_link_show_external_link_icon must also be set to True 'sphinx_new_tab_link', 'sphinxcontrib.lightbox2', - 'sphinx_sitemap', ] new_tab_link_show_external_link_icon = True @@ -271,18 +280,25 @@ 'CONTRIBUTING.md', 'TODO.md', 'README.md', + 'sp-updated', + 'upgrade_prompt.md', + 'upgrade_report.md', ] -# Add CSS files (located in .sphinx/_static/) +# Adds custom CSS files, located under 'html_static_path' + html_css_files = [ 'css/cookie-banner.css' ] -# Add JavaScript files (located in .sphinx/_static/) + +# Adds custom JavaScript files, located under 'html_static_path' + html_js_files = [ 'js/bundle.js', ] + # Specifies a reST snippet to be appended to each .rst file rst_epilog = """ diff --git a/requirements.txt b/requirements.txt index 79f7568..9133c88 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,38 @@ -canonical-sphinx[full] -packaging +# Canonical theme (still needed for Furo theme and custom templates) +canonical-sphinx>=0.5.1 + +# Extensions previously auto-loaded by canonical-sphinx +myst-parser +sphinx-autobuild +sphinx-design +sphinx-notfound-page +sphinx-reredirects +sphinx-tabs +sphinxcontrib-jquery +sphinxext-opengraph + +# Extra extensions, previously bundled as canonical-sphinx-extensions +sphinx-config-options>=0.1.0 +sphinx-contributor-listing>=0.1.0 +sphinx-filtered-toctree>=0.1.0 +sphinx-related-links>=0.1.1 +sphinx-roles>=0.1.0 +sphinx-terminal>=1.0.2 +sphinx-ubuntu-images>=0.1.0 +sphinx-youtube-links>=0.1.0 + +# Other dependencies +packaging +PyYAML sphinxcontrib-svg2pdfconverter[CairoSVG] sphinx-last-updated-by-git sphinx-sitemap + +# Vale dependencies +rst2html +vale + # specific to this project: sphinxext-rediraffe sphinx-new-tab-link sphinxcontrib.lightbox2 - diff --git a/reuse/links.txt b/reuse/links.txt index 0ac9bfb..af3c3b5 100644 --- a/reuse/links.txt +++ b/reuse/links.txt @@ -2,16 +2,18 @@ .. _Canonical Reference Library: https://library.canonical.com/ .. _Canonical Sphinx: https://github.com/canonical/canonical-sphinx .. _change log: https://github.com/canonical/sphinx-docs-starter-pack/wiki/Change-log +.. _csv-table reference: https://docutils.sourceforge.io/docs/ref/rst/directives.html#csv-table +.. _csv-table reference (MyST): https://mystmd.org/guide/directives#directive-csv-table .. _Diátaxis: https://diataxis.fr/ .. _Example product documentation: https://canonical-example-product-documentation.readthedocs-hosted.com/ .. _Example product documentation repository: https://github.com/canonical/example-product-documentation .. _`file-wide metadata`: https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html -.. _Five golden rules for compliant alt text: https://abilitynet.org.uk/news-blogs/five-golden-rules-compliant-alt-text +.. _Five golden rules for compliant alt text: https://abilitynet.org.uk/resources/digital-accessibility/five-golden-rules-compliant-alt-text .. _`Furo documentation`: https://pradyunsg.me/furo/quickstart/ .. _grid tables: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#grid-tables .. _`Hiding Contents sidebar`: https://pradyunsg.me/furo/customisation/toc/ .. _How to connect your Read the Docs account to your Git provider: https://docs.readthedocs.com/platform/stable/guides/connecting-git-account.html -.. _How to manually configure a Git repository integration: https://docs.readthedocs.io/en/stable/guides/setup/git-repo-manual.html +.. _How to manually configure a Git repository integration: https://docs.readthedocs.com/platform/stable/guides/setup/git-repo-manual.html .. _How to publish documentation on Read the Docs: https://library.canonical.com/documentation/publish-on-read-the-docs .. _Level AA conformance: https://www.w3.org/WAI/WCAG2AA-Conformance .. _list tables: https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-table @@ -26,16 +28,17 @@ .. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html .. _`Sphinx`: https://www.sphinx-doc.org/ .. _`Sphinx configuration`: https://www.sphinx-doc.org/en/master/usage/configuration.html +.. _Sphinx DataTables: https://sharm294.github.io/sphinx-datatables/ .. _Sphinx design: https://sphinx-design.readthedocs.io/en/latest/ .. _Sphinx documentation starter pack: -.. _Sphinx documentation starter pack repository: https://github.com/canonical/starter-pack +.. _Sphinx documentation starter pack repository: https://github.com/canonical/sphinx-docs-starter-pack .. _Sphinx documentation starter pack documentation: https://canonical-starter-pack.readthedocs-hosted.com/ .. _`Sphinx extensions`: https://www.sphinx-doc.org/en/master/usage/extensions/index.html .. _Sphinx tabs: https://sphinx-tabs.readthedocs.io/en/latest/ .. _tables: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#table-directives .. _toctree: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree .. _Vale: https://vale.sh/ -.. _Vale rules: https://github.com/canonical/praecepta +.. _Vale rules: https://github.com/canonical/documentation-style-guide .. _Web Content Accessibility Guidelines (WCAG) 2.2: https://www.w3.org/TR/WCAG22/ diff --git a/reuse/substitutions.yaml b/reuse/substitutions.yaml index be8526d..0c2958d 100644 --- a/reuse/substitutions.yaml +++ b/reuse/substitutions.yaml @@ -1,4 +1,4 @@ # Key/value substitutions to use within the Sphinx doc. {version_number: "0.1.0", formatted_text: "*Multi-line* text\n that uses basic **markup**.", - site_link: "[Website link](https://example.com)"} + site_link: "[Website link](https://example.com)"} \ No newline at end of file