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

allow registering entities for non-translating builders #936

Merged

Conversation

jdknight
Copy link
Member

This extension opted towards not registering directives, nodes and roles into the Sphinx application in order to be flexible for users opting to use directives/roles without only directive protection. This could result in exceptions being raised when a translator (such as html) could not processing a generated Confluence node type.

However, this also causes issues for unique builders such as Sphinx's linkcheck builder or sphinxcontrib.spelling 1, where warnings are generated for unknown directives/roles, making it hard to know if a build is failing for either a bad-link/spelling versus the use of an unknown directive/role.

In attempts to be even more flexible, this extension will permit the registration for these entities when it detects that an active builder has no translator (i.e. low risk of an unknown node exception). This should prevent any undesired unknown warnings for builders who do not explicitly care about unknown node types.

Finally, to support any odd case that has not been considered which may block a user from registering these entities, this extension has added an confluence_adv_disable_init option which will always restrict registration for a documentation set.

This extension opted towards not registering directives, nodes and roles
into the Sphinx application in order to be flexible for users opting to
use directives/roles without `only` directive protection. This could
result in exceptions being raised when a translator (such as `html`)
could not processing a generated Confluence node type.

However, this also causes issues for unique builders such as Sphinx's
linkcheck builder or sphinxcontrib.spelling [1], where warnings are
generated for unknown directives/roles, making it hard to know if a
build is failing for either a bad-link/spelling versus the use of an
unknown directive/role.

In attempts to be even more flexible, this extension will permit the
registration for these entities when it detects that an active builder
has no translator (i.e. low risk of an unknown node exception). This
should prevent any undesired unknown warnings for builders who do not
explicitly care about unknown node types.

Finally, to support any odd case that has not been considered which may
block a user from registering these entities, this extension has added
an `confluence_adv_disable_init` option which will always restrict
registration for a documentation set.

[1]: https://sphinxcontrib-spelling.readthedocs.io/

Signed-off-by: James Knight <[email protected]>
@jdknight jdknight merged commit 8ba4555 into main Mar 30, 2024
29 checks passed
@jdknight jdknight deleted the allow-entity-registration-on-non-translating-builders branch March 30, 2024 01:12
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.

1 participant