Created
December 19, 2017 15:12
-
-
Save trinker/087931d2a54c6bc2dbe4a012d7b9d33a to your computer and use it in GitHub Desktop.
Make markdown links of text for href inside the markdown doc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make_link <- function(x = NULL){ | |
if (is.null(x)) x <- clipr::read_clip() | |
out <- sprintf('["%s"](#%s)', | |
x, | |
gsub('[?/]', '', gsub(' ', '-', tolower(x))) | |
) | |
clipr::write_clip(out) | |
cat(out) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment