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

Equivalent to knitr::current_input()? #67

Closed
MichaelChirico opened this issue Jan 17, 2025 · 2 comments
Closed

Equivalent to knitr::current_input()? #67

MichaelChirico opened this issue Jan 17, 2025 · 2 comments

Comments

@MichaelChirico
Copy link

We're working on multilingual support for vignettes in {data.table}.

As part of that we'd like to add a few links naming the available languages for each vignette like:

Available languages: en | fr | zh_CN

As it stands, that requires reading the path of the current vignette since the language info is encoded there, hence knitr::current_input() is pretty useful.

@rikivillalba found litedown:::.env$input works, but obviously it'd be better to rely on an exported function:

Rdatatable/data.table#6618

@yihui
Copy link
Owner

yihui commented Jan 21, 2025

I'll add an exported function. Thanks for the suggestion!

@yihui
Copy link
Owner

yihui commented Jan 22, 2025

Done. You can use litedown::get_input().

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

No branches or pull requests

2 participants