link | R Documentation |
From another Rmarkdown file, create a link to a section or figure of a rebook-configured book.
link(id, package, type = NULL, prefix = NULL, df = NULL, error = TRUE)
id |
String containing an identifier for a section or figure. |
package |
String containing the name of the package containing the target book. |
type |
String containing the type of the link, e.g., |
prefix |
String specifying the prefix to use on |
df |
A data.frame containing all links for |
error |
Logical scalar indicating whether an error should be raised if the link cannot be found. |
We expect that the target book is set up as a Bioconductor package with a configure
file that runs configureBook
.
This function will then retrieve install-time information from that package to create necessary hyperlinks to the Bioconductor-hosted book content.
String containing a markdown-formatted link to the relevant part of the target book.
If the link cannot be constructed and error=FALSE
, a NULL
is instead returned.
Aaron Lun
configureBook
, which should be run by the authors of package
.
scrapeReferences
, to generate a df
for testing.
# Only using 'df=' here because 'testpackage' doesn't actually exist.
link("fig:xxx", package="testpackage",
df=data.frame(id='fig:xxx', file='whee.html', text='3.1'))
link("fig:xxx", package="testpackage", type=NA,
df=data.frame(id='fig:xxx', file='whee.html', text='3.1'))
link("fig:xxx", package="testpackage", prefix=NA,
df=data.frame(id='fig:xxx', file='whee.html', text='3.1'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.