Skip to content

Commit

Permalink
feat: organize reference page
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomeriko96 committed Jan 12, 2024
1 parent 104d30e commit a588f97
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
^.*.pdf$
^cran-comments\.md$
^CRAN-SUBMISSION$
^helperfunctions$
^\.github$
^_pkgdown\.yml$
^docs$
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Currently, the package has functions to communicate with the following services:

- Linguee API

# Features
To see which functions are available, please refer to the reference page of the `polyglotr` package. The [reference](https://Tomeriko96.github.io/polyglotr/reference/index.html) page provides a comprehensive list of functions available in the package, organized by category.

Additionally, the package includes vignettes that provide more detailed information on how to use the functions in the package.

# Installation

To install the package:
Expand Down
24 changes: 24 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,27 @@ url: https://tomeriko96.github.io/polyglotr/
template:
bootstrap: 5

reference:
- title: Google Translation Methods
desc: Methods using Google Translation services
contents:
- batch_translate
- create_translation_table
- google_get_supported_languages
- google_is_valid_language_code
- google_supported_languages
- google_translate
- language_detect
- translate_file

- title: Linguee Methods
desc: Methods using Linguee services
contents:
- linguee_external_sources
- linguee_translation_examples
- linguee_word_translation

- title: MyMemory Methods
desc: Methods using MyMemory Translation services
contents:
- mymemory_translate
20 changes: 20 additions & 0 deletions helperfunctions/data_reference_index_missing.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
library(purrr)
data_reference_index_missing <- function(pkg = ".", depth = 1L) {
pkg <- pkgdown:::as_pkgdown(pkg)

meta <- pkg$meta[["reference"]] %||% pkgdown:::default_reference_index(pkg)
if (length(meta) == 0) {
return(list())
}

# Cross-reference complete list of topics vs. topics found in index page
all_topics <- meta %>%
map(~ pkgdown:::select_topics(.$contents, pkg$topics)) %>%
reduce(union)
in_index <- seq_along(pkg$topics$name) %in% all_topics

missing <- !in_index & !pkg$topics$internal
pkg$topics$name[missing]
}

data_reference_index_missing()

0 comments on commit a588f97

Please sign in to comment.