sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.55k stars 2.12k forks source link

cleaning all generated files #1999

Open pinsardfr opened 9 years ago

pinsardfr commented 9 years ago

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

leotrs commented 4 years ago

I have the same question.

luccareinehr commented 2 years ago

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 commented 2 years ago

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.

mgeier commented 2 years ago

This might be related: #10641

MKuranowski commented 4 months ago

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.