Skip to content

Commit

Permalink
Refine pkgdown docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan committed Jun 21, 2024
1 parent 0ef613d commit 8b40a8a
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ compile_commands.json
^\.github$
^codecov\.yml$
^tools$
^_pkgdown\.yml$
^docs$
^pkgdown$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.quarto
.cache
compile_commands.json
docs
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Suggests:
treesitter.r
Remotes:
treesitter.r=r-lib/tree-sitter-r/bindings/r
Config/Needs/website: tidyverse/tidytemplate
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Expand Down
10 changes: 5 additions & 5 deletions R/point.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#'
#' - `is_point()` returns `TRUE` or `FALSE`.
#'
#' @name tree-sitter-point
#' @name points
#' @examples
#' x <- point(1, 2)
#'
Expand All @@ -43,7 +43,7 @@
#' is_point(x)
NULL

#' @rdname tree-sitter-point
#' @rdname points
#' @export
point <- function(row, column) {
row <- vec_cast(row, double())
Expand All @@ -55,21 +55,21 @@ point <- function(row, column) {
new_point(row, column)
}

#' @rdname tree-sitter-point
#' @rdname points
#' @export
point_row <- function(x) {
check_point(x)
point_row0(x)
}

#' @rdname tree-sitter-point
#' @rdname points
#' @export
point_column <- function(x) {
check_point(x)
point_column0(x)
}

#' @rdname tree-sitter-point
#' @rdname points
#' @export
is_point <- function(x) {
inherits(x, "tree_sitter_point")
Expand Down
14 changes: 7 additions & 7 deletions R/range.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#'
#' @seealso [node_range()]
#'
#' @name tree-sitter-range
#' @name ranges
#' @examples
#' x <- range(5, point(1, 3), 7, point(1, 5))
#' x
Expand All @@ -50,7 +50,7 @@
#' is_range(x)
NULL

#' @rdname tree-sitter-range
#' @rdname ranges
#' @export
range <- function(
start_byte,
Expand All @@ -67,35 +67,35 @@ range <- function(
new_range(start_byte, start_point, end_byte, end_point)
}

#' @rdname tree-sitter-range
#' @rdname ranges
#' @export
range_start_byte <- function(x) {
check_range(x)
range_start_byte0(x)
}

#' @rdname tree-sitter-range
#' @rdname ranges
#' @export
range_start_point <- function(x) {
check_range(x)
range_start_point0(x)
}

#' @rdname tree-sitter-range
#' @rdname ranges
#' @export
range_end_byte <- function(x) {
check_range(x)
range_end_byte0(x)
}

#' @rdname tree-sitter-range
#' @rdname ranges
#' @export
range_end_point <- function(x) {
check_range(x)
range_end_point0(x)
}

#' @rdname tree-sitter-range
#' @rdname ranges
#' @export
is_range <- function(x) {
inherits(x, "tree_sitter_range")
Expand Down
40 changes: 40 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
url: ~

development:
mode: auto

template:
package: tidytemplate
bootstrap: 5

reference:
- title: Parser
contents:
- starts_with("parser")
- is_parser
- text_parse
- title: Tree
contents:
- starts_with("tree")
- is_tree
- title: Node
contents:
- starts_with("node")
- is_node
- title: Query
contents:
- starts_with("query")
- is_query
- title: Language
contents:
- starts_with("language")
- is_language
- title: Point
contents:
- starts_with("point")
- title: Range
contents:
- starts_with("range")
- title: Tree cursor
contents:
- TreeCursor
4 changes: 2 additions & 2 deletions man/tree-sitter-point.Rd → man/points.Rd

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

4 changes: 2 additions & 2 deletions man/tree-sitter-range.Rd → man/ranges.Rd

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

0 comments on commit 8b40a8a

Please sign in to comment.