Only reconvert the docs if the source .rst files have changed, simply based on modified time. Perhaps the hash of the contents might work instead.
How this might be achieved:
If the parsing python script has been modified, rebuild all the docs.
For each source doc, load saved information + modified times.
If the modified time has changed, re-extract information
If the source has been modified, or the destination no longer exists, add to list of docs to re-build to a reconvert.txt file
Save the updated docs information to a pkl or json.
Save the extracted *_styles.txt files
Run the pandoc conversion only on the files listed in reconvert.txt
The DocInfo might look like this:
@dataclass
class DocInfo:
src: Path
dest: Path
last_modified: float # Seconds since epoch from os.path.getmtime
indices: List[String] # The Indexes from the files.
to_reconvert: bool # Whether this file should get re-converted to md.
Other bits of information may be added in the future, such as Version added to lammps etc.
Only reconvert the docs if the source .rst files have changed, simply based on modified time. Perhaps the hash of the contents might work instead.
How this might be achieved:
reconvert.txt
filereconvert.txt
The
DocInfo
might look like this:Other bits of information may be added in the future, such as Version added to lammps etc.