Skip to content

add number_sections argument to markdown_document2 (closes #756) - #938

Merged
cderv merged 8 commits into
rstudio:masterfrom
atusy:number-sections
Sep 10, 2020
Merged

cderv merged 8 commits into
rstudio:masterfrom
atusy:number-sections

Conversation

@atusy

@atusy atusy commented Aug 26, 2020

Copy link
Copy Markdown
Collaborator

Please merge after rstudio/rmarkdown#1879

This PR adds number_sections argument to markdown_document2 and its family (e.g., word_document2).

I set TRUE as a default value to be consistent with other formats (e.g., html_document2).
However, this may not be a good idea in case users' Rmd files manually numbered sections...

@yihui yihui left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atusy Thanks!

@cderv Feel free to merge this one after rstudio/rmarkdown#1879 is merged.

@cderv

cderv commented Sep 9, 2020

Copy link
Copy Markdown
Collaborator

LGTM.

Only one think: This feature relies on newer rmarkdown. So I did this 7f5af9c which is what to do in my experience.
@yihui do you work that way or have you another process for this ? Waiting for you answer before merging.

And we don't see this because ... we don't correctly test IMO. Once again, I think we should add test each time we add something. For now, I don't think the current test suite in bookdown allow to easily add test for this, so I'll do it later.

@cderv

cderv commented Sep 9, 2020

Copy link
Copy Markdown
Collaborator

It is not a perfect way to do it but I added a quick test because that is better to have one.

@yihui yihui left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cderv 7f5af9c looks good to me. Yes, we should use Remotes in DESCRIPTION when it requires a Github version of a package. Thanks!

@atusy

atusy commented Sep 9, 2020

Copy link
Copy Markdown
Collaborator Author

@cderv Thanks for changes!

@cderv
cderv merged commit f93e712 into rstudio:master Sep 10, 2020
@cderv

cderv commented Sep 10, 2020

Copy link
Copy Markdown
Collaborator

Thanks a lot @atusy !

yihui added a commit that referenced this pull request Sep 13, 2020
j-magnolia added a commit to j-magnolia/bookdown that referenced this pull request Sep 24, 2020
Merge remote-tracking branch 'rstudio/master' into master

# By Yihui Xie (4) and others
# Via Yihui Xie
* rstudio/master:
  the filenames use the separator - instead of _
  with a4c97d8, when rendering multiple output formats, each format is rendered in a new session, so we no longer need clean_envir = TRUE
  Add a precision that `number_sections` default to TRUE and this will change outputs
  add number_sections argument to markdown_document2 (closes rstudio#756) (rstudio#938)
  fix rstudio#932: deprecate the clean_envir argument of render_book(), and use xfun::Rscript_call() to render multiple output formats (with each format in a new R session, so the formats aren rendered independently)
  make 'word' an alias of 'docx' in _bookdown.yml: https://stackoverflow.com/q/63678601/559676
  Correctly encode twitter sharing url (rstudio#935)

# Conflicts:
#	R/render.R
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Would you mind developing word_book() output format?

3 participants