-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Sphinx - specify source directory (sphinx-build arguments) #1543
Comments
Hi, I think we won't add this very soon as there are alreadya lot configuration options in the project's admin panel. However we are working on a configuration that can be put in your directory (i.e. a |
The yml config file has been around for a while. Is this now doable? |
Hi @rweickelt! The documentation for the yaml file is at http://docs.readthedocs.io/en/latest/yaml-config.html and it seems that this is not supported yet :( |
You can always create a placeholder |
I request reconsidering the addition of this in the YAML file. I'm currently working on reorganizing pip's documentation, to simplify the build process. This reorganization is intended to split up pip's man pages and html pages. I want to be able to specify the source directory (either docs/html or docs/man) while pointing to the same conf.py (docs/conf.py) file.
I disagree. Sphinx allows specifying different directories for conf.py vs the source directory. It does default to conf.py being at On a slightly different note... Thanks for all the work on RTD. :) |
I think the workaround above still stands. You can have a single Is there a reason using
project = "..."
version = ".."
# Rest of your common sphinx config
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
from conf import *
# Override what you need
project = "..." |
Of course, it works. I'm actually going to not do a duplicated import and moved the file to the HTML directory, letting RTD build the HTML docs since the man pages are anyways going to not be built on RTD. I'll withdraw my proposal - the workaround is simple enough in nearly all cases and there is no need to ask for low-benefit work from others. :) |
This was broken in commit 20f672c, which reorganized the conf.py file into the html subdirectory. See: pypa#5724 readthedocs/readthedocs.org#1543 This broke the relative manpage globbing because Sphinx will os.chdir() into the directory location of conf.py before evaluating it, so the globbing returned nothing at all. As a result, while the main pip(1) manpage continued to be built, no pip-*(1) subcommand manpages were built.
- allows the source directory to be different from the conf.py directory - https://docs.readthedocs.io/en/stable/config-file/v2.html#build-commands - readthedocs/readthedocs.org#1543
- fixes shaarli#1451 - tools/.gitattributes: exclude doc/conf.py and doc/requirements.txt from zip exports - tools/doc/sphinx: suppress myst.xref_missing warnings caused by executablebooks/MyST-Parser#564 - dockerfile: use makefile/sphinx instead of mkdocs to build HTML documentation - dockerfile: add bash to the docs build container (make: bash: No such file or directory) - tools/doc/readthedocs: force use of python 3.11 (readthedocs ERROR: No matching distribution found for sphinx==7.1.0) - tools/doc/readthedocs: add all required configuration variables https://docs.readthedocs.io/en/latest/config-file/v2.html#build-os - tools/doc/readthedocs: override build commands to allow the source directory to be different from the conf.py directory (https://docs.readthedocs.io/en/stable/config-file/v2.html#build-commands, readthedocs/readthedocs.org#1543) - tools/doc/readthedocs: manually set output directory (readthedocs ERROR: No _readthedocs/html folder was created during this build.) - doc: replace all references to mkdocs with sphinx
Hi,
It looks like the default sphinx builder assumes that the source directory is the same as the configuration directory.
In https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/doc_builder/backends/sphinx.py#L128,
it looks like it CDs to the configuration directory and runs sphinx-build specifying "." as the source directory.
I want a directory structure as follows:
where
project/docs
is my configuration directory andproject/docs/src
is my source directory.It looks like the only way to do this is to write my own builder.
Is there an easier way to do this? If not, would you consider adding an easier way to do this?
The text was updated successfully, but these errors were encountered: