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

Feature: Only update docs for modified files #409

Open
sparr opened this issue Sep 9, 2024 · 5 comments
Open

Feature: Only update docs for modified files #409

sparr opened this issue Sep 9, 2024 · 5 comments

Comments

@sparr
Copy link

sparr commented Sep 9, 2024

When I run ldoc . a lot of my docs/**.html files are modified with just a new "Last Updated" date. I'd like to optionally disable that, and only modify the docs for source files that have changed.

@alerque
Copy link
Member

alerque commented Sep 9, 2024

You can disable the modified date entirely (my suggestion) so you don't have output churn. That happens in the template string.

Ultimately there should probably be a feature to set the last updated date based on the modified time of the source file, not the tooling run time. My git-warp-time could then be used to make sure the source files were dated correctly according to their Git history before docs were generated.

And yes, as a final stop a feature that only rebuilt things that needed to be would be lovely.

I don't have a lot of time to put towards developing this right now, but I'd gladly facilitate contributions if somebody worked up a PR to do any of these step.

@sparr
Copy link
Author

sparr commented Sep 9, 2024

It can also be disabled with --date "", a recent new feature which can also be used to set it to the last modification date or commit date. Sadly, I do like having updated dates in my updated files, so this is not a great option for me.

For posterity, here's my current scripted solution that uses git to undo the changes to files that only had their date changed:

ldoc .
git diff -G"<i style=\"float:right;\">Last updated " --numstat | awk '{if ($1==1 && $2==1) {print $3} }' | xargs git checkout

@alerque
Copy link
Member

alerque commented Sep 9, 2024

a recent new feature which can also be used to set it to the last modification date or commit date

True, but that is a global option for the project, not a per file one. Correct?

@sparr
Copy link
Author

sparr commented Sep 9, 2024

Sadly yes. See also #408; if I could run ldoc on single files then I could outsource the "which files were modified" to another tool like git, nx, entr, etc.

@Tieske
Copy link
Member

Tieske commented Sep 12, 2024

there is also this: https://github.com/lunarmodules/ldoc/pull/385/files

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

No branches or pull requests

3 participants