Sent April 19...

---------- Forwarded message ---------
From: Kevin Cole <dc.l...@gmail.com>
Date: Wed, Apr 19, 2023 at 7:22 PM
Subject: Re: [sphinx-users] How can I create html only from the modified
.rst files after changing the project directory?
To: ycproject <classenu...@gmail.com>

On Wed, Apr 19, 2023 at 6:18 PM ycproject <classenu...@gmail.com> wrote:

> How can I create html only from modified .rst files?
>
> I copied the whole project to another disk and only modified a few .rst
> files, but after running make html, all the .rst files are regenerated into
> html files. (There are hundreds of .rst files in the whole project)
>
> I want to generate html only for those .rst files that have been modified,
> and for the unmodified .rst files, don't generate new html files.
>
> Translated with www.DeepL.com/Translator (free version)


I am not 100% confident, but I suspect the problem is that you copied
without keeping the original creation dates on the files.

Sphinx is comparing the new dates of the RST files to the new dates of the
HTML files: If the date of an RST file is newer than the date a generated
HTML, Sphinx will assume that the HTML file older than the RST and needs to
be regenerated.

If you are on a Linux system, you could issue a command from the root
directory of your project like:

find . -name "*.html" -exec touch {} +

This would search all subdirectories for HTML files and "touch" them
without changing anything, which forces the dates to be set to "now".

Then:

touch filename.rst

for each of the "few modified files" so that their date is newer than the
HTML files. Now, MOST of the RST files will be "older" than the HTML files
and the system will see no need to regenerate them.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CA%2BpvXRcTvtB5003%2BSDLWGX4qeRdZQ-40RDxDNrF23w7D8RFMZQ%40mail.gmail.com.

Reply via email to