#' Bold your text in markdown
#'
#' This function helps users to paste bold text in markdown
#' @return Character.
#' @author Jiaxiang Li
#'
#' @import rstudioapi
#' @import stringr
#' @importFrom glue glue
m3 <- function(){
line <-
# clipr::read_clip() %>%
rstudioapi::getSourceEditorContext() %>%
rstudioapi::primary_selection() %>%
.[["text"]]
m3 <-
function(name="Type something"){
text <- glue::glue('**{name}**')
# clipr::write_clip(text)
rstudioapi::insertText(text)
# avoid paste
cat(
sep="\n"
,text
,tips()
)
}
m3(line)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.