-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expand tinkr to reading metadata in toml? #126
Comments
Oh that's a good and simple addition! Go for it! |
Should the change be a bit more ambitious:
|
I think that's a great idea and R6 makes it really easy to do this with active bindings. tink <- R6::R6Class("tink",
public = list(
body = NULL,
front = "matter"
),
active = list(
yaml = function(yml) {
message("oh no, we do not use this")
if (!missing(yml)) self$front <- yml
self$front
}
)
)
n <- tink$new()
n$yaml <- "---\nhey: there\n---"
#> oh no, we do not use this
n$front
#> [1] "---\nhey: there\n---"
n$yaml
#> oh no, we do not use this
#> [1] "---\nhey: there\n---" Created on 2024-12-13 with reprex v2.1.1 |
Ok, thank you, I hope to work on this soon then! Or... next year 😸 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the first line is "---" (or more I guess) it is YAML, if it is "+++" it is TOML.
The package wouldn't need to parse TOML, just to keep it as text to not break it.
Happy to make a PR.
@yabellini
The text was updated successfully, but these errors were encountered: