diff --git a/DESCRIPTION b/DESCRIPTION index e712590a..9b982d76 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,6 +23,7 @@ Suggests: tidyverse Config/testthat/edition: 3 Imports: + cli, curl (>= 5.1.0), httr2, lifecycle, diff --git a/R/helper.R b/R/helper.R index 27d5c3e5..95e252fd 100644 --- a/R/helper.R +++ b/R/helper.R @@ -311,41 +311,22 @@ startup_message <- function( pkgversion ) { - # 1) get github release - # using rvest - # - # NOTE: This is risky in case - # urls changes. Outcommented until a - # better solution to display deevelopment + cran version - # in startuÄ - # github_release <- rvest::html_text( - # rvest::html_element( - # css = 'small', - # rvest::html_element( - # css = 'div', - # rvest::html_element( - # css = 'nav', - # rvest::read_html( - # x = 'https://serkor1.github.io/cryptoQuotes/index.html' - # ) - # ) - # ) - # ) - # ) - - # 2) Generate CLI - # formatted messages - c( - paste('Loading', pkgname), - 'i' = paste('CRAN version:', pkgversion), - # 'i' = paste('Development version:', github_release), - '*' = paste('Release notes:', "https://serkor1.github.io/cryptoQuotes/news/index.html") + cli::rule( + left = paste(pkgname, cli::col_br_blue(pkgversion)), + right = cli::style_hyperlink( + text = paste( + cli::col_br_blue('release notes') + ), + url = 'https://serkor1.github.io/cryptoQuotes/news/index.html' + + ) ) } + # validators; #### date_validator <- function( from, diff --git a/R/zzz.R b/R/zzz.R index 229de49f..93391976 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -4,8 +4,10 @@ # objective: # script start; -.onAttach <- function(libname, pkgname) { +.onAttach <- function(libname, pkgname,...) { + # 1) startup message with + # using cli::rule msg <- startup_message( pkgname = pkgname, pkgversion = utils::packageVersion( @@ -13,12 +15,21 @@ ) ) - rlang::inform( - msg, - class = "packageStartupMessage" + + rlang::inform( + msg + , + ..., + class = "packageStartupMessage" ) + + + + + + } # script end; diff --git a/README.md b/README.md index bfb58b57..977cb169 100644 --- a/README.md +++ b/README.md @@ -193,122 +193,122 @@ Volume