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

Support of other Sphinx extensions #10

Open
rainer-steinegger opened this issue Jul 4, 2018 · 8 comments
Open

Support of other Sphinx extensions #10

rainer-steinegger opened this issue Jul 4, 2018 · 8 comments

Comments

@rainer-steinegger
Copy link

Hi,

I was wondering what would be the best way to add other Sphinx extensions?
As far as I understand, the Sphinx runner is pre-built and therefore it is not really possible to add other extensions after it has been released?

Thanks,
Rainer

@trustin
Copy link
Owner

trustin commented Jul 4, 2018

That's correct. It's definitely possible though if we only ship CPython + pip and then build sphinx lazily in a virtual environment.

@trustin
Copy link
Owner

trustin commented Jul 6, 2018

Opening again since I'm interested making this come true.

@rainer-steinegger
Copy link
Author

Hi,
Is there any way I could help? I have very little experience with Python and pip and have no idea where I could start :( Therefore pointers would be more than welcome.
Take care,
Raienr

@trustin
Copy link
Owner

trustin commented Aug 13, 2018

Sorry for getting back very late. The idea is:

  1. Distribute portable full Python binaries, in a similar way we distribute sphinx-binary.
  2. The plugin downloads the Python binary and creates a virtual environment with it.
  3. Install various Python modules including sphinx into the virtual environment.

I didn't figure out how to build a portable Python distribution yet, though..

@trustin
Copy link
Owner

trustin commented Aug 13, 2018

One workaround is to put your extensions in <sphinx_site_dir>/_extensions and add the following statement to conf.py:

sys.path.append(os.path.abspath('_extensions'))

@trustin
Copy link
Owner

trustin commented Aug 13, 2018

@trustin
Copy link
Owner

trustin commented Dec 7, 2018

@rainer-steinegger I'm curious copying your extensions to your site sources and updating sys.path solves your problem.

@oliva123456
Copy link

oliva123456 commented Apr 6, 2022

adding extensions is possible, but as far as i understand you have to deal with all direct or transitive dependencies manually, which makes including extensions quite erroneous and not so comfortable to do.
e.g. i'm trying to include sphinx-toolbox (https://github.com/sphinx-toolbox/sphinx-toolbox) at the moment and there's the need to add other extensions like apeye, deprecation, deprecation_alias, typing_extensions, .....
an alternative is to install the desired extension via python/pip locally and copy the result (from python/lib/site-packages) as extensions.

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

No branches or pull requests

3 participants