diff --git a/R/remove_aliases.R b/R/remove_aliases.R
new file mode 100644
index 000000000..6bb252c19
--- /dev/null
+++ b/R/remove_aliases.R
@@ -0,0 +1,40 @@
+#' Remove aliases from package index.
+#'
+#' Removes entries from package index page that list aliases of topics given in `names`.
+#'
+#' @param names (`character`) names of objects for which to remove aliases
+#'
+#' @return Invisible `TRUE` if operation succeeded, invisible `FALSE` otherwise.
+#'
+#' @keywords internal
+#'
+remove_aliases <- function(names) {
+ checkmate::assert_character(names)
+
+ index_file <- system.file("html", "00Index.html", package = "teal.slice")
+
+ if (identical(index_file, "") || !isTRUE(utils::file_test("-w", index_file))) {
+ return(invisible(FALSE))
+ }
+
+ index_contents <- readLines(index_file)
+
+ indices <- as.list(
+ lapply(names, function(name) {
+ intersect(
+ grep(sprintf("", name), index_contents),
+ grep(sprintf("%s", name), index_contents, invert = TRUE)
+ )
+ })
+ )
+
+ ind <- Reduce(union, indices)
+ if (identical(ind, integer(0L))) {
+ return(invisible(TRUE))
+ }
+ ind <- c(ind, ind + 1L)
+ index_contents <- index_contents[-ind]
+
+ writeLines(index_contents, index_file)
+ invisible(TRUE)
+}
diff --git a/R/teal_slice.R b/R/teal_slice.R
index 1c65284eb..b9867c632 100644
--- a/R/teal_slice.R
+++ b/R/teal_slice.R
@@ -174,7 +174,6 @@ teal_slice <- function(dataname,
#' @rdname teal_slice
#' @export
-#' @keywords internal
#'
is.teal_slice <- function(x) { # nolint
inherits(x, "teal_slice")
@@ -182,7 +181,6 @@ is.teal_slice <- function(x) { # nolint
#' @rdname teal_slice
#' @export
-#' @keywords internal
#'
as.teal_slice <- function(x) { # nolint
checkmate::assert_list(x, names = "named")
@@ -191,7 +189,6 @@ as.teal_slice <- function(x) { # nolint
#' @rdname teal_slice
#' @export
-#' @keywords internal
#'
as.list.teal_slice <- function(x, ...) {
formal_args <- setdiff(names(formals(teal_slice)), "...")
@@ -211,7 +208,6 @@ as.list.teal_slice <- function(x, ...) {
#' @rdname teal_slice
#' @export
-#' @keywords internal
#'
format.teal_slice <- function(x, show_all = FALSE, trim_lines = TRUE, ...) {
checkmate::assert_flag(show_all)
@@ -225,7 +221,6 @@ format.teal_slice <- function(x, show_all = FALSE, trim_lines = TRUE, ...) {
#' @rdname teal_slice
#' @export
-#' @keywords internal
#'
print.teal_slice <- function(x, ...) {
cat(format(x, ...))
diff --git a/R/teal_slices.R b/R/teal_slices.R
index 7fb9161c0..505fae7b7 100644
--- a/R/teal_slices.R
+++ b/R/teal_slices.R
@@ -129,7 +129,6 @@ teal_slices <- function(...,
#' @rdname teal_slices
#' @export
-#' @keywords internal
#'
is.teal_slices <- function(x) { # nolint
inherits(x, "teal_slices")
@@ -138,7 +137,6 @@ is.teal_slices <- function(x) { # nolint
#' @rdname teal_slices
#' @export
-#' @keywords internal
#'
as.teal_slices <- function(x) { # nolint
checkmate::assert_list(x)
@@ -152,7 +150,6 @@ as.teal_slices <- function(x) { # nolint
#' @rdname teal_slices
#' @export
-#' @keywords internal
#'
as.list.teal_slices <- function(x, recursive = FALSE, ...) { # nolint
ans <- unclass(x)
@@ -163,7 +160,6 @@ as.list.teal_slices <- function(x, recursive = FALSE, ...) { # nolint
#' @rdname teal_slices
#' @export
-#' @keywords internal
#'
`[.teal_slices` <- function(x, i) {
if (missing(i)) i <- seq_along(x)
@@ -187,7 +183,6 @@ as.list.teal_slices <- function(x, recursive = FALSE, ...) { # nolint
#' @rdname teal_slices
#' @export
-#' @keywords internal
#'
c.teal_slices <- function(...) {
x <- list(...)
@@ -211,7 +206,6 @@ c.teal_slices <- function(...) {
#' @param show_all (`logical(1)`) whether to display non-null elements of constituent `teal_slice` objects
#' @param trim_lines (`logical(1)`) whether to trim lines
#' @export
-#' @keywords internal
#'
format.teal_slices <- function(x, show_all = FALSE, trim_lines = TRUE, ...) {
checkmate::assert_flag(show_all)
@@ -230,7 +224,6 @@ format.teal_slices <- function(x, show_all = FALSE, trim_lines = TRUE, ...) {
#' @rdname teal_slices
#' @export
-#' @keywords internal
#'
print.teal_slices <- function(x, ...) {
cat(format(x, ...), "\n")
diff --git a/R/zzz.R b/R/zzz.R
index 6fcd671db..21743d729 100644
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -8,6 +8,8 @@
# Set up the teal logger instance
teal.logger::register_logger("teal.slice")
+ remove_aliases(c("teal_slice", "teal_slices", "filter_state_api"))
+
invisible()
}
diff --git a/_pkgdown.yml b/_pkgdown.yml
index 5dd0529d2..25d97fdac 100644
--- a/_pkgdown.yml
+++ b/_pkgdown.yml
@@ -24,14 +24,15 @@ reference:
- title: "`teal` filter-panel API"
desc: "Functions used initialize filter-panel and to modify its states."
contents:
- - init_filtered_data
- - set_filter_state
- - get_filter_state
- - get_filter_expr
- - remove_filter_state
- - clear_filter_states
- teal_slice
- teal_slices
+ - init_filtered_data
+ - get_filter_expr
+ - title: "internal"
+ contents:
+ - ends_with("_filter_state")
+ - ends_with(".teal_slice")
+ - ends_with(".teal_slices")
- title: "For developers"
subtitle: "R6 Classes"
desc: "Abstract and concrete classes used to build teal functionality."
diff --git a/man/remove_aliases.Rd b/man/remove_aliases.Rd
new file mode 100644
index 000000000..241aca3d6
--- /dev/null
+++ b/man/remove_aliases.Rd
@@ -0,0 +1,18 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/remove_aliases.R
+\name{remove_aliases}
+\alias{remove_aliases}
+\title{Remove aliases from package index.}
+\usage{
+remove_aliases(names)
+}
+\arguments{
+\item{names}{(\code{character}) names of objects for which to remove aliases}
+}
+\value{
+Invisible \code{TRUE} if operation succeeded, invisible \code{FALSE} otherwise.
+}
+\description{
+Removes entries from package index page that list aliases of topics given in \code{names}.
+}
+\keyword{internal}
diff --git a/man/teal_slice.Rd b/man/teal_slice.Rd
index 36fcb0196..7dcefefe8 100644
--- a/man/teal_slice.Rd
+++ b/man/teal_slice.Rd
@@ -171,4 +171,3 @@ print(x1, show_all = TRUE, trim_lines = FALSE)
\seealso{
\code{\link{teal_slices}}
}
-\keyword{internal}
diff --git a/man/teal_slices.Rd b/man/teal_slices.Rd
index 0e931d40b..017d8b7f0 100644
--- a/man/teal_slices.Rd
+++ b/man/teal_slices.Rd
@@ -137,4 +137,3 @@ print(all_filters, trim_lines = FALSE)
\item \code{\link[teal:slices_store]{teal::slices_store}} for robust utilities for saving and loading \code{teal_slices} in \code{JSON} format
}
}
-\keyword{internal}