Skip to content

Commit

Permalink
the filenames use the separator - instead of _
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Sep 14, 2020
1 parent 06c32c0 commit 57f1217
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test-rmd.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ if (Sys.getenv('NOT_CRAN') == 'true') local({
# footnotes are parsed and moved correctly
## deleted from last section
if (any(readLines("rmd/subsection-footnotes-2.html") == '<div class="footnotes">')) {
stop('Failed to parse and delete the footnotes in parse_footnotes.Rmd')
stop('Failed to parse and delete the footnotes in parse-footnotes.Rmd')
}
## footnote one is moved to first section
if (!any(readLines('rmd/test-footnote.html') == '<div class="footnotes">') ||
!any(grepl('id="fn1"', readLines('rmd/test-footnote.html')))) {
stop('Failed to move the footnotes back to subsection 1 in parse_footnotes.Rmd')
stop('Failed to move the footnotes back to subsection 1 in parse-footnotes.Rmd')
}
## footnote two is moved to second section
if (!any(readLines('rmd/subsection-footnotes-1.html') == '<div class="footnotes">') ||
!any(grepl('id="fn2"', readLines('rmd/subsection-footnotes-1.html')))) {
stop('Failed to move the footnotes back to subsection 1 in parse_footnotes.Rmd')
stop('Failed to move the footnotes back to subsection 1 in parse-footnotes.Rmd')
}
# multiline footnote is also moved
if (!any(readLines('rmd/subsection-footnotes-1.html') == '<div class="footnotes">') ||
!any(grepl('id="fn3"', readLines('rmd/subsection-footnotes-1.html')))) {
stop('Failed to move the footnotes back to subsection 1 in parse_footnotes.Rmd')
stop('Failed to move the footnotes back to subsection 1 in parse-footnotes.Rmd')
}

# number sections now works in markdown_document2
if (!any(readLines("rmd/number-sections.md") == "1.1 subsection 1") ||
!any(grepl("<a href=.*>2.1</a>", readLines("rmd/number-sections.md")))) {
stop("Something wrong in number_sections.Rmd")
stop("Something wrong in number-sections.Rmd")
}
})

2 comments on commit 57f1217

@GangminLi
Copy link

Choose a reason for hiding this comment

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

I am sure thsi si the right place to leave a comment. But I had a problem with split files with sections. In my book I have "Sumamry" and "Exercises" at the end of each chapter. The Knitr will complaint that the section has the same name. The output HTML will have a problem too. I guess you need to make name with index of Chapter or something similar. Bookdown has to address this problem because it is a common schema for a textbook. Thanks fo rthe great work. Maybe could think of do another textbookdown!

@cderv
Copy link
Collaborator

@cderv cderv commented on 57f1217 Oct 5, 2020

Choose a reason for hiding this comment

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

Hi @GangminLi , this unfortunatly has nothing to do with this commit.

Please ask your question on https://community.rstudio.com or Stack overflow.

And if you have a feature request, open an issue in GH instead of a comment on commit. Thank you !

Issue guide is here: https://yihui.org/issue/

Please sign in to comment.