diff --git a/.Rbuildignore b/.Rbuildignore index a48b030..3d54a93 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ ^\.github$ ^LICENSE\.md$ ^.devcontainer$ +^man/figures$ diff --git a/README.Rmd b/README.Rmd index 11e10e5..6bd7776 100644 --- a/README.Rmd +++ b/README.Rmd @@ -8,7 +8,7 @@ output: github_document knitr::opts_chunk$set( collapse = TRUE, comment = "#>", - fig.path = "data-raw/figures/README-", + fig.path = "man/figures/README-", out.width = "100%" ) @@ -33,7 +33,7 @@ if (FALSE) { ```{r echo = FALSE, eval = FALSE} -img <- image_read("data-raw/figures/white.png") +img <- image_read("man/figures/white.png") hexSticker::sticker(subplot = img, @@ -50,9 +50,9 @@ hexSticker::sticker(subplot = img, h_size = 1.2, h_fill = "#ffffff", h_color = "#223344", - filename = "data-raw/figures/logo.png") + filename = "man/figures/logo.png") -image_read("data-raw/figures/logo.png") +image_read("man/figures/logo.png") ``` @@ -87,7 +87,7 @@ This highlighting works
Click here to show/hide gif demo - +
#### What's in the box @@ -152,10 +152,10 @@ mtcars |> head(15) |> hl(c('red', 'white', 'blue')) |> as_svg(650, 350) |> - cat(file = "data-raw/figures/example1.svg") + cat(file = "man/figures/example1.svg") ``` - + #### Complex example @@ -193,10 +193,10 @@ mtcars |> ) |> hl('hotpink', rows = hp == min(hp), cols = hp:carb) |> as_svg(650, 380) |> - cat(file = "data-raw/figures/example2.svg") + cat(file = "man/figures/example2.svg") ``` - + @@ -218,10 +218,10 @@ x <- "Paris in the the spring?" y <- "Not Paris in the spring!" hl_diff(x, y) |> as_svg(600, 80) |> - cat(file = "data-raw/figures/example-strdiff-3.svg") + cat(file = "man/figures/example-strdiff-3.svg") ``` - + Levenshtein's edit distance naturally applies to strings, but `hl_diff()` can visualise the difference between arbitrary objects by first converting them @@ -238,10 +238,10 @@ hl_diff(mean, median, coerce = 'print', sep = " ") ```{r echo=FALSE} hl_diff(mean, median, coerce = 'print', sep = " ") |> as_svg(600, 200) |> - cat(file = "data-raw/figures/example-strdiff-4.svg") + cat(file = "man/figures/example-strdiff-4.svg") ``` - + ## Highlight regular expression matches in objects with `hl_grep()` @@ -271,10 +271,10 @@ that Royal would have found the event to be most satisfactory. [Chas, now wearing a black Adidas tracksuit, nods to his sons]" hl_grep(txt, "event.*satisfactory", coerce = 'character')|> as_svg(600, 200) |> - cat(file = "data-raw/figures/example-hlgrep-1.svg") + cat(file = "man/figures/example-hlgrep-1.svg") ``` - + #### Highlight regular expression matches within an object @@ -291,10 +291,10 @@ hl_grep(mode, 'switch') ```{r echo = FALSE} hl_grep(mode, 'switch') |> as_svg(600, 250) |> - cat(file = "data-raw/figures/example-hlgrep-2.svg") + cat(file = "man/figures/example-hlgrep-2.svg") ``` - + # Animated SVG @@ -322,11 +322,11 @@ objs <- list( svg <- as_svg_anim(objs, width = 600, height = 100, duration = 2, playback = 'infinite', font_size = "2em") -writeLines(svg, "data-raw/figures/example-svg-anim.svg") +writeLines(svg, "man/figures/example-svg-anim.svg") ``` - + diff --git a/README.md b/README.md index 2fa40b3..f6b733d 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ This highlighting works Click here to show/hide gif demo - + #### What’s in the box @@ -100,7 +100,7 @@ mtcars |> hl(c('red', 'white', 'blue')) ``` - + #### Complex example @@ -125,7 +125,7 @@ mtcars |> ) ``` - + ## Highlight difference between two objects with `hl_diff()` @@ -139,7 +139,7 @@ y <- "Not Paris in the spring!" hl_diff(x, y) ``` - + Levenshtein’s edit distance naturally applies to strings, but `hl_diff()` can visualise the difference between arbitrary objects by @@ -154,7 +154,7 @@ function definitions is highlighted. hl_diff(mean, median, coerce = 'print', sep = " ") ``` - + ## Highlight regular expression matches in objects with `hl_grep()` @@ -174,7 +174,7 @@ that Royal would have found the event to be most satisfactory. hl_grep(txt, "event.*satisfactory", coerce = 'character') ``` - + #### Highlight regular expression matches within an object @@ -189,7 +189,7 @@ In this example, the function body for `mode()` is searched for the word hl_grep(mode, 'switch') ``` - + # Animated SVG @@ -206,7 +206,7 @@ svg <- as_svg_anim(objs, width = 600, height = 300, duration = 2, playback = 'infinite', font_size = "2em") ``` - + ## Options diff --git a/data-raw/figures/example-hlgrep-1.svg b/man/figures/example-hlgrep-1.svg similarity index 100% rename from data-raw/figures/example-hlgrep-1.svg rename to man/figures/example-hlgrep-1.svg diff --git a/data-raw/figures/example-hlgrep-2.svg b/man/figures/example-hlgrep-2.svg similarity index 96% rename from data-raw/figures/example-hlgrep-2.svg rename to man/figures/example-hlgrep-2.svg index cb6fccb..feb60df 100644 --- a/data-raw/figures/example-hlgrep-2.svg +++ b/man/figures/example-hlgrep-2.svg @@ -13,7 +13,7 @@ else switch(tx <- typeof(x), double = , integer = "numeric", closure = , builtin = , special = "function", tx) } -<bytecode: 0x14498ea88> +<bytecode: 0x117823688> <environment: namespace:base> diff --git a/data-raw/figures/example-strdiff-3.svg b/man/figures/example-strdiff-3.svg similarity index 100% rename from data-raw/figures/example-strdiff-3.svg rename to man/figures/example-strdiff-3.svg diff --git a/data-raw/figures/example-strdiff-4.svg b/man/figures/example-strdiff-4.svg similarity index 72% rename from data-raw/figures/example-strdiff-4.svg rename to man/figures/example-strdiff-4.svg index c8dc046..078dbf7 100644 --- a/data-raw/figures/example-strdiff-4.svg +++ b/man/figures/example-strdiff-4.svg @@ -4,10 +4,10 @@
 function (x               , ...) 
 UseMethod("me  an")
-<bytecode: 0x124 91b1c0>
+<bytecode: 0x1107a47c 0>
 <environment: namespace:b a se>

function (x, na.rm = FALSE, ...) UseMethod("median") -<bytecode: 0x135b9600 0> +<bytecode: 0x120 a26000> <environment: namespace:stats >
diff --git a/data-raw/figures/example-svg-anim.svg b/man/figures/example-svg-anim.svg similarity index 100% rename from data-raw/figures/example-svg-anim.svg rename to man/figures/example-svg-anim.svg diff --git a/data-raw/figures/example1.svg b/man/figures/example1.svg similarity index 100% rename from data-raw/figures/example1.svg rename to man/figures/example1.svg diff --git a/data-raw/figures/example2.svg b/man/figures/example2.svg similarity index 100% rename from data-raw/figures/example2.svg rename to man/figures/example2.svg diff --git a/data-raw/figures/examples-slow.mp4 b/man/figures/examples-slow.mp4 similarity index 100% rename from data-raw/figures/examples-slow.mp4 rename to man/figures/examples-slow.mp4 diff --git a/data-raw/figures/examples.gif b/man/figures/examples.gif similarity index 100% rename from data-raw/figures/examples.gif rename to man/figures/examples.gif