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

docs: starter pack #417

Merged
merged 14 commits into from
May 28, 2024
Merged

docs: starter pack #417

merged 14 commits into from
May 28, 2024

Conversation

IronCore864
Copy link
Contributor

@IronCore864 IronCore864 commented May 23, 2024

Introducing Canonical starter pack into pebble docs.

Docs themselves are not updated yet, only starter pack templates and necessary hacks to make it work.

Commits explained:

  • 1st commit is everything from the starterpack
  • the remaining commits are necessary config and hacks to make it work.

See the preview here.

Open to discuss:

  1. Shall we remove unnecessary files from the starter pack, or leave them as they are? Examples: doc-cheat-sheet-myst.md, doc-cheat-sheet.rst, index.rst, etc.
  2. Shall we remove the Makefile and come up with a short readme about pulling the latest starter pack templates and building docs locally? Pulling is simply cloning and copy-pasting, building is running some python scripts, pip install, then sphinx build. We benefit not much from the Makefile and it adds another thing in this repo.

.wokeignore Outdated Show resolved Hide resolved
@IronCore864 IronCore864 marked this pull request as ready for review May 23, 2024 03:40
@AnneCYH
Copy link
Contributor

AnneCYH commented May 23, 2024

Hi @IronCore864 ,

For your 2 open items.

#1 Shall we remove unnecessary files from the starter pack, or leave them as they are? Examples: doc-cheat-sheet-myst.md, doc-cheat-sheet.rst, index.rst, etc.

The cheat sheets can be removed since we usually refer users to the main Style guides. However index.rst is needed for the documentation landing page.

#2 Shall we remove the Makefile and come up with a short readme about pulling the latest starter pack templates and building docs locally?

I would advise against doing this. We use the starter pack for consistency across Canonical documentation sets. While the Makefile does indeed consist of a set of scripts/commands etc, we want to achieve a consistent user experience by running the same make run command.

Hope that makes sense.

Thanks.

@dimaqq
Copy link

dimaqq commented May 23, 2024

Hi @IronCore864 ,

For your 2 open items.

#1 Shall we remove unnecessary files from the starter pack, or leave them as they are? Examples: doc-cheat-sheet-myst.md, doc-cheat-sheet.rst, index.rst, etc.

The cheat sheets can be removed since we usually refer users to the main Style guides. However index.rst is needed for the documentation landing page.

#2 Shall we remove the Makefile and come up with a short readme about pulling the latest starter pack templates and building docs locally?

I would advise against doing this. We use the starter pack for consistency across Canonical documentation sets. While the Makefile does indeed consist of a set of scripts/commands etc, we want to achieve a consistent user experience by running the same make run command.

Hope that makes sense.

Thanks.

My 2c: I'd rather not see a Makefile in a Python repo that uses Python tools like Sphinx. It's just a bit alien in the Python ecosystem.

Instead we've got entrypoints in pyproject.toml or even shell incantations documents in a readme file.

I imagine that folks who maintain goland and c++ repos would have a similar, their-language-specific preference.

That being said, having a Makefile in the template repo is as a form of documenting the commands to run and a quick start that's meant to be adapted or translated to native tooling later on makes perfect sense.

Copy link
Contributor

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree that we need to figure out a better way to run this than a Makefile which installs a bunch of stuff to the local machine. Perhaps we can just use a tox.ini that runs Sphinx.

I agree about removing all files we don't need (the cheat sheets).

.wokeignore Outdated Show resolved Hide resolved
docs/Makefile.sp Outdated Show resolved Hide resolved
docs/Makefile.sp Outdated Show resolved Hide resolved
docs/init.sh Outdated Show resolved Hide resolved
docs/make.bat Outdated Show resolved Hide resolved
docs/readme.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just a couple of minor comments.

docs/tox.ini Show resolved Hide resolved
docs/.sphinx/pa11y.json Outdated Show resolved Hide resolved
docs/.sphinx/requirements.txt Outdated Show resolved Hide resolved
Copy link

@dimaqq dimaqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of my comments are about things to do in a separate PR.

Please find a place to note the remaining work somewhere.

Comment on lines +1 to +15
/**
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');
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what's the best way to handle the _static content.

My worry is that this many files and an occasional long file like this one pollute the repository. Maybe the owner can decide if that's acceptable.

Is there a change to pull these files in at build time, as I imagine same files are needed in each project?

Alternatively, we could host a tarball in the repo, and unpack it only when building the docs.

Comment on lines +1 to +49
addons
API
APIs
balancer
Charmhub
CLI
Diátaxis
dropdown
EBS
EKS
enablement
favicon
Furo
Git
GitHub
Grafana
IAM
installable
JSON
Juju
Kubeflow
Kubernetes
Launchpad
LTS
Makefile
Matrix
Mattermost
MyST
namespace
namespaces
NodePort
observability
OEM
OLM
Permalink
pre
Quickstart
ReadMe
reST
reStructuredText
RTD
subdirectories
subfolders
subtree
Ubuntu
UI
UUID
VM
YAML
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need our stuff here... I wonder what's the best way to address this, make a jira sub-task or a github issue?

docs/conf.py Show resolved Hide resolved
docs/custom_conf.py Show resolved Hide resolved
Copy link
Contributor

@tonyandrewmeyer tonyandrewmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try to build (with tox in the docs directory) I get:

docs: commands[0]> sphinx-build -W --keep-going . _build/html
Traceback (most recent call last):
  File "/home/tameyer/scratch/tiexenpebble/.tox/docs/bin/sphinx-build", line 5, in <module>
    from sphinx.cmd.build import main
  File "/home/tameyer/scratch/tiexenpebble/.tox/docs/lib/python3.12/site-packages/sphinx/cmd/build.py", line 17, in <module>
    from docutils.utils import SystemMessage
ModuleNotFoundError: No module named 'docutils'
docs: exit 1 (0.04 seconds) /home/tameyer/scratch/tiexenpebble/docs> sphinx-build -W --keep-going . _build/html pid=2850477
  docs: FAIL code 1 (0.07=setup[0.02]+cmd[0.01,0.04] seconds)
  evaluation failed :( (0.11 seconds)

docs/tox.ini Outdated Show resolved Hide resolved
docs/tox.ini Outdated Show resolved Hide resolved
docs/custom_conf.py Show resolved Hide resolved
@IronCore864
Copy link
Contributor Author

When I try to build (with tox in the docs directory) I get:

docs: commands[0]> sphinx-build -W --keep-going . _build/html
Traceback (most recent call last):
  File "/home/tameyer/scratch/tiexenpebble/.tox/docs/bin/sphinx-build", line 5, in <module>
    from sphinx.cmd.build import main
  File "/home/tameyer/scratch/tiexenpebble/.tox/docs/lib/python3.12/site-packages/sphinx/cmd/build.py", line 17, in <module>
    from docutils.utils import SystemMessage
ModuleNotFoundError: No module named 'docutils'
docs: exit 1 (0.04 seconds) /home/tameyer/scratch/tiexenpebble/docs> sphinx-build -W --keep-going . _build/html pid=2850477
  docs: FAIL code 1 (0.07=setup[0.02]+cmd[0.01,0.04] seconds)
  evaluation failed :( (0.11 seconds)

Fixed in the latest commits. Also .tox is moved inside docs/. Please take a final look.

@IronCore864 IronCore864 merged commit 20263d0 into canonical:master May 28, 2024
16 checks passed
@IronCore864 IronCore864 deleted the docs branch May 28, 2024 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants