csl_style_load | R Documentation |
Load a CSL style
csl_style_load(input, ...)
input |
URL or local file path |
... |
Curl options passed on to crul::HttpClient |
This function fetches the style XML document, and parses it into
a more reasonble R list that's easy to navigate. If you want the raw XML,
see csl_style_xml()
named list, including slots for
info: basic top level information
locale: locale information, if it exists
macros: macros, 1 to many
citation: the citation format, very messy now as the format is messy, parsed with xml2::as_list
bibliography: very messy for now, we just run xml2::as_list on this element as it's complicated to parse
# Load a style from the Zotero style repository x <- 'http://www.zotero.org/styles/american-journal-of-political-science' if (crul::ok(x)) { jps <- csl_style_load(x) ## Query style information jps$info jps$locale jps$macros jps$citation jps$bibliography } ## Not run: # fetch styles csl_fetch_styles() # Load from a local style file ## just specify the style and we read from the local style files csl_style_load(input="apa") csl_style_load("computer-und-recht") csl_style_load("bulletin-de-correspondance-hellenique") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.