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

feature: fallback value for the env shortcode #8316

Closed
cscheid opened this issue Jan 17, 2024 Discussed in #8315 · 0 comments · Fixed by #8319
Closed

feature: fallback value for the env shortcode #8316

cscheid opened this issue Jan 17, 2024 Discussed in #8315 · 0 comments · Fixed by #8319
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cscheid
Copy link
Collaborator

cscheid commented Jan 17, 2024

Discussed in #8315

Originally posted by aronatkins January 17, 2024

Description

The env shortcode does not allow a fallback value.

In R, we might:

Sys.getenv("FRUIT", "apples")

In Python, we might:

os.environ.get("FRUIT", "apples")

In simple Quarto documents (using the Markdown engine), we do not have either of these options. If the document were accompanied by a _quarto.yml file (and seen as a "project"), that document could use an _environment file to provide default environment values. The _environment file is only processed for projects, not standalone documents.

Proposal: Extend the env shortcode to allow a fallback value.

(awesome website)[{{< env TARGET_URL "https://quarto.org/" >}}]
@cscheid cscheid added the enhancement New feature or request label Jan 17, 2024
@cscheid cscheid added this to the v1.5 milestone Jan 17, 2024
@cscheid cscheid self-assigned this Jan 17, 2024
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

Successfully merging a pull request may close this issue.

1 participant