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

Detect quarto vignettes as articles #2404

Merged
merged 5 commits into from
Mar 11, 2024
Merged

Detect quarto vignettes as articles #2404

merged 5 commits into from
Mar 11, 2024

Conversation

rcannood
Copy link
Contributor

Hello pkgdown maintainers!

Thanks for creating this awesome package! ☺️

This PR changes the [Rr]md regex used for detecting the vignettes to [Rrq]md to allow detection of vignettes using the quarto VignetteBuilder.

I tried it out on one of my repositories: funkyheatmap/funkyheatmap, which is now able to render all of the articles even though they are all Quarto markdown files.

This fixes quarto-dev/quarto-r#149.

Kind regards,
Robrecht

@hadley
Copy link
Member

hadley commented Mar 11, 2024

It probably process them as if they are RMarkdown vignettes though? (Unless I've totally forgotten how pkgdown works, which is quite possible)

@rcannood
Copy link
Contributor Author

Sure, and I think this is exactly what is happening. I'm just proposing to change the regex from [Rr]md to [Rrq]md to allow pkgdown yo be able to pick up the qmd files.

@hadley
Copy link
Member

hadley commented Mar 11, 2024

I can't quite tell if this is a good idea or not — obviously it's a pragmatic fix to get your quarto vignettes into pkgdown, but I worry that folks using advanced quarto features that aren't supported by Rmarkdown will potentially get weird errors.

@rcannood
Copy link
Contributor Author

rcannood commented Mar 11, 2024

That's an interesting take! Though you could argue that there are certainly also features in RMarkdown which are not usable when building vignettes for an R package.

Maybe one good argument I can bring to the table is that, using the quarto R package, CRAN seems to actually already pick up the relevant vignettes/*.qmd files: Source, Vignettes. In that sense, it would be nice of pkgdown could make creating vignettes with qmd as seamless as possible.

To some extend this could be a matter of creating documentation in the right places. I think quarto-r's documentation on how to create vignettes for R packages with quarto are definitely a step in the right direction: https://cloud.r-project.org/web/packages/quarto/vignettes/hello.html .

I'd like to clarify that I appreciate your critical thought in the matter. I hope I can make clear that I'm just arguing my case, rather than be unappreciative of your feedback.

@hadley
Copy link
Member

hadley commented Mar 11, 2024

To give you a bit more context, I am planning to try and put more time into "official" support for quarto, so the question is really about if this is a useful interim measure (since it does at least facilitate basic quarto support) or it's just better to wait until I do it 100%. The main disadvantage to waiting is that it's hard for me to know when I'll actually get the time to work on this.

Since it seems like having a vignette that 95% works is usually going to better than it's complete absence, I think I have persuaded myself that it's worth merging this and getting it into the release that's hopefully going out this week, and then I can iterate on fuller support for some future version.

@hadley hadley merged commit af45818 into r-lib:main Mar 11, 2024
13 checks passed
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this pull request Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add articles to navbar
2 participants