forked from ropensci-archive/opendata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
26 lines (20 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
all: README.md
OpenData.ctv: opendata.md buildxml.R
pandoc -w html -o OpenData.ctv opendata.md
Rscript --vanilla -e 'source("buildxml.R")'
OpenData.html: OpenData.ctv
Rscript --vanilla -e 'if(!require("ctv")) install.packages("ctv", repos = "http://cran.rstudio.com/"); ctv::ctv2html("OpenData.ctv")'
README.md: OpenData.html
pandoc -w markdown_github -o README.md OpenData.html
sed -i.tmp -e 's|( \[|(\[|g' README.md
sed -i.tmp -e 's| : |: |g' README.md
sed -i.tmp -e 's|../packages/|http://cran.rstudio.com/web/packages/|g' README.md
sed -i.tmp -e '4s/.*/| | |\n|---|---|/' README.md
sed -i.tmp -e '4i*Do not edit this README by hand. See \[CONTRIBUTING.md\]\(CONTRIBUTING.md\).*\n' README.md
rm *.tmp
check:
Rscript --vanilla -e 'if(!require("ctv")) install.packages("ctv", repos = "http://cran.rstudio.com/"); print(ctv::check_ctv_packages("OpenData.ctv", repos = "http://cran.rstudio.com/"))'
checkurls:
Rscript --vanilla -e 'source("checkurls.R")'
README.html: README.md
pandoc --from=markdown_github -o README.html README.md