Skip to content

Improve Test the Ulwazi theme guide#588

Merged
jahn-junior merged 12 commits into
canonical:mainfrom
izmalk:ulwazi-guide-update
Apr 30, 2026
Merged

Improve Test the Ulwazi theme guide#588
jahn-junior merged 12 commits into
canonical:mainfrom
izmalk:ulwazi-guide-update

Conversation

@izmalk
Copy link
Copy Markdown
Contributor

@izmalk izmalk commented Apr 16, 2026

This PR clarifies and fixes the guide for testing the Ulwazi theme, addressing some of the issues reported in #580 and #581.

Fixes:

  • Added missing sphinx-terminal to the requirements.txt.
  • Fixed missing comma after "ulwazi" in the extensions diff block, which would cause a Python syntax error.
  • Noted that sphinx-modern-pdf-style must also be added to requirements.txt when enabling PDF output.
  • Fixed a missing closing }, in the html_context "license" block.

Improvements:

  • Added an introductory recommendation to work in a separate branch and use RTD's preview feature.
  • Revamped the starting section with clearer message of two alternative paths, with one being recommended as the simple way of testing Ulwazi.
  • Expanded the "Test the documentation" section to include a pre-build checklist and troubleshooting guidance for common build failures.
  • Various small wording and clarity improvements throughout.
  • Have you updated CHANGELOG.md with relevant non-documentation file changes?
  • Have you updated the documentation for this change?

@izmalk izmalk self-assigned this Apr 16, 2026
@a-velasco a-velasco added the documentation Improvements or additions to documentation label Apr 21, 2026
Copy link
Copy Markdown
Collaborator

@jahn-junior jahn-junior left a comment

Choose a reason for hiding this comment

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

Thanks! I left some optional suggestions on wording.

Comment thread docs/contribute/test-ulwazi-theme.md Outdated
Comment thread docs/contribute/test-ulwazi-theme.md Outdated
Comment thread docs/contribute/test-ulwazi-theme.md Outdated
Comment thread docs/contribute/test-ulwazi-theme.md Outdated
Comment thread docs/contribute/test-ulwazi-theme.md Outdated
Comment thread docs/contribute/test-ulwazi-theme.md Outdated
izmalk and others added 3 commits April 27, 2026 19:56
Co-authored-by: JJ Coldiron <jj.coldiron@canonical.com>
@izmalk izmalk requested a review from jahn-junior April 27, 2026 19:46
Comment thread docs/contribute/test-ulwazi-theme.md Outdated
@izmalk izmalk requested a review from jahn-junior April 27, 2026 21:28
Copy link
Copy Markdown
Collaborator

@jahn-junior jahn-junior left a comment

Choose a reason for hiding this comment

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

Thanks! I left one additional comment, but you've addressed the rest of my suggestions.

Comment thread docs/contribute/test-ulwazi-theme.md
Comment thread docs/contribute/test-ulwazi-theme.md Outdated
@izmalk izmalk requested a review from rkratky April 30, 2026 16:35
Use this approach if you want to preserve as much of your original `conf.py` as possible, for example in a heavily customised deployment or when troubleshooting a configuration issue.

### Set the theme
For an example of all the changes, see the [Charmed Apache Kafka Ulwazi PR](https://github.com/canonical/kafka-operator/pull/444/files#diff-85933aa74a2d66c3e4dcdf7a9ad8397f5a7971080d34ef1108296a7c6b69e7e3).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nitpick: The PR includes many other changes (formatting, etc.) that need to be ignored to see the Ulwazi-specific ones.

If providing an example diff/PR like this, it should be against the vanilla SP and free of anything else than the Ulwazi changes.

I realize that's likely out of scope of this PR, so I'd rather leave this out.

@jahn-junior jahn-junior merged commit ab97909 into canonical:main Apr 30, 2026
8 of 11 checks passed

Updating the project configuration is the most critical step in this process.

There are two main ways to do that:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
There are two main ways to do that:
There are two main ways:

## Update the dependencies

In your project's Python requirements, replace the canonical-sphinx package with Ulwazi and its dependencies. The minimum set is:
In your project's Python requirements (`requirements.txt`), replace the Canonical Sphinx package with Ulwazi and its dependencies:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's unclear to me what's meant here by "Ulwazi's dependencies". A lot of these extensions already exist in the default starter pack extensions.txt.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a great point, that leads me to an idea of separating minimum dependencies from the ones we use in our Ulwazi demo. I'll add it as a feature request to our GitHub issues.


### Set the theme
The following instructions describe the modifications needed to support Ulwazi in an existing `conf.py` file.
Use this approach if you want to preserve as much of your original `conf.py` as possible, for example in a heavily customised deployment or when troubleshooting a configuration issue.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Use this approach if you want to preserve as much of your original `conf.py` as possible, for example in a heavily customised deployment or when troubleshooting a configuration issue.
Use this approach if you want to preserve as much of your original `conf.py` as possible, for example in a heavily customized deployment or when troubleshooting a configuration issue.

* Simple way -- Adapt the [Sample `conf.py` for Ulwazi](https://github.com/canonical/ulwazi/blob/main/docs/default-conf.py) by adjusting the values for your specific documentation.
* Hard way -- Adapt your existing configuration by adding all required values.

We strongly recommend trying the first option (the simple way) first as it proved to be faster and less troublesome, yet enough for testing the theme.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
We strongly recommend trying the first option (the simple way) first as it proved to be faster and less troublesome, yet enough for testing the theme.
We strongly recommend trying the simple way first as it proved to be faster and less troublesome, yet enough for testing the theme.

copyright = f"{datetime.date.today().year}"
```

The license information is now conveyed through the "license" key in "html_context".
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
The license information is now conveyed through the `license` key in `html_context`.

+ sphinx-last-updated-by-git
+ sphinx-sitemap
+ sphinx-terminal
+ ulwazi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would add sphinx-modern-pdf-style here as well. If someone follows the simpler approach described below, then sphinx_modern_pdf_style is included in the extensions list in default_conf.py, and the instruction to add sphinx-modern-pdf-style to requirements.txt only appears in the instructions for the harder approach. Might as well include it in the default requirements.txt even if not every docs set needs it (not every docs set needs myst-parser either but it's included).

```

Add these entries to configure the settings related to your GitHub repository.
`default_edit_url` and `default_view_url` serve as fallback URLs for the view/edit source buttons on pages that do not have a specific source file path set.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
The `default_edit_url` and `default_view_url` settings serve as fallback URLs for the view/edit source buttons on pages that do not have a specific source file path set.

Optional nit; I prefer to avoid starting a sentence with a lower-case letter if possible.

"feedback": True,
"github_issues": "enabled",
"default_source_extension": default_source_extension,
"default_edit_url": github_repo + "/edit/main/docs/index" + default_source_extension,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just a note, not for this PR necessarily but for eventual implementation into the starter pack, it would be better not to use main here (or anywhere else) and have a variable set somewhere that reflects the branch to use, defaulting to main. Some repos use multiple branches for various versions.

### Configure the sitemap
#### Configure the sitemap

Add the lastmod setting to the sitemap section:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change

        Add the lastmod setting to the sitemap section:
      
      
        
        Add the `lastmod` setting to the sitemap section:

Note this has been in the starter pack for a while; maybe add "if it doesn't already exist."

## Test the documentation

Once configuration is complete, review everything again and build it from scratch (cleaning out the existing build files first):
Once configuration is complete, make sure the required extensions are listed in both the `extensions` list in `conf.py` and the `requirements.txt` file.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Might be worth mentioning that extensions bundled with Sphinx (that start with sphinx.ext., such as sphinx.ext.intersphinx) are exceptions; they only need to be listed in conf.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants