Skip to content

Commit

Permalink
Fix img path
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy committed Jun 26, 2024
1 parent 0c31cd1 commit 39afd45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/bookdown_to_leanpub.R
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ make_embed_markdown <- function(url,
#'
#' @export
#'
get_chapters <- function(html_page = file.path("docs", "index.html")) {
get_chapters <- function(html_page = file.path("docs", "index.html"),
base_url = ".") {
# Read in html
index_html <- suppressWarnings(try(xml2::read_html(html_page)))

Expand Down Expand Up @@ -459,7 +460,7 @@ get_chapters <- function(html_page = file.path("docs", "index.html")) {
rvest::html_attr('href') %>%
stringr::str_remove("^\\.\\/")

chapt_data <- data.frame(chapt_titles, data_level, data_path)
chapt_data <- data.frame(chapt_titles, data_level, url = paste0(base_url, "/", data_path))

} else {
chapt_data <- rvest::html_attrs(nodes) %>%
Expand Down

0 comments on commit 39afd45

Please sign in to comment.