aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZsolt Udvari <uzsolt@FreeBSD.org>2024-08-13 05:37:50 +0000
committerZsolt Udvari <uzsolt@FreeBSD.org>2024-08-13 05:42:15 +0000
commitad83ddc0b4075fae1b7bae680de0bef1d97c88bc (patch)
treef3b31089cfc9f077ac00230499764dd78da4e0c0
parentec7bdd9c2bb5011003806061b59c8946f4362c06 (diff)
downloadports-ad83ddc0b4075fae1b7bae680de0bef1d97c88bc.tar.gz
ports-ad83ddc0b4075fae1b7bae680de0bef1d97c88bc.zip
textproc/R-cran-downlit: new port, Syntax Highlighting and Automatic Linking
Syntax highlighting of R code, specifically designed for the needs of 'RMarkdown' packages like 'pkgdown', 'hugodown', and 'bookdown'. It includes linking of function calls to their documentation on the web, and automatic translation of ANSI escapes in output to the equivalent HTML. The math/R doesn't ship grid library's vignette so should remove one test. This port is needed to update of devel/R-cran-devtools.
-rw-r--r--textproc/Makefile1
-rw-r--r--textproc/R-cran-downlit/Makefile36
-rw-r--r--textproc/R-cran-downlit/distinfo3
-rw-r--r--textproc/R-cran-downlit/files/patch-tests_testthat_test-link.R13
-rw-r--r--textproc/R-cran-downlit/pkg-descr4
5 files changed, 57 insertions, 0 deletions
diff --git a/textproc/Makefile b/textproc/Makefile
index 15b67f597bd7..62b14f964178 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -9,6 +9,7 @@
SUBDIR += R-cran-brew
SUBDIR += R-cran-cellranger
SUBDIR += R-cran-commonmark
+ SUBDIR += R-cran-downlit
SUBDIR += R-cran-formatR
SUBDIR += R-cran-highr
SUBDIR += R-cran-htmlTable
diff --git a/textproc/R-cran-downlit/Makefile b/textproc/R-cran-downlit/Makefile
new file mode 100644
index 000000000000..eada95198c9e
--- /dev/null
+++ b/textproc/R-cran-downlit/Makefile
@@ -0,0 +1,36 @@
+PORTNAME= downlit
+DISTVERSION= 0.4.4
+CATEGORIES= textproc
+DISTNAME= ${PORTNAME}_${PORTVERSION}
+
+MAINTAINER= uzsolt@FreeBSD.org
+COMMENT= Syntax Highlighting and Automatic Linking
+WWW= https://cran.r-project.org/web/packages/downlit/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+CRAN_DEPENDS= R-cran-brio>0:devel/R-cran-brio \
+ R-cran-desc>0:devel/R-cran-desc \
+ R-cran-digest>0:security/R-cran-digest \
+ R-cran-evaluate>0:devel/R-cran-evaluate \
+ R-cran-fansi>0:devel/R-cran-fansi \
+ R-cran-memoise>0:devel/R-cran-memoise \
+ R-cran-rlang>0:devel/R-cran-rlang \
+ R-cran-vctrs>0:devel/R-cran-vctrs \
+ R-cran-withr>0:devel/R-cran-withr \
+ R-cran-yaml>0:textproc/R-cran-yaml
+BUILD_DEPENDS= ${CRAN_DEPENDS}
+RUN_DEPENDS= ${CRAN_DEPENDS}
+TEST_DEPENDS= R-cran-covr>0:devel/R-cran-covr \
+ R-cran-htmltools>0:textproc/R-cran-htmltools \
+ R-cran-jsonlite>0:converters/R-cran-jsonlite \
+ R-cran-pkgload>0:devel/R-cran-pkgload \
+ R-cran-rmarkdown>0:textproc/R-cran-rmarkdown \
+ R-cran-testthat>0:devel/R-cran-testthat \
+ R-cran-tidyverse>0:devel/R-cran-tidyverse \
+ R-cran-xml2>0:textproc/R-cran-xml2
+
+USES= cran:auto-plist
+
+.include <bsd.port.mk>
diff --git a/textproc/R-cran-downlit/distinfo b/textproc/R-cran-downlit/distinfo
new file mode 100644
index 000000000000..2c9361bcc3cf
--- /dev/null
+++ b/textproc/R-cran-downlit/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1723491653
+SHA256 (downlit_0.4.4.tar.gz) = 55c377dcee4adc48c1060e14079f3d1832453d066a2cf070530caa210c48f828
+SIZE (downlit_0.4.4.tar.gz) = 37162
diff --git a/textproc/R-cran-downlit/files/patch-tests_testthat_test-link.R b/textproc/R-cran-downlit/files/patch-tests_testthat_test-link.R
new file mode 100644
index 000000000000..d76be78b37e7
--- /dev/null
+++ b/textproc/R-cran-downlit/files/patch-tests_testthat_test-link.R
@@ -0,0 +1,13 @@
+--- tests/testthat/test-link.R.orig 2024-08-13 05:33:03 UTC
++++ tests/testthat/test-link.R
+@@ -217,10 +217,6 @@ test_that("looks in attached packages", {
+ href_expr_(vignette("sha1")),
+ "https://cran.rstudio.com/web/packages/digest/vignettes/sha1.html"
+ )
+- expect_equal(
+- href_expr_(vignette("moveline")),
+- "https://cran.rstudio.com/web/packages/grid/vignettes/moveline.pdf"
+- )
+ })
+
+ test_that("fail gracefully with non-working calls", {
diff --git a/textproc/R-cran-downlit/pkg-descr b/textproc/R-cran-downlit/pkg-descr
new file mode 100644
index 000000000000..0af9982a9ee4
--- /dev/null
+++ b/textproc/R-cran-downlit/pkg-descr
@@ -0,0 +1,4 @@
+Syntax highlighting of R code, specifically designed for the needs of
+'RMarkdown' packages like 'pkgdown', 'hugodown', and 'bookdown'. It includes
+linking of function calls to their documentation on the web, and automatic
+translation of ANSI escapes in output to the equivalent HTML.