etiennebacher / altdoc

Alternative to pkgdown to document R packages
https://altdoc.etiennebacher.com
Other
62 stars 9 forks source link

`.gitignore` expression for `freeze` of Quarto #268

Closed kazuyanagimoto closed 4 months ago

kazuyanagimoto commented 4 months ago

Hi. I think the package currently produces the following expression in .gitignore for freeze = TRUE in Quarto website:

_quarto/
!_quarto/_freeze/

Given this expression, _quarto/_freeze/ is still git-ignored. I think the correct expression is

_quarto/*
!_quarto/_freeze/
vincentarelbundock commented 4 months ago

I think we do want to ignore the freeze folder. This is not something the typical user will want to keep around. I see freeze as a convenience setting for local website builds.

And users can easily change it manually if they don't want that default.

Am I misunderstanding what you mean?

kazuyanagimoto commented 4 months ago

I think freeze is also expected to use for GHA building, which is mentioned in the Quarto document. It allows us to build notebooks includes a long computations, local data, and api secretes through GHA.

My expected behavior is by default, altdoc adds _quarto/* in .gitignore and I can manually add !_quarto/_freeze/ to keep the freeze files.

The problem is whenever I run render_docs(freeze = TRUE), which add _quarto/, as a result, the .gitignore will be

_quarto/*
!_quarto/_freeze/
_quarto/

It git-ignores _quarto/_freeze/, and I have to manually remove _quarto/ for each commit.

vincentarelbundock commented 4 months ago

Thanks for clarifying @kazuyanagimoto

@kylebutts According to git blame, you added this line:

https://github.com/etiennebacher/altdoc/blame/5457e211d390233cc14ff9d1d99e267e6068a312/R/render_docs.R#L72

It's just below another add_gitignore() call. Do you agree that both of those should be moved to setup_docs() and not be added every time we call render_docs()?

kylebutts commented 4 months ago

Hi @vincentarelbundock, I had that as a mental note to check with you about; but then I forgot. I agree it should be done once in setup_docs. I also changed it to _quarto/*

vincentarelbundock commented 4 months ago

@kazuyanagimoto the change is merged in the dev version of altdoc. You should only have to remove the offending line once from .gitignore. It will not be re-spawned every time.

Thanks for the report!