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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455
|
# ui_bullets() look as expected [plain]
Code
ui_bullets(c(`_` = "todo", v = "done", x = "oops", i = "info", "noindent", ` ` = "indent",
`*` = "bullet", `>` = "arrow", `!` = "warning"))
Message
[ ] todo
v done
x oops
i info
noindent
indent
* bullet
> arrow
! warning
# ui_bullets() look as expected [ansi]
Code
ui_bullets(c(`_` = "todo", v = "done", x = "oops", i = "info", "noindent", ` ` = "indent",
`*` = "bullet", `>` = "arrow", `!` = "warning"))
Message
[31m[ ][39m todo
[32mv[39m done
[31mx[39m oops
[33mi[39m info
noindent
indent
* bullet
> arrow
[33m![39m warning
# ui_bullets() look as expected [unicode]
Code
ui_bullets(c(`_` = "todo", v = "done", x = "oops", i = "info", "noindent", ` ` = "indent",
`*` = "bullet", `>` = "arrow", `!` = "warning"))
Message
☐ todo
✔ done
✖ oops
ℹ info
noindent
indent
• bullet
→ arrow
! warning
# ui_bullets() look as expected [fancy]
Code
ui_bullets(c(`_` = "todo", v = "done", x = "oops", i = "info", "noindent", ` ` = "indent",
`*` = "bullet", `>` = "arrow", `!` = "warning"))
Message
[31m☐[39m todo
[32m✔[39m done
[31m✖[39m oops
[33mℹ[39m info
noindent
indent
• bullet
→ arrow
[33m![39m warning
# ui_bullets() does glue interpolation and inline markup [plain]
Code
ui_bullets(c(i = "Hello, {x}!", v = "Updated the {.field BugReports} field", x = "Scary {.code code} or {.fun function}"))
Message
i Hello, world!
v Updated the 'BugReports' field
x Scary `code` or `function()`
# ui_bullets() does glue interpolation and inline markup [ansi]
Code
ui_bullets(c(i = "Hello, {x}!", v = "Updated the {.field BugReports} field", x = "Scary {.code code} or {.fun function}"))
Message
[33mi[39m Hello, world!
[32mv[39m Updated the [32mBugReports[39m field
[31mx[39m Scary `code` or `function()`
# ui_bullets() does glue interpolation and inline markup [unicode]
Code
ui_bullets(c(i = "Hello, {x}!", v = "Updated the {.field BugReports} field", x = "Scary {.code code} or {.fun function}"))
Message
ℹ Hello, world!
✔ Updated the 'BugReports' field
✖ Scary `code` or `function()`
# ui_bullets() does glue interpolation and inline markup [fancy]
Code
ui_bullets(c(i = "Hello, {x}!", v = "Updated the {.field BugReports} field", x = "Scary {.code code} or {.fun function}"))
Message
[33mℹ[39m Hello, world!
[32m✔[39m Updated the [32mBugReports[39m field
[31m✖[39m Scary `code` or `function()`
# ui_abort() defaults to 'x' for first bullet
Code
ui_abort("no explicit bullet")
Condition
Error:
x no explicit bullet
# ui_abort() can take explicit first bullet
Code
ui_abort(c(v = "success bullet"))
Condition
Error:
v success bullet
# ui_abort() defaults to 'i' for non-first bullet
Code
ui_abort(c("oops", ` ` = "space bullet", "info bullet", v = "success bullet"))
Condition
Error:
x oops
space bullet
i info bullet
v success bullet
# ui_code_snippet() with scalar input [plain]
Code
ui_code_snippet(
"\n options(\n warnPartialMatchArgs = TRUE,\n warnPartialMatchDollar = TRUE,\n warnPartialMatchAttr = TRUE\n )")
Message
options(
warnPartialMatchArgs = TRUE,
warnPartialMatchDollar = TRUE,
warnPartialMatchAttr = TRUE
)
# ui_code_snippet() with scalar input [ansi]
Code
ui_code_snippet(
"\n options(\n warnPartialMatchArgs = TRUE,\n warnPartialMatchDollar = TRUE,\n warnPartialMatchAttr = TRUE\n )")
Message
[1moptions[22m[33m([39m
warnPartialMatchArgs = [35mTRUE[39m,
warnPartialMatchDollar = [35mTRUE[39m,
warnPartialMatchAttr = [35mTRUE[39m
[33m)[39m
# ui_code_snippet() with vector input [plain]
Code
ui_code_snippet(c("options(", " warnPartialMatchArgs = TRUE,",
" warnPartialMatchDollar = TRUE,", " warnPartialMatchAttr = TRUE", ")"))
Message
options(
warnPartialMatchArgs = TRUE,
warnPartialMatchDollar = TRUE,
warnPartialMatchAttr = TRUE
)
# ui_code_snippet() with vector input [ansi]
Code
ui_code_snippet(c("options(", " warnPartialMatchArgs = TRUE,",
" warnPartialMatchDollar = TRUE,", " warnPartialMatchAttr = TRUE", ")"))
Message
[1moptions[22m[33m([39m
warnPartialMatchArgs = [35mTRUE[39m,
warnPartialMatchDollar = [35mTRUE[39m,
warnPartialMatchAttr = [35mTRUE[39m
[33m)[39m
# ui_code_snippet() when language is not R [plain]
Code
ui_code_snippet("#include <{h}>", language = "")
Message
#include <blah.h>
# ui_code_snippet() when language is not R [ansi]
Code
ui_code_snippet("#include <{h}>", language = "")
Message
#include <blah.h>
# ui_code_snippet() can interpolate [plain]
Code
ui_code_snippet("if (1) {true_val} else {false_val}")
Message
if (1) TRUE else 'FALSE'
# ui_code_snippet() can interpolate [ansi]
Code
ui_code_snippet("if (1) {true_val} else {false_val}")
Message
[33mif[39m [33m([39m[35m1[39m[33m)[39m [35mTRUE[39m [33melse[39m [36m'FALSE'[39m
# ui_code_snippet() can NOT interpolate [plain]
Code
ui_code_snippet("foo <- function(x){x}", interpolate = FALSE)
Message
foo <- function(x){x}
Code
ui_code_snippet("foo <- function(x){{x}}", interpolate = TRUE)
Message
foo <- function(x){x}
# ui_code_snippet() can NOT interpolate [ansi]
Code
ui_code_snippet("foo <- function(x){x}", interpolate = FALSE)
Message
foo [33m<-[39m [33mfunction[39m[33m([39mx[33m)[39m[33m{[39mx[33m}[39m
Code
ui_code_snippet("foo <- function(x){{x}}", interpolate = TRUE)
Message
foo [33m<-[39m [33mfunction[39m[33m([39mx[33m)[39m[33m{[39mx[33m}[39m
# bulletize() works
Code
ui_bullets(bulletize(letters))
Message
* a
* b
* c
* d
* e
... and 21 more
---
Code
ui_bullets(bulletize(letters, bullet = "x"))
Message
x a
x b
x c
x d
x e
... and 21 more
---
Code
ui_bullets(bulletize(letters, n_show = 2))
Message
* a
* b
... and 24 more
---
Code
ui_bullets(bulletize(letters[1:6]))
Message
* a
* b
* c
* d
* e
* f
---
Code
ui_bullets(bulletize(letters[1:7]))
Message
* a
* b
* c
* d
* e
* f
* g
---
Code
ui_bullets(bulletize(letters[1:8]))
Message
* a
* b
* c
* d
* e
... and 3 more
---
Code
ui_bullets(bulletize(letters[1:6], n_fudge = 0))
Message
* a
* b
* c
* d
* e
... and 1 more
---
Code
ui_bullets(bulletize(letters[1:8], n_fudge = 3))
Message
* a
* b
* c
* d
* e
* f
* g
* h
# ui_special() works [plain]
Code
cli::cli_text(ui_special())
Message
<unset>
---
Code
cli::cli_text(ui_special("whatever"))
Message
<whatever>
# ui_special() works [ansi]
Code
cli::cli_text(ui_special())
Message
[90m<unset>[39m
---
Code
cli::cli_text(ui_special("whatever"))
Message
[90m<whatever>[39m
# kv_line() looks as expected in basic use [plain]
Code
kv_line("CHARACTER", "VALUE")
Message
* CHARACTER: "VALUE"
Code
kv_line("NUMBER", 1)
Message
* NUMBER: 1
Code
kv_line("LOGICAL", TRUE)
Message
* LOGICAL: TRUE
# kv_line() looks as expected in basic use [fancy]
Code
kv_line("CHARACTER", "VALUE")
Message
• CHARACTER: [34m"VALUE"[39m
Code
kv_line("NUMBER", 1)
Message
• NUMBER: [34m1[39m
Code
kv_line("LOGICAL", TRUE)
Message
• LOGICAL: [34mTRUE[39m
# kv_line() can interpolate and style inline in key [plain]
Code
kv_line("Let's reveal {.field {field}}", "whatever")
Message
* Let's reveal 'SOME_FIELD': "whatever"
# kv_line() can interpolate and style inline in key [fancy]
Code
kv_line("Let's reveal {.field {field}}", "whatever")
Message
• Let's reveal [32mSOME_FIELD[39m: [34m"whatever"[39m
# kv_line() can treat value in different ways [plain]
Code
kv_line("Key", value)
Message
* Key: "some value"
Code
kv_line("Something we don't have", NULL)
Message
* Something we don't have: <unset>
Code
kv_line("Key", ui_special("discovered"))
Message
* Key: <discovered>
Code
kv_line("Key", "something {.emph important}")
Message
* Key: "something {.emph important}"
Code
kv_line("Key", I("something {.emph important}"))
Message
* Key: something important
Code
kv_line("Key", I("something {.emph {adjective}}"))
Message
* Key: something great
Code
kv_line("Interesting file", I("{.url {url}}"))
Message
* Interesting file: <https://usethis.r-lib.org/>
# kv_line() can treat value in different ways [fancy]
Code
kv_line("Key", value)
Message
• Key: [34m"some value"[39m
Code
kv_line("Something we don't have", NULL)
Message
• Something we don't have: [90m<unset>[39m
Code
kv_line("Key", ui_special("discovered"))
Message
• Key: [90m<discovered>[39m
Code
kv_line("Key", "something {.emph important}")
Message
• Key: [34m"something {.emph important}"[39m
Code
kv_line("Key", I("something {.emph important}"))
Message
• Key: something [3mimportant[23m
Code
kv_line("Key", I("something {.emph {adjective}}"))
Message
• Key: something [3mgreat[23m
Code
kv_line("Interesting file", I("{.url {url}}"))
Message
• Interesting file: [3m[34m<https://usethis.r-lib.org/>[39m[23m
|