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

source code layout of Sphinx doc #492

Closed
marscher opened this issue Aug 23, 2021 · 5 comments
Closed

source code layout of Sphinx doc #492

marscher opened this issue Aug 23, 2021 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@marscher
Copy link
Contributor

marscher commented Aug 23, 2021

Typically the structure of a sphinx doc is:

|--doc
   |--source
      |--index.rst
   |--conf.py
   |--Makefile

The assumption made by the (usually) used Makefile is that the build directories are separated from the source. If this is not the case, incremental builds (which you usually perform locally) will try include build files as source files. This emits more and more warnings for every incremental run.
A Makefile is super useful as it provides the invocation of sphinx (you do not want to copy paste the commands every time) and it can clean up the whole build environment (e.g. delete generated files/directories). We can also a python script to invoke sphinx/clean up the build directories to remain platform agnostic.

example output, you note that the doctree within the build directory is considered a source, but is actually an output file of the previous build process.

reading sources... [ 62%] build/html/build/doctrees/nbsphinx/build/doctrees/nbsphinx/build/html/build/html/build/doctrees/nbsphinx/build/doctrees/nbsphinx/tutorials/measurement_example .. build/html/build/doctrees/nbsphinx/build/html/build/doctrees/nbsphinx/build/doctrees/nbsphinx/build/doctrees/nbsphinx/build/doctrees/nbsphinx/tutorials/GMAW_process

As a reference:
https://github.com/scipy/scipy/tree/master/doc
https://github.com/numpy/numpy/tree/main/doc
https://github.com/K3D-tools/K3D-jupyter/tree/main/docs
https://github.com/pandas-dev/pandas/tree/master/doc

@marscher marscher added the documentation Improvements or additions to documentation label Aug 23, 2021
@marscher
Copy link
Contributor Author

I could also place the Makefile in devtools/doc to circumvent this problem.

@CagtayFabry
Copy link
Member

If it makes things easier (which I guess it should) than using a makefile sounds good
I don't really have a strong opinion on where to put the build files :)

@CagtayFabry
Copy link
Member

CagtayFabry commented Sep 21, 2021

now that we have a Makefile, could you quickly post how to use it? @marscher
(I tried make html but ran into make: *** [Makefile:33: html] Error 1)

Should we also use this in the GitHub action? (dropping nbsphinx_execute="never" from the Makefile)

@marscher
Copy link
Contributor Author

marscher commented Sep 23, 2021 via email

@marscher
Copy link
Contributor Author

fixed by #830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants