sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

cleaning all generated files

Open pinsardfr opened this issue 10 years ago • 5 comments

Hi

I am using Sphinx v1.3.1 with autosummary extension (just awesome by the way).

I am wondering if the fact that all generated directorties are not removed by the "make clean" is a feature and why ...

Here a real case

 $ make html
 ...
$ find . -name "_generated_"
./_build/doctrees/pypago/generated
./_build/html/_sources/pypago/generated
./_build/html/pypago/generated
./source/pypago/generated

$ make clean
Removing everything under '_build'...

$ find . -name "_generated_"
./source/pypago/generated

Should'nt this ./source/pypago/generated be also deleted or produced somewhere in _build directory (independant of a builder ?) instead ?

Regards

pinsardfr avatar Aug 13 '15 11:08 pinsardfr

I have the same question.

leotrs avatar Aug 25 '20 17:08 leotrs

There's an added difficulty to this: the directory where autosummary stores the generated files depends on the arguments passed to the directive when called.

For example,

.. autosummary::
  :toctree: generated

  module_name

will place the files in the generated/ folder.

luccareinehr avatar Jun 30 '22 10:06 luccareinehr

Also, it wouldn't be right to just delete all files with the same command as make clean. Since the user can edit every generated .rst, he may add text to these docs that would be lost unintentionally.

luccareinehr avatar Jun 30 '22 10:06 luccareinehr

This might be related: #10641

mgeier avatar Jul 09 '22 10:07 mgeier

I had just been sent on a goose chase trying to squash out "documents not referenced from toctree" errors due to leftover files from autosummary. I had been running make clean && make html thinking that I'm getting a build from scratch, but turns out that wasn't the case.

It's a really stupid interface that clean isn't a proper clean, it's a remove-some-random-arbitrary files "clean".

clean should undo all files run be previous make calls to ensure a new, clean, build.

MKuranowski avatar Jun 16 '24 17:06 MKuranowski