Skip to content
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

Add .onAttach function #3

Open
nathaneastwood opened this issue Oct 9, 2018 · 2 comments
Open

Add .onAttach function #3

nathaneastwood opened this issue Oct 9, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@nathaneastwood
Copy link
Owner

So the user doesn't have to call the hooks themselves, I could just "attach" them straight away, i.e. run them when the user calls library(knitrhooks) (see this example).

@nathaneastwood nathaneastwood added the enhancement New feature or request label Oct 9, 2018
@dr-harper
Copy link
Contributor

Alternatively you could make your own R Markdown format and add the hooks within this. This gives a good example: https://stackoverflow.com/a/39961605/7347699

@nathaneastwood
Copy link
Owner Author

That’s really neat! But I guess it depends on where this package ends up going. It could end up catering to different formats (pdf, html, etc.) in which not all hooks will be relevant.

I guess my thoughts behind .onAttach was to load each of the hook functions so the user doesn’t have to, but then that could potentially bloat their environment unnecessarily. So both methods have negatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants