|
| 1 | +# standalone_header() works with various inputs |
| 2 | + |
| 3 | + Code |
| 4 | + standalone_header("OWNER/REPO", "R/standalone-foo.R") |
| 5 | + Output |
| 6 | + [1] "# Standalone file: do not edit by hand" |
| 7 | + [2] "# Source: https://github.com/OWNER/REPO/blob/HEAD/R/standalone-foo.R" |
| 8 | + [3] "# Generated by: usethis::use_standalone(\"OWNER/REPO\", \"foo\")" |
| 9 | + [4] "# ----------------------------------------------------------------------" |
| 10 | + [5] "#" |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | + Code |
| 15 | + standalone_header("OWNER/REPO", "R/standalone-foo.R", ref = "blah") |
| 16 | + Output |
| 17 | + [1] "# Standalone file: do not edit by hand" |
| 18 | + [2] "# Source: https://github.com/OWNER/REPO/blob/blah/R/standalone-foo.R" |
| 19 | + [3] "# Generated by: usethis::use_standalone(\"OWNER/REPO\", \"foo\", ref = \"blah\")" |
| 20 | + [4] "# ----------------------------------------------------------------------" |
| 21 | + [5] "#" |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | + Code |
| 26 | + standalone_header("OWNER/REPO", "R/standalone-foo.R", host = "https://github.com") |
| 27 | + Output |
| 28 | + [1] "# Standalone file: do not edit by hand" |
| 29 | + [2] "# Source: https://github.com/OWNER/REPO/blob/HEAD/R/standalone-foo.R" |
| 30 | + [3] "# Generated by: usethis::use_standalone(\"OWNER/REPO\", \"foo\")" |
| 31 | + [4] "# ----------------------------------------------------------------------" |
| 32 | + [5] "#" |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | + Code |
| 37 | + standalone_header("OWNER/REPO", "R/standalone-foo.R", host = "https://github.acme.com") |
| 38 | + Output |
| 39 | + [1] "# Standalone file: do not edit by hand" |
| 40 | + [2] "# Source: https://github.acme.com/OWNER/REPO/blob/HEAD/R/standalone-foo.R" |
| 41 | + [3] "# Generated by: usethis::use_standalone(\"OWNER/REPO\", \"foo\", host = \"https://github.acme.com\")" |
| 42 | + [4] "# ----------------------------------------------------------------------" |
| 43 | + [5] "#" |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | + Code |
| 48 | + standalone_header("OWNER/REPO", "R/standalone-foo.R", ref = "blah", host = "https://github.com") |
| 49 | + Output |
| 50 | + [1] "# Standalone file: do not edit by hand" |
| 51 | + [2] "# Source: https://github.com/OWNER/REPO/blob/blah/R/standalone-foo.R" |
| 52 | + [3] "# Generated by: usethis::use_standalone(\"OWNER/REPO\", \"foo\", ref = \"blah\")" |
| 53 | + [4] "# ----------------------------------------------------------------------" |
| 54 | + [5] "#" |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | + Code |
| 59 | + standalone_header("OWNER/REPO", "R/standalone-foo.R", ref = "blah", host = "https://github.acme.com") |
| 60 | + Output |
| 61 | + [1] "# Standalone file: do not edit by hand" |
| 62 | + [2] "# Source: https://github.acme.com/OWNER/REPO/blob/blah/R/standalone-foo.R" |
| 63 | + [3] "# Generated by: usethis::use_standalone(\"OWNER/REPO\", \"foo\", ref = \"blah\", host = \"https://github.acme.com\")" |
| 64 | + [4] "# ----------------------------------------------------------------------" |
| 65 | + [5] "#" |
| 66 | + |
1 | 67 | # can offer choices |
2 | 68 |
|
3 | 69 | Code |
|
12 | 78 | ! `file` is absent, but must be supplied. |
13 | 79 | i Possible options are cli, downstream-deps, lazyeval, lifecycle, linked-version, obj-type, purrr, rlang, s3-register, sizes, types-check, vctrs, or zeallot. |
14 | 80 |
|
15 | | -# header provides useful summary |
16 | | - |
17 | | - Code |
18 | | - standalone_header("r-lib/usethis", "R/standalone-test.R") |
19 | | - Output |
20 | | - [1] "# Standalone file: do not edit by hand" |
21 | | - [2] "# Source: <https://github.com/r-lib/usethis/blob/main/R/standalone-test.R>" |
22 | | - [3] "# ----------------------------------------------------------------------" |
23 | | - [4] "#" |
24 | | - |
25 | 81 | # can extract imports |
26 | 82 |
|
27 | 83 | Code |
|
0 commit comments