Skip to content

[FR] Option to reference a _bookdown.yml file instead of having to place it in the root directory of the Rmd file #1501

@PatrickRWright

Description

@PatrickRWright

I am using bookdown extensively in project work. That is, I have directories containing a multitude of Reports that all have homogeneous styling that is sourced from a shared src directory via the Rmd YAML header. (e.g. a style.css via css:, some javascript via in_header: and a footer.html via after_body:). The benefit of this is that I do not have to copy the same files everywhere because I can just source them.

With _bookdown.yml, however, this kind of sourcing via the YAML header does not seem to be an option. i.e. I need to place the same _bookdown.yml in every directory where I am rendering one of my reports. I would much prefer being able to specify a cental _bookdown.yml source and the YAML header seems like the obvious place to do this.

As a current workaround I am using file.copy(from = "../../../src/_bookdown.yml", to = ".", overwrite = TRUE) in the Rmd setup chunk to copy the _bookdown.yml from my src directory to the root of my current Rmd build. It works, but it seems less tidy than it could be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions