#' Return the local user's YuQue Personal Access Token (PAT)
#'
#' You can read more about PATs here:
#' <https://www.yuque.com/yuque/developer/api#785a3731>
#' and you can access your PATs here (if logged in to YuQue):
#' <https://www.yuque.com/settings>.
#'
#' Currently it consults the `YUQUE_TOKEN`
#' environment variables, in this order.
#'
#' @return A string, with the token, or a zero length string scalar,
#' if no token is available.
#'
#' @export
#' @examples
#' yq_token()
yq_token <- function() {
Sys.getenv("YUQUE_TOKEN", unset = "")
}
yq_auth <- function(token) {
if (isTRUE(token != "")) {
c("Authorization" = paste("token", token))
} else {
character()
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.