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: disable viewcode extension #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iloveitaly
Copy link
Contributor

Wasn't obvious to me that this does NOT build on top of that extension vs replacing it

@TDKorn
Copy link
Owner

TDKorn commented Aug 18, 2024

Hey thanks for the PR! Can you please provide more detail about the conflict you experienced?

I'm a bit unclear on the line you added, since this extension is dependent on sphinx.ext.viewcode and will set it up even if you don't have it in your conf.py

def setup(app: Sphinx) -> Dict[str, Any]:
app.connect("builder-inited", add_static_path)
app.connect('build-finished', add_source_code)
app.setup_extension('sphinx.ext.viewcode')

This is to support documentation entries that are added with :noindex:, since the ID will be missing from the entry but can still be parsed from the anchor added by viewcode. For example,

.. only:: html
.. autofunction:: sphinx_inlinecode.get_code_block
:noindex:

I can definitely replicate the logic in viewcode and remove it as a dependency if needed though

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.

2 participants