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

Work with empty markdown files #2466

Merged
merged 2 commits into from
Apr 18, 2024
Merged

Work with empty markdown files #2466

merged 2 commits into from
Apr 18, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented Apr 18, 2024

Fixes #2309

Rather than erroring, I just made it return nothing, which seems most consistent with the other ways we process markdown.

@hadley hadley requested a review from maelle April 18, 2024 13:32
@maelle
Copy link
Collaborator

maelle commented Apr 18, 2024

It works (see below) but why not adapt the behavior of path_first_existing()? (though I know path_first_existing() is used elsewhere too)

usethis::create_package("../empty")
#> ✔ Creating '../empty/'
#> ✔ Setting active project to '/tmp/RtmpYBW6yl/empty'
#> ✔ Creating 'R/'
#> ✔ Writing 'DESCRIPTION'
#> Package: empty
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#>     * First Last <first.last@example.com> [aut, cre] (YOUR-ORCID-ID)
#> Description: What the package does (one paragraph).
#> License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
#>     license
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 7.3.1
#> ✔ Writing 'NAMESPACE'
#> ✔ Setting active project to '<no active project>'
fs::file_create("../empty/README.md")
pkgdown::build_site("../empty")
#> ── Installing package empty into temporary library ─────────────────────────────
#> ── Building pkgdown site for package empty ─────────────────────────────────────
#> Reading from: /tmp/RtmpYBW6yl/empty
#> Writing to: /tmp/RtmpYBW6yl/empty/docs
#> ── Initialising site ───────────────────────────────────────────────────────────
#> Copying
#> ../../../home/maelle/R/x86_64-pc-linux-gnu-library/4.2/pkgdown/BS3/assets/bootstrap-toc.css,
#> ../../../home/maelle/R/x86_64-pc-linux-gnu-library/4.2/pkgdown/BS3/assets/bootstrap-toc.js,
#> ../../../home/maelle/R/x86_64-pc-linux-gnu-library/4.2/pkgdown/BS3/assets/docsearch.css,
#> ../../../home/maelle/R/x86_64-pc-linux-gnu-library/4.2/pkgdown/BS3/assets/docsearch.js,
#> ../../../home/maelle/R/x86_64-pc-linux-gnu-library/4.2/pkgdown/BS3/assets/link.svg,
#> ../../../home/maelle/R/x86_64-pc-linux-gnu-library/4.2/pkgdown/BS3/assets/pkgdown.css,
#> and
#> ../../../home/maelle/R/x86_64-pc-linux-gnu-library/4.2/pkgdown/BS3/assets/pkgdown.js
#> to bootstrap-toc.css, bootstrap-toc.js, docsearch.css, docsearch.js, link.svg,
#> pkgdown.css, and pkgdown.js
#> ── Building home ───────────────────────────────────────────────────────────────
#> Writing `authors.html`
#> Writing `404.html`
#> ── Building function reference ─────────────────────────────────────────────────
#> Writing `reference/index.html`
#> Writing sitemap.xml
#> ── Finished building pkgdown site for package empty ────────────────────────────
#> ── Finished building pkgdown site for package empty ────────────────────────────

Created on 2024-04-18 with reprex v2.1.0

@maelle
Copy link
Collaborator

maelle commented Apr 18, 2024

ah no it makes sense 🤦‍♀️

@hadley hadley merged commit 321f012 into main Apr 18, 2024
12 checks passed
@hadley hadley deleted the empty-markdown branch April 18, 2024 17:03
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.

Empty README.md file in package root directory causes error
2 participants