Skip to content

build(deps)!: replace canonical-sphinx-extensions#107

Closed
jahn-junior wants to merge 5 commits intomainfrom
work/incorporate-extensions
Closed

build(deps)!: replace canonical-sphinx-extensions#107
jahn-junior wants to merge 5 commits intomainfrom
work/incorporate-extensions

Conversation

@jahn-junior
Copy link
Contributor

@jahn-junior jahn-junior commented Oct 15, 2025

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run tox?

BREAKING: This update incorporates the newest version of sphinx-terminal, which is incompatible with older versions of the terminal directive. When incorporating this version of canonical-sphinx into existing docs, all terminal directives have to be reworked to make use of the new syntax.

A comprehensive guide for migrating from a previous version can be found in the 1.0.0 release notes.

  • Replace canonical-sphinx-extensions with the newer, standalone versions of the extensions.
  • Remove sphinx-copybutton, which is now automatically configured by sphinx-terminal
  • Bump line length limit to 88

I've pulled this branch into a handful of Starcraft projects for testing, and, aside from the terminal redesign, everything seems to be completely backwards-compatible so far.

To test these changes against an existing doc set:

  • Clean your environment
  • Replace the canonical-sphinx[full] dependency with canonical-sphinx[full]@git+https://github.com/canonical/canonical-sphinx@work/incorporate-extensions
  • Update terminal directives per the migration guide
  • Rebuild the docs

@jahn-junior jahn-junior changed the title build(deps): replace canonical-sphinx-extensions build(deps)!: replace canonical-sphinx-extensions Oct 28, 2025
@dwilding
Copy link
Contributor

Thanks @jahn-junior! I'm testing this in the Pebble docs, where we have a bunch of {terminal} directives. I created canonical/pebble#717 to preview the changes and update our docs after canonical-sphinx is released.

The docs are rendering as expected, except I don't see the copy button (our live docs also don't have the copy button). For example, see this preview page. Do you know why that might be?

cc @james-garner-canonical in case this needs further investigation while I'm away in November.

Copy link
Contributor

@akcano akcano left a comment

Choose a reason for hiding this comment

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

LGTM

@SecondSkoll
Copy link
Collaborator

I see two issues, the first is that the new sphinx-terminal extension sets the copybutton class which means that standard codeblocks are no longer automatically able to be copied. The second is that as soon as this is released, it will break everyone's existing terminals because no one has this package pinned.

Rather than this update, I would prefer to move away from the [full] optional dependencies method of installation, and move to the starter pack specifying each extension. This means the breaking change can be funneled through the starter pack.

@jahn-junior
Copy link
Contributor Author

jahn-junior commented Oct 29, 2025

@SecondSkoll We've already updated the Starter Pack as you described. The "intended" use of canonical-sphinx is now just for theme components (and some other random functionality). Once the Starter Pack is released, this will be the non-standard way of incorporating these extensions.

With that being said, I suppose we can hold off on this change, as it's discouraged in the same way that canonical-sphinx-extensions is now. I'll open a PR to update the guidance in the README sometime this week.

@jahn-junior
Copy link
Contributor Author

Abandoning this update to encourage users to incorporate the extensions independently, as done in the Starter Pack.

@dwilding
Copy link
Contributor

Once the Starter Pack is released, this will be the non-standard way of incorporating these extensions.

Thanks for confirming. I'll switch canonical/pebble#717 to preview the next starter pack release and ping you there if anything doesn't look right

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.

4 participants