Skip to content

Commit

Permalink
docs: update man files & README
Browse files Browse the repository at this point in the history
  • Loading branch information
kennedymwavu committed Aug 16, 2024
1 parent dd365d1 commit 70a56b9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,19 @@ rmon::monitor(

```r
rmon::monitor(
dir = c(".", "path-to-another-dir"),
dir = c("path-to-first-dir", "path-to-another-dir"),
file = "app.R"
)
```

if multiple directories are specified, `file` is assumed to be in the first
directory.

# specify extension watch list

by default, `{rmon}` monitors only `.R` files in `dir` for changes.
by default, `{rmon}` monitors all files in `dir` for changes.

to watch `.R`, `.html`, `.css` and `.js` files:
to watch only `.R`, `.html`, `.css` and `.js` files, set the `ext` parameter:

```r
rmon::monitor(
Expand All @@ -57,10 +60,6 @@ rmon::monitor(
)
```

- `ext`: character vector. extensions to watch.

specifying `ext = "*"` watches all files in `dir` for changes.

# ignoring files

to ignore the file `dev.R`, do:
Expand All @@ -73,31 +72,36 @@ rmon::monitor(
)
```

- `exclude_files`: character vector

to ignore the directory `test/` as well:
to ignore the directory `test/`:

```r
rmon::monitor(
dir = ".",
file = "app.R",
exclude_files = "dev.R"
exclude_dirs = "test"
)
```

to ignore all files whose names match the pattern `test` as well:
to ignore all files whose names match the pattern `test`:

```r
rmon::monitor(
dir = ".",
file = "app.R",
exclude_files = "dev.R"
exclude_dirs = c("test"),
exclude_patterns = "test"
)
```

to ignore changes to hidden files, set `monitor_hidden = FALSE`:

```r
rmon::monitor(
dir = ".",
file = "app.R",
monitor_hidden = FALSE
)
```

# delaying restarting

in some situations, you may want to delay restarting until multiple files have changed.
Expand Down
10 changes: 4 additions & 6 deletions man/monitor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 70a56b9

Please sign in to comment.