dl_csl()
will download a requested citation style language (CSL) file from the
Github repository of CSL files.
dl_csl(csl, dir = "inst")
csl | a valid CSL file on the GIthub repository of CSL files, with or without file extension |
---|---|
dir | the subdirectory in the working directory in which you want the CSL file, defaults to "inst". A user who wants
the CSL file in their current working directory should set this to be |
dl_csl()
takes a requested CSL file (from the Github repository) and an optional subdirectory,
downloads the CSL file, and sticks it in the requested directory.
dl_csl()
assumes an active internet connection. The function also builds in a few implicit defaults.
If a file matching the requested CSL exists, the function does nothing. If the requested CSL does not have a ".csl"
extension, the function assumes you forgot it and adds it for you. By default, the function downloads the CSL file
and sticks it in your "inst" folder in the working directory. You can change this if you'd like with the dir
argument. If the directory does not exist, the function creates it for you. If you'd like the CSL file in the current
directory, set the dir
argument to be NULL
. The Github repository of CSL files is available here:
https://github.com/citation-style-language/styles.
if (FALSE) { dl_csl("american-political-science-association.csl") # ^ Works, has extension too dl_csl("journal-of-peace-research") # ^ Will also work, but message you that it assumes you forgot ".csl" }