dwww Home | Show directory contents | Find package

# cat_line

    Code
      cat_line("This is ", "a ", "line of text.")
    Output
      This is a line of text.

---

    Code
      cat_line("This is ", "a ", "line of text.", col = "red")
    Output
      This is a line of text.
    Code
      cat_line("This is ", "a ", "line of text.", background_col = "green")
    Output
      This is a line of text.

# cat_bullet [plain]

    Code
      cat_bullet(letters[1:5])
    Output
      * a
      * b
      * c
      * d
      * e

# cat_bullet [unicode]

    Code
      cat_bullet(letters[1:5])
    Output
      • a
      • b
      • c
      • d
      • e

# cat_boxx [plain]

    Code
      cat_boxx("foo")
    Output
      +---------+
      |         |
      |   foo   |
      |         |
      +---------+

# cat_boxx [unicode]

    Code
      cat_boxx("foo")
    Output
      ┌─────────┐
      │         │
      │   foo   │
      │         │
      └─────────┘

# cat_rule [plain]

    Code
      local({
        withr::local_options(cli.width = 20)
        cat_rule("title")
      })
    Output
      -- title -----------

# cat_rule [unicode]

    Code
      local({
        withr::local_options(cli.width = 20)
        cat_rule("title")
      })
    Output
      ── title ───────────

# cat_print [plain]

    Code
      cat_print(boxx(""))
    Output
      +------+
      |      |
      |      |
      |      |
      +------+

---

    Code
      local({
        tmp <- tempfile()
        on.exit(unlink(tmp), add = TRUE)
        expect_silent(cat_print(boxx(""), file = tmp))
        cat(readLines(tmp, warn = FALSE), sep = "\n")
      })
    Output
      +------+
      |      |
      |      |
      |      |
      +------+

# cat_print [unicode]

    Code
      cat_print(boxx(""))
    Output
      ┌──────┐
      │      │
      │      │
      │      │
      └──────┘

---

    Code
      local({
        tmp <- tempfile()
        on.exit(unlink(tmp), add = TRUE)
        expect_silent(cat_print(boxx(""), file = tmp))
        cat(readLines(tmp, warn = FALSE), sep = "\n")
      })
    Output
      ┌──────┐
      │      │
      │      │
      │      │
      └──────┘

Generated by dwww version 1.15 on Fri Jun 21 07:24:57 CEST 2024.