Skip to content

Commit

Permalink
docsify
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Mar 22, 2024
1 parent cf34716 commit 7a447e6
Show file tree
Hide file tree
Showing 42 changed files with 65 additions and 2,912 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ revdep*
README.Rmd
^altdoc$
^docs$
^docs/$
^vignettes/
Makefile
^_quarto$
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
*.DS_Store
README.html
altdoc/freeze.rds
_quarto/
!_quarto/_freeze/
docs/
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: countrycode
Title: Convert Country Names and Country Codes
Version: 1.5.0.9002
Version: 1.6.0
Authors@R:
c(person(given = "Vincent",
family = "Arel-Bundock",
Expand Down Expand Up @@ -40,9 +40,10 @@ Suggests:
eurostat,
testthat,
tibble,
ISOcodes,
utf8
Encoding: UTF-8
LazyData: yes
LazyLoad: yes
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3.9000
RoxygenNote: 7.3.1
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.PHONY: help website

BOOK_DIR := book

help: ## Display this help screen
@echo -e "\033[1mAvailable commands:\033[0m\n"
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort

document: ## document
Rscript -e "devtools::document()"

check: document ## check
Rscript -e "devtools::check()"

install: document ## install
Rscript -e "devtools::install(dependencies = TRUE)"

test: install ## test
Rscript -e "library(countrycode);devtools::test()"

website: install ## render vignettes and website
Rscript -e "altdoc::render_docs(verbose = TRUE)"
rm -rf _quarto
rm -rf ~/Downloads/countrycode_website && cp -r docs ~/Downloads/countrycode_website
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# News

## countrycode 1.5.0.9000
## countrycode 1.6.0

* Important speed-up for detection of country names using regular expressions (Thanks to Etienne Bacher).
* `countryname` gets the `nomatch` argument.
Expand Down
5 changes: 2 additions & 3 deletions R/countrycode-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#' @references
#' \url{http://arelbundock.com}
#' \url{https://github.com/vincentarelbundock/countrycode}
#' @docType package
#' @noRd
#' @keywords package
NULL
#' @keywords internal
"_PACKAGE"
15 changes: 0 additions & 15 deletions R/countrycode.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,6 @@
#' countryname(x, destination = "cowc", warn = FALSE)
#' countryname(x, destination = "cowc", warn = FALSE, nomatch = x)
#'
#' \dontrun{
#' library(countrycode)
#' # Download the dictionary of US states from Github
#'
#' state_dict <- "https://raw.githubusercontent.com/vincentarelbundock/countrycode/main/data/custom_dictionaries/data_us_states.csv"
#' state_dict <- read.csv(state_dict)
#'
#' # The "state.regex" column includes regular expressions, so we set an attribute.
#' attr(state_dict, "origin_regex") <- "state.regex"
#
#' countrycode(c('AL', 'AK'), 'abbreviation', 'state',
#' custom_dict = state_dict)
#' countrycode(c('Alabama', 'North Dakota'), 'state.regex', 'state',
#' custom_dict = state_dict)
#' }
countrycode <- function(sourcevar, origin, destination, warn = TRUE, nomatch = NA,
custom_dict = NULL, custom_match = NULL, origin_regex = NULL) {

Expand Down
4 changes: 4 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
always_allow_html: yes
---


<p align="center">
<img src="https://user-images.githubusercontent.com/987057/167296405-e7798ac8-03e7-444e-acaf-d99fc42d1c9e.png" align="right" alt="" width="125" />
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


<p align="center">
<img src="https://user-images.githubusercontent.com/987057/167296405-e7798ac8-03e7-444e-acaf-d99fc42d1c9e.png" align="right" alt="" width="125" />
</p>
Expand Down
25 changes: 8 additions & 17 deletions altdoc/docsify.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
* [Home](/)
* Vignettes:
- [Country codes](vignettes/countrycode.md)
- [Country names](vignettes/countryname.md)
- [Custom conversion functions](vignettes/custom.md)
- [Contributions](vignettes/contributions.md)
* Functions and dictionaries:
- [countrycode](man/countrycode)
- [countryname](man/countryname)
- [get_dictionary](man/get_dictionary)
- [guess_field](man/guess_field)
- [cldr_examples](man/cldr_examples)
- [codelist_panel](man/codelist_panel)
- [codelist](man/codelist)
- [countryname_dict](man/countryname_dict)
* [News](NEWS.md)
* [License](LICENSE.md)
* [Citation](CITATION.md)
* Articles: $ALTDOC_VIGNETTE_BLOCK
* Reference: $ALTDOC_MAN_BLOCK
* [News]($ALTDOC_NEWS)
* [Changelog]($ALTDOC_CHANGELOG)
* [Code of Conduct]($ALTDOC_CODE_OF_CONDUCT)
* [License]($ALTDOC_LICENSE)
* [Licence]($ALTDOC_LICENCE)
* [Citation]($ALTDOC_CITATION)
6 changes: 6 additions & 0 deletions altdoc/preamble_man_qmd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
format:
md:
prefer-html: true
---

6 changes: 6 additions & 0 deletions altdoc/preamble_vignettes_qmd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
format:
md:
prefer_html: true
default-image-extension: ""
---
4 changes: 4 additions & 0 deletions altdoc/preamble_vignettes_rmd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
always_allow_html: yes
---

Empty file removed docs/.nojekyll
Empty file.
23 changes: 0 additions & 23 deletions docs/CITATION.md

This file was deleted.

Loading

0 comments on commit 7a447e6

Please sign in to comment.