Skip to content

Commit

Permalink
change name of common options file to _output.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Feb 11, 2016
1 parent bc96d9a commit e0a44f6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
15 changes: 10 additions & 5 deletions R/output_format.R
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ rmarkdown_format <- function(extensions = NULL) {

#' Determine the default output format for an R Markdown document
#'
#' Read the YAML metadata (and any common _output.yaml file) for the
#' Read the YAML metadata (and any common _output.yml file) for the
#' document and return the output format that will be generated by
#' a call to \code{\link{render}}.
#'
Expand Down Expand Up @@ -349,7 +349,9 @@ output_format_from_yaml_front_matter <- function(input_lines,
# default to no options
output_format_options <- list()

# parse common _output.yaml if we have it
# parse common _output.yml if we have it
if (file.exiss("_output.yml"))
common_output_format_yaml <- yaml_load_file_utf8("_output.yml")
if (file.exists("_output.yaml"))
common_output_format_yaml <- yaml_load_file_utf8("_output.yaml")
else
Expand All @@ -362,7 +364,7 @@ output_format_from_yaml_front_matter <- function(input_lines,
# alias the output format yaml
output_format_yaml <- yaml_front_matter$output

# merge against common _output.yaml
# merge against common _output.yml
output_format_yaml <- merge_output_options(common_output_format_yaml,
output_format_yaml)

Expand Down Expand Up @@ -466,8 +468,11 @@ enumerate_output_formats <- function(input, envir, encoding) {
# read the ymal front matter
yaml_front_matter <- parse_yaml_front_matter(input_lines)

# read any _output.yaml
# read any _output.yml
output_yml <- file.path(dirname(input), "_output.yml")
output_yaml <- file.path(dirname(input), "_output.yaml")
if (file.exists(output_yml))
common_output_format_yaml <- yaml_load_file_utf8(output_yml)
if (file.exists(output_yaml))
common_output_format_yaml <- yaml_load_file_utf8(output_yaml)
else
Expand All @@ -480,7 +485,7 @@ enumerate_output_formats <- function(input, envir, encoding) {
# alias the output format yaml
output_format_yaml <- yaml_front_matter$output

# merge against common _output.yaml
# merge against common _output.yml
output_format_yaml <- merge_output_options(common_output_format_yaml,
output_format_yaml)
}
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ render("input.Rmd", "all")

#### Shared Output Formats

You can also define output formats externally in a file named `_output.yaml` located in the same directory as the R Markdown source file. For example:
You can also define output formats externally in a file named `_output.yml` located in the same directory as the R Markdown source file. For example:

```yaml
html_document:
Expand All @@ -121,7 +121,7 @@ pdf_document:
highlight: zenburn
```
Using an `_output.yaml` file is a good way to share output settings across multiple R Markdown files in the same directory.
Using an `_output.yml` file is a good way to share output settings across multiple R Markdown files in the same directory.

#### Output Format Functions

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ render("input.Rmd", "all")

#### Shared Output Formats

You can also define output formats externally in a file named `_output.yaml` located in the same directory as the R Markdown source file. For example:
You can also define output formats externally in a file named `_output.yml` located in the same directory as the R Markdown source file. For example:

``` yaml
html_document:
Expand All @@ -118,7 +118,7 @@ pdf_document:
highlight: zenburn
```
Using an `_output.yaml` file is a good way to share output settings across multiple R Markdown files in the same directory.
Using an `_output.yml` file is a good way to share output settings across multiple R Markdown files in the same directory.

#### Output Format Functions

Expand Down
2 changes: 2 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ rmarkdown 0.9.2.9001 (unreleased)

* Support `url` references in CSS files for `runtime: shiny`

* Change name of common options file to `_output.yml`


rmarkdown 0.9.2
--------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion man/default_output_format.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e0a44f6

Please sign in to comment.