|
1 | 1 | LFILE = README |
| 2 | +VIGNETTE = gtfsrouter |
2 | 3 |
|
3 | | -all: knith open |
4 | 4 |
|
5 | | -knith: $(LFILE).Rmd |
| 5 | +all: help |
| 6 | + |
| 7 | +doc: ## Update package documentation with `roxygen2` |
| 8 | + Rscript -e "roxygen2::roxygenise()"; \ |
| 9 | + |
| 10 | +init: ## Initialize pkgdown site |
| 11 | + echo "pkgdown::init_site()" | R --no-save -q |
| 12 | + |
| 13 | +pkgdown: ## Build entire pkgdown site |
| 14 | + echo "pkgdown::build_site()" | R --no-save -q |
| 15 | + |
| 16 | +vignette: ## Build pkgdown article |
| 17 | + echo "pkgdown::build_article('$(VIGNETTE)',quiet=FALSE)" | R --no-save -q |
| 18 | + |
| 19 | +knith: $(LFILE).Rmd ## Render README as HTML |
6 | 20 | echo "rmarkdown::render('$(LFILE).Rmd',output_file='$(LFILE).html')" | R --no-save -q |
7 | 21 |
|
8 | | -knitr: $(LFILE).Rmd |
9 | | - echo "rmarkdown::render('$(LFILE).Rmd',rmarkdown::md_document(variant='gfm'))" | R --no-save -q |
| 22 | +knitr: $(LFILE).Rmd ## Render README as markdown |
| 23 | + echo "rmarkdown::render('$(LFILE).Rmd',output_file='$(LFILE).md')" | R --no-save -q |
| 24 | + |
| 25 | +allcontribs: ## Update allcontributors in README |
| 26 | + Rscript -e "allcontributors::add_contributors ()" |
| 27 | + |
| 28 | +open: ## Open main HTML vignette in browser |
| 29 | + xdg-open docs/articles/$(VIGNETTE).html & |
| 30 | + |
| 31 | +check: ## Run pkgcheck |
| 32 | + Rscript -e 'library(pkgcheck); checks <- pkgcheck(); print(checks); summary (checks)' |
10 | 33 |
|
11 | | -open: $(LFILE).html |
12 | | - xdg-open $(LFILE).html & |
| 34 | +clean: ## Clean all junk files, including all pkgdown docs |
| 35 | + rm -rf *.html *.png README_cache docs/ |
13 | 36 |
|
14 | | -clean: |
15 | | - rm -rf *.html *.png README_cache |
| 37 | +help: ## Show this help |
| 38 | + @printf "Usage:\033[36m make [target]\033[0m\n" |
| 39 | + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' |
0 commit comments