bm2md: Convert html format bookmarks to markdown

View source: R/bm2md.R

bm2mdR Documentation

Convert html format bookmarks to markdown

Description

Convert html format bookmarks to markdown. Useful especially in publishing it on GitHub. Only bookmarks files exported from Microsoft Edge, Google Chrome and Safari are supported now.

Usage

bm2md(
  file = dir(pattern = ".html$")[1],
  out = "bookmarks",
  safari = FALSE,
  add.rules = NULL
)

Arguments

file

bookmarks file in html format. Default: first html file in the current directory

out

output markdown file's name, without suffix

safari

whether this file is exported from MacOS Safari, default FALSE

add.rules

additional rules for some strange items. It should be a tibble or data frame, with first column being pattern, second being replacement (used in function stringr::str_replace_all()). All items should be written in string form of regular expression.

Author(s)

Yujie Liu

Examples


### Example additional rules

add.rules <- data.frame(
  pattern = c('.+HREF="(.+)" (LAST|ADD).+>(.+)',
              "test"),
  replacement = c("* [\\3](\\1)",
                  "TEST")
)


liuyujie0136/tinyfuncr documentation built on Dec. 13, 2024, 8:49 a.m.