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

Detect output format #70

Closed
vincentarelbundock opened this issue Feb 4, 2025 · 1 comment
Closed

Detect output format #70

vincentarelbundock opened this issue Feb 4, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@vincentarelbundock
Copy link

vincentarelbundock commented Feb 4, 2025

Motivation: I have a package---tinytable---that must generate different code based on the output format (markdown, latex, html).

Is there a way to programmatically detect the output format?

I see there is an internal detect_format() function, but that seems to require inputs to which my package does not have access easily.

Any advice would be much appreciated!

@yihui yihui added the enhancement New feature or request label Feb 6, 2025
@yihui yihui closed this as completed in 3a8de85 Feb 6, 2025
@yihui
Copy link
Owner

yihui commented Feb 6, 2025

Done. litedown::get_context('format') gives you the format name now.

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