-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add smv_prebuild_command config option #62
base: main
Are you sure you want to change the base?
Add smv_prebuild_command config option #62
Conversation
I made this before spotting #46 . For me it is a better solution to make this config option than a command line argument. |
sphinx-multiversion can build a copy of the documentation for each tag and place in a subfolder. The existing spinx setup can build the top level latest version. versioning.html gives links to version in the sidebar. layout.html overrides the main template to use correct versions in the title and top navigation bar. Note this requires a patch to sphinx_multiversion to allow calling a prebuild command. This is used to call the docs_api for each checkout. sphinx-contrib/multiversion#62
sphinx-multiversion can build a copy of the documentation for each tag and place in a subfolder. The existing spinx setup can build the top level latest version. versioning.html gives links to version in the sidebar. layout.html overrides the main template to use correct versions in the title and top navigation bar. Note this requires a patch to sphinx_multiversion to allow calling a prebuild command. This is used to call the docs_api for each checkout. sphinx-contrib/multiversion#62
sphinx-multiversion can build a copy of the documentation for each tag and place in a subfolder. The existing spinx setup can build the top level latest version. versioning.html gives links to version in the sidebar. layout.html overrides the main template to use correct versions in the title and top navigation bar. Note this requires a patch to sphinx_multiversion to allow calling a prebuild command. This is used to call the docs_api for each checkout. sphinx-contrib/multiversion#62
sphinx-multiversion can build a copy of the documentation for each tag and place in a subfolder. The existing spinx setup can build the top level latest version. versioning.html gives links to version in the sidebar. layout.html overrides the main template to use correct versions in the title and top navigation bar. Note this requires a patch to sphinx_multiversion to allow calling a prebuild command. This is used to call the docs_api for each checkout. sphinx-contrib/multiversion#62
sphinx-multiversion can build a copy of the documentation for each tag and place in a subfolder. The existing spinx setup can build the top level latest version. versioning.html gives links to version in the sidebar. layout.html overrides the main template to use correct versions in the title and top navigation bar. Note this requires a patch to sphinx_multiversion to allow calling a prebuild command. This is used to call the docs_api for each checkout. sphinx-contrib/multiversion#62
Separating with |
sphinx-contrib/multiversion#62 has not been merged yet and is not available from pypi. This picks-up that change to that `smv_prebuild_command` can be used by Zuar documentation.
it'd be nice to add some environment variables for the prebuild command, particularly the sphinx output path. This way, version-specific artifacts can be generated. For example, I'm zipping some example files and would like to put them in the _static folder so the docs can have a link to download them. |
Looks like I raised issue #71 prematurely - it looks like this will resolve what I'm after. @samtygier-stfc this is failing the CI build for relatively trivial linting reasons - are you able to run @Holzhaus is there anything else preventing this from getting merged in? |
Actually, while I'm thinking about it - would it be worth adding post build functionality too? I'm thinking that for build targets like pdf, there's an additional step after running |
22f8f59
to
46e20cc
Compare
I've updated the branch, fixing the flake8 errors and adding a smv_postbuild_command. |
Thanks a lot for the implementation of the |
@Holzhaus When is planned to be merged to master? |
This PR is truly useful. Until it is merged into a new release, if that can be useful to any of you, I have deployed the modified package on PyPI in order to be able to use the modifications in other projects that may want to use this unavailable feature : I can see that I am not the only one who had this idea : @Holzhaus, this is definitely a temporary solution for me, so don't hesitate to tell me if you want this PyPI package deleted. |
For awareness, you can install this using pip without having to deploy to pypi: https://pip.pypa.io/en/stable/cli/pip_install/#vcs-support To install from the authors branch: pip install git+https://github.com/samtygier-stfc/sphinx-multiversion.git@prebuild_command |
Although I agree this could be useful, the example of apidoc is a bad one - current master of sphinx-multiversion will successfully run apidoc automatically if the sphinxcontrib-apidoc package is correctly set up (checked myself). It won't run autodoc correctly (#69), though, but I would say that is a combined effect of how sphinx imports modules (and how Python keeps them cached for the whole execution while sphinx does not EDIT: fix link to the correct issue. |
One use case that I have for this is integrating doxygen and breathe into the build process for documenting C++ projects. I was hopeful that this would solve this for me, but alas it does not. The issue is that breathe does not export the xml database that doxygen spits out, and relies on the doxygen xml output directly. This is fine for the build stage, but the doxygen build directories obviously don't get exported to the version outputdir and gets nuked along with the rest of the tmp directory, and so they're inaccessible when actually rendering the documentation. This would be resolved if i could specify the names of directories to export to the version outputdir I realise that this is a very specific use case, so to generalise it a bit perhaps there's utility in also being able to specify a directory/pattern of directories to export after running the prebuild/postbuild command? my proposal is to add the following command options:
|
Why is this PR still open? Is some help needed that it gets merged? Please let me know, I really like it to be part of Sphinx Multiversion. |
I can rebase if that is useful. My project has stop using this in favour of the versioning in pydata-sphinx-theme https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/version-dropdown.html . This works better for us, as it saves the problem of building old docs in a current environment. |
Can be used to run a command in the checked out director before building with sphinx.
46e20cc
to
1cf86c4
Compare
I guess it would be pretty useful, because we would like to build automatically api docs from our code.
Does this also work with apidocs? |
Can be used to run a command in the checked out director before building
with sphinx.