Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Spinx starter pack for RTD site (ISD-2738) #16

Merged
merged 42 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6cf7cd2
enable starter pack
erinecon Nov 26, 2024
e241ffc
customize the setup
erinecon Nov 26, 2024
f1876a6
update home page
erinecon Nov 26, 2024
2db065b
update working directory in CI workflows
erinecon Nov 27, 2024
68ce33a
update hardcoded sphinx venv dir
erinecon Nov 27, 2024
ebe5cd5
update environment variables in Makefile
erinecon Nov 27, 2024
c016162
update environment variables
erinecon Nov 28, 2024
ac27f0c
un-hardcode directory
erinecon Nov 28, 2024
f966ec8
un-hardcode another directory
erinecon Nov 28, 2024
c4a3cc6
revert env var changes
erinecon Nov 28, 2024
0cb39d0
add navigational structure for tutorials, how-to's, explanations
erinecon Nov 28, 2024
5cc5bac
update how to contribute page
erinecon Nov 29, 2024
72c8849
navigation changes
erinecon Nov 29, 2024
929a06a
update contributing guide
erinecon Nov 29, 2024
8b31d1d
update linkcheck ignore list
erinecon Nov 29, 2024
d708d92
update custom spelling list
erinecon Nov 29, 2024
35b26a5
update changelog
erinecon Nov 29, 2024
2655475
update README for markdown-lint
erinecon Nov 29, 2024
524679e
make woke happy
erinecon Nov 29, 2024
41238ac
Apply suggestions from code review
erinecon Nov 29, 2024
b5e5739
move license info in .sh riles
erinecon Nov 29, 2024
613f432
update license yaml
erinecon Nov 29, 2024
980a4c3
remove license info from metrics sh
erinecon Nov 29, 2024
2d683a2
update license ignore yaml
erinecon Nov 29, 2024
def09a7
move changelog entry under unreleased
erinecon Dec 2, 2024
590f9e5
update ubuntu os version for RTD
erinecon Dec 2, 2024
aced8cc
update python version for RTD
erinecon Dec 2, 2024
d12f8ba
update line_length
erinecon Dec 2, 2024
47b6ce5
add markdown cheat sheet
erinecon Dec 2, 2024
d6ee53e
make lint test happy
erinecon Dec 2, 2024
a062cf8
fix unit test
erinecon Dec 2, 2024
128f5e5
update unit test installation script
erinecon Dec 2, 2024
bedf419
revert changes for unit test
erinecon Dec 2, 2024
2051917
trigger CI
erinecon Dec 4, 2024
b64c228
update .wokeignore file path
erinecon Dec 5, 2024
eef4443
update .woke.yaml ignore_files
erinecon Dec 5, 2024
ed7d666
revert changes in .wokeignore
erinecon Dec 5, 2024
e38dbfa
revert .woke.yaml changes, add files to .gitignore
erinecon Dec 5, 2024
841e04b
add docs files to root .gitignore
erinecon Dec 5, 2024
d706b57
try to make vale happy
erinecon Dec 5, 2024
130b21f
update spellcheck to US English, update docs
erinecon Dec 6, 2024
c116491
revert changes to .gitignore
erinecon Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/automatic-doc-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Main Documentation Checks

on:
push:
branches: [main]
pull_request:
# Manual trigger
workflow_dispatch:

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
21 changes: 21 additions & 0 deletions .github/workflows/markdown-style-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Linter for Markdown"

on:
push:
branches:
- main
pull_request:
branches:
- '*'

jobs:
markdown-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DavidAnson/markdownlint-cli2-action@v16
with:
config: "docs/.sphinx/.markdownlint.json"

19 changes: 19 additions & 0 deletions .github/workflows/periodic-style-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Periodic Style Checks

on:
schedule:
- cron: "0 1 * * 4" # Runs at 01:00 AM on every Wednesday

jobs:
vale:
name: Style checker
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
working-directory: "sp-docs"
steps:
- uses: actions/checkout@v4
- name: Run vale
run: |
make vale
48 changes: 48 additions & 0 deletions .github/workflows/sphinx-python-dependency-build-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# The purpose of this workflow file is to confirm that the Sphinx
# virtual environment can be built from source, consequently documenting
# the packages required in the build environment to do that.
#
# This is needed because some projects embeds the documentation into built
# artifacts which involves rendering the documentation on the target
# architecture.
#
# 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
on:
- push
- pull_request
- workflow_dispatch

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
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
- name: Build Sphinx venv
working-directory: "docs"
run: |
set -ex
make -f Makefile.sp \
sp-install \
PIPOPTS="--no-binary :all:" \
|| ( cat .sphinx/venv/pip_install.log && exit 1 )
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,4 @@ cython_debug/
*.charm
*.rock
!examples/**/lib

2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ header:
paths-ignore:
- '.github/**'
- '.woke.yaml'
- '.wokeignore'
- '**/*.sum'
- '**/*.json'
- '**/*.j2'
Expand All @@ -33,4 +34,5 @@ header:
- 'examples/django/charm/lib/charms/redis_k8s/v0/redis.py'
- 'examples/flask/lib/charms/redis_k8s/v0/redis.py'
- 'examples/go/charm/lib/charms/redis_k8s/v0/redis.py'
- 'docs/**'
comment: on-failure
1 change: 1 addition & 0 deletions .wokeignore
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## 2024-11-29

### Changes

Added a `docs` folder to hold the
[Canonical Sphinx starter pack](https://github.com/canonical/sphinx-docs-starter-pack)
and to eventually publish the docs on Read the Docs.
erinecon marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ Read the
for more!

Additional resources:

* [Tutorial to build a rock for a Flask application](https://documentation.ubuntu.com/rockcraft/en/latest/tutorial/flask/)
* [Charmcraft `flask-framework` reference](https://juju.is/docs/sdk/charmcraft-extension-flask-framework)
* [Charmcraft `flask-framework` how to guides](https://juju.is/docs/sdk/build-a-paas-charm)
* [Rockcraft `flask-framework` reference](https://documentation.ubuntu.com/rockcraft/en/latest/reference/extensions/flask-framework/)
* [Rockcraft`flask-framework`
reference](https://documentation.ubuntu.com/rockcraft/en/latest/reference/extensions/flask-framework/)

## Contributing

Expand All @@ -76,15 +78,19 @@ through below.
1. Please write a proposal on the
[charm topic on discourse](https://discourse.charmhub.io/c/charm/41). This
should cover things like:

* The integration you intend add
* For each of the frameworks that PaaS Charm supports:

- The commonly used package(s) to make use of the integration
- The environment variables, configuration etc. that would be made available
to the app
- An example for how to use the integration within an app

* The proposed implementation in `paas-app`. Take a look at
[`charm.py`](paas_charm/_gunicorn/charm.py) for `gunicorn` based
frameworks for integration examples.

1. Update the
[reference](https://juju.is/docs/sdk/charmcraft-extension-flask-framework)
with the new integration
Expand All @@ -101,6 +107,7 @@ below.
1. Please write a proposal on the
[charm topic on discourse](https://discourse.charmhub.io/c/charm/41). This
should cover things like:

* The programming language and framework you are thinking of
* Create an example `rockcraft.yaml` file and build a working OCI image. To
see an example for `flask`, install Rockcraft and run
Expand All @@ -115,6 +122,7 @@ below.
* The requirements and conventions for how users need to configure their app
to work with PaaS Charm
* Which web server to use

1. Raise a pull request to [rockcraft](https://github.com/canonical/rockcraft)
adding a new extension and profile for the framework. This is the flask
[profile](https://github.com/canonical/rockcraft/blob/fdd2dee18c81b12f25e6624a5a48f9f1ac9fdb90/rockcraft/commands/init.py#L79)
Expand Down
2 changes: 2 additions & 0 deletions docs/.custom_wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Charmcraft
Rockcraft
17 changes: 17 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Starter pack rules start here
/*env*/
.sphinx/venv/
.sphinx/warnings.txt
.sphinx/.wordlist.dic
.sphinx/.doctrees/
.sphinx/node_modules/
package*.json
_build
.DS_Store
__pycache__
.idea/
.vscode/
.sphinx/styles/*
.sphinx/vale.ini
sp-docs/_build
33 changes: 33 additions & 0 deletions docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

# .readthedocs.yaml
erinecon marked this conversation as resolved.
Show resolved Hide resolved
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.13"
jobs:
pre_install:
- git fetch --unshallow || true

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: dirhtml
configuration: docs/conf.py
fail_on_warning: true

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/.sphinx/requirements.txt
16 changes: 16 additions & 0 deletions docs/.sphinx/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"default": false,
"MD003": { "style": "atx" },
"MD013": { "code_blocks": false, "tables": false, "stern": true, "line_length": 120},
"MD014": true,
"MD018": true,
"MD022": true,
"MD023": true,
"MD026": { "punctuation": ".,;。,;"},
"MD031": { "list_items": false},
"MD032": true,
"MD035": true,
"MD042": true,
"MD045": true,
"MD052": true
}
64 changes: 64 additions & 0 deletions docs/.sphinx/.wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
ACME
ACME's
addons
AGPLv
API
APIs
balancer
Charmhub
CLI
DCO
Diátaxis
Dqlite
dropdown
EBS
EKS
enablement
favicon
Furo
Git
GitHub
Grafana
IAM
installable
JSON
Juju
Kubeflow
Kubernetes
Launchpad
linter
LTS
LXD
Makefile
Makefiles
Matrix
Mattermost
MicroCeph
MicroCloud
MicroOVN
MyST
namespace
namespaces
NodePort
Numbat
observability
OEM
OLM
Permalink
pre
Quickstart
ReadMe
reST
reStructuredText
roadmap
RTD
subdirectories
subfolders
subtree
TODO
Ubuntu
UI
UUID
VM
webhook
YAML
20 changes: 20 additions & 0 deletions docs/.sphinx/_static/css/pdf.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2024 Canonical Ltd.
* See LICENSE file for licensing details.
*/

/* Only relevant for specific PDF generation issues */
erinecon marked this conversation as resolved.
Show resolved Hide resolved

.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;
}
Binary file added docs/.sphinx/_static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.sphinx/_static/tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading