rmd2id {rebook} | R Documentation |
Get the identifier for a book chapter given the Rmarkdown source code. This is usually derived from the chapter title but can also be explicitly specified.
rmd2id(path)
path |
String containing the path to the Rmarkdown file for a chapter. |
String containing the identifier for this chapter.
If no identifier can be determined, NULL
is returned.
Aaron Lun
tmp <- tempfile(fileext='.Rmd') write('# some chapter name blah', file=tmp) rmd2id(tmp) tmp2 <- tempfile(fileext='.Rmd') write('# some chapter name {#chapter-id} blah', file=tmp2) rmd2id(tmp2)