Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions R/console.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ igraph.console <- function() {

#' The igraph console
#'
#' `r lifecycle::badge("deprecated")`
#'
#' The igraph console is a GUI window that shows what the currently running
#' igraph function is doing.
#'
Expand Down
2 changes: 2 additions & 0 deletions R/tkplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ assign(".next", 1, .tkplot.env)

#' Interactive plotting of graphs
#'
#' `r lifecycle::badge("deprecated")`
#'
#' `tkplot()` and its companion functions serve as an interactive graph
#' drawing facility. Not all parameters of the plot can be changed
#' interactively right now though, e.g. the colors of vertices, edges, and also
Expand Down
6 changes: 4 additions & 2 deletions man/console.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/tkplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 36 additions & 17 deletions vignettes/articles/current-deprecations.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,46 @@ parse_lifecycle_call <- function(symbol_function_call) {
warn = "2 -- warn",
stop = "3 -- stop"
)

args <- purrr::keep(
xml2::xml_siblings(xml2::xml_parent(symbol_function_call)),
\(x) xml2::xml_name(x) == "expr"
)
version <- xml2::xml_text(args[[1]])
old <- xml2::xml_text(args[[2]])
if (grepl("I\\(", old)) {
old <- sub('.*I\\("(.*)"\\).*', '\\1', old)
old_text <- withr::with_options(list("downlit.attached" = "igraph"), {
downlit::downlit_md_string(old)
})
} else {
old_text <- old
}
new <- if (length(args) > 2) xml2::xml_text(args[[3]]) else ""

new_text <- link_new(clean_arg(new))

if (!grepl("<a", new_text)) {
old_text <- link_new(clean_arg(old))
if (grepl("base::c", new) || grepl("^sprintf", new)) {
new_text <- ""
} else if (grepl("I\\(", new)) {
new <- sub('.*I\\("(.*)"\\).*', '\\1', new)
new <- sub("^'", "", new)
new <- sub("'$", "", new)
new_text <- withr::with_options(list("downlit.attached" = "igraph"), {
downlit::downlit_md_string(new)
})
} else {
old_text <- clean_arg(old)
new_text <- sub("\n", "", link_new(clean_arg(new)))

if (!grepl("<a", new_text)) {
old_text <- link_new(clean_arg(old))
} else {
old_text <- clean_arg(old)
}
}

tibble::tibble(
level = level,
version = clean_arg(version),
old = old_text,
new = new_text
new = new_text
)
}

Expand All @@ -92,12 +110,14 @@ parse_script <- function(path) {
xmlparsedata::xml_parse_data(pretty = TRUE) |>
xml2::read_xml() |>
xml2::xml_find_all(
".//SYMBOL_FUNCTION_CALL[contains(text(), 'deprecate_')]"
)

if (length(lifecycle_calls) == 0) return(NULL)

lifecycle_calls_info <- purrr::map(lifecycle_calls, parse_lifecycle_call)
".//SYMBOL_FUNCTION_CALL[contains(text(), 'deprecate_')]"
)

if (length(lifecycle_calls) == 0) {
return(NULL)
}

lifecycle_calls_info <- purrr::map(lifecycle_calls, parse_lifecycle_call)

do.call(rbind, lifecycle_calls_info)
}
Expand All @@ -109,7 +129,6 @@ table <- do.call(
rbind,
purrr::map(scripts, parse_script)
)

table <- table[order(table$level, table$version, decreasing = TRUE), ]
knitr::kable(table)

```
Loading