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

HTML/extras created on-disk during file-dependency probing #644

Closed
aronatkins opened this issue Nov 4, 2021 · 2 comments
Closed

HTML/extras created on-disk during file-dependency probing #644

aronatkins opened this issue Nov 4, 2021 · 2 comments

Comments

@aronatkins
Copy link
Contributor

aronatkins commented Nov 4, 2021

  1. Create a new directory/project.

  2. Populate that directory

    bookdown::create_bs4_book(".")
  3. Add a code-block to index.Rmd so package dependencies are discovered.

    ```{r, include = FALSE}
    library(downlit)
    library(bslib)
    library(xml2)
    ```
  4. Render that book locally.

    rmarkdown::render_site(".")
  5. Attempt to deploy that directory.

    rsconnect::deploySite(
        siteDir = ".", 
        siteName = "BOOK-TITLE", 
        account = "ACCOUNT_NAME", 
        server = "SERVER_NAME", 
        render = "server")

The deployed bundle contains a libs directory and *.html files that were created as a side-effect of running the packrat snapshot against the directory. These files cause downstream rendering problems.

These files are created by the call to rmarkdown::render:

rmarkdown::render(file, output_file = outfile, quiet = TRUE),

@aronatkins
Copy link
Contributor Author

The eventual deployment fails with the rendering error:

Tweaking _book/404.html
Error in xml_children(x)[[search]] : subscript out of bounds
Calls: local ... bs4_chapter_tweak -> tweak_navbar -> template_link_icon -> <Anonymous>
Execution halted
Error: bookdown::render_book() failed to render the output format 'bookdown::bs4_book'.

The 404.html file is created as a side-effect of the deploy-time rmarkdown::render call.

@aronatkins
Copy link
Contributor Author

Resolved with #647; NEWS appearing shortly.

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

No branches or pull requests

1 participant