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

set QUARTO_PROJECT_ROOT to root of quarto project #8388

Closed
cscheid opened this issue Jan 22, 2024 · 1 comment · Fixed by #8525
Closed

set QUARTO_PROJECT_ROOT to root of quarto project #8388

cscheid opened this issue Jan 22, 2024 · 1 comment · Fixed by #8525
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cscheid
Copy link
Collaborator

cscheid commented Jan 22, 2024

This would allow

```{python}
from pathlib import Path
from os import getenv
import pandas as pd
df = pd.read_csv(Path(os.getenv("QUARTO_PROJECT_ROOT")) / "docs/computations/palmer-penguins.csv"))
```

The idea is to make referring to project-wide assets in computational content as convenient as a project-relative path in markdown, such as /docs/assets/logo.png.

@cscheid cscheid added the enhancement New feature or request label Jan 22, 2024
@cscheid cscheid added this to the v1.5 milestone Jan 22, 2024
@cscheid cscheid self-assigned this Jan 22, 2024
@cscheid
Copy link
Collaborator Author

cscheid commented Jan 31, 2024

the Path Python class is designed to be extensible. We could envision a quarto_cli Python package providing a QuartoProjectPath class that does this kind of path resolution.

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