-
Notifications
You must be signed in to change notification settings - Fork 207
Is it possible to use sphinx-gallery with a separate source directory? #115
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
Comments
If there is no quick workaround that I could use on my side, I'd be happy to give a hand for a PR solving this issue, but I might need some help as I can't see an obvious solution. |
|
Thanks for the quick answer! For the configuration of sphinx-gallery, I have in
(I first tried without I launch the build from |
I think I found a workaround, with a minor modification of
allows to get the right paths with Should I submit a PR with this change, or could it be a problem to make this modification (of course, one can go back to the initial directory at the end of the function)? |
Coming back to this issue: any opinion on whether the workaround I suggest is the way to go, or whether another approach should be used? |
doing the |
See #119. |
It turns out that it is necessary to be located in the source directory for other tasks as well, as in What do you think? |
First of all, many thanks to the developers for this great project!
I'm currently trying to use
sphinx-gallery
for the examples gallery ofscikit-image
(http://scikit-image.org/docs/dev/auto_examples/), so thatscikit-image
can benefit from the developments made insphinx-gallery
in the future.However, I'm facing some problems with relative paths (that I detail below), and I'm wondering if some developers/users have already successfully used
sphinx-gallery
for projects that have a separatesource
directory (when you answer "yes" to the following question insphinx-quickstart
" > Separate source and build directories (y/n) [n]: y")
I tried to reproduce the problem with a simple example, generated with
sphinx-quickstart
. I have this doc directory with the following structureAnd when I run
make html
, the following structure is generated (clipping some lines)Images don't get copied because the path in
plot_adapt_rgb.rst
does not exist(sphinx complains about it during the build).
I think the problem comes from this line of code in
gen_gallery.py
in https://github.com/sphinx-gallery/sphinx-gallery/blob/master/sphinx_gallery/gen_gallery.py#L85
This issue seems to be related to #50. In #50 it was said that relative paths were not a priority at the moment. However, it seems that a large fraction of major scientific Python packages use a separate source directory: numpy, scipy, mayavi, pandas, ipython have a source directory, while matplotlib or scikit-learn don't.
The text was updated successfully, but these errors were encountered: