Skip to content

Commit

Permalink
change the default rendering method from html to markdown (#737, #…
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Nov 4, 2022
1 parent 3a432c2 commit c90b504
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGES IN blogdown VERSION 1.14

- For R Markdown posts, the default rendering method has been changed from `html` to `markdown`. If `options('blogdown.method')` is not set, it will be set to `'markdown'`. This option will also be set in `.Rprofile` for newly created sites via `blogdown::new_site()`. Users who have already set this `blogdown.method` option will not be affected. The motivation for this change is that `markdown` output often works better with Hugo themes and is less surprising, even though the `html` method allows for richer Markdown features because of Pandoc (thanks, @SebPouliot #737, @austinwpearce #591).

- When rendering Rmd posts that involve time-consuming and intensive computing while serving the site, the `hugo` process can die (for unknown reasons). Now the `hugo` process will be suspended before rendering Rmd posts, and resumed after the rendering is done. Hopefully this will keep the server process alive (thanks, @XiangyunHuang, https://d.cosx.org/d/423509).

# CHANGES IN blogdown VERSION 1.13
Expand Down
2 changes: 1 addition & 1 deletion R/render.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ build_site = function(local = FALSE, run_hugo = TRUE, build_rmd = FALSE, ...) {
}

build_method = function() {
methods = c('html', 'markdown', 'custom')
methods = c('markdown', 'html', 'custom')
match.arg(get_option('blogdown.method', methods), methods)
}

Expand Down
4 changes: 2 additions & 2 deletions inst/resources/Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ options(
blogdown.serve_site.startup = FALSE,
# to disable knitting Rmd files on save, set this option to FALSE
blogdown.knit.on_save = TRUE,
# build .Rmd to .html (via Pandoc); to build to Markdown, set this option to 'markdown'
blogdown.method = 'html'
# build .Rmd to .md; to build to .html (via Pandoc), set this option to 'html'
blogdown.method = 'markdown'
)

0 comments on commit c90b504

Please sign in to comment.