-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"hash": "dffbc2f3ac6dbb7fa66abbc7bbb18bb1", | ||
"result": { | ||
"engine": "knitr", | ||
"markdown": "---\ntitle: \"How to create a GIF of code and its output\"\ndate: '2022-05-10'\ncategory: Other\n---\n\n\n\n\n\nWe can create a GIF of code and its output using [asciicast](https://github.com/r-lib/asciicast). \n\nInstall the development version:\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\nremotes::install_github('r-lib/asciicast', ref = remotes::github_pull(24)) \n```\n:::\n\n\n\n\n\nCreate a file called `nzchar.R` with specifications for the GIF and the code to run.\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\n#' Title: Using nzchar\n#' Columns: 60\n#' Rows: 18\n\n# This is not empty\nSys.getenv(\"R_LIBS_USER\")\n\n# This is empty\nSys.getenv(\"test\")\n\n# This returns TRUE\nnzchar(Sys.getenv(\"R_LIBS_USER\"))\n\n# This returns FALSE\nnzchar(Sys.getenv(\"test\"))\n```\n:::\n\n\n\n\n\nCreate another file that creates the GIF:\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\n#' Title: Using nzchar\n\nsrc <- \"nzchar.R\"\ncast <- asciicast::record(src)\n\n# <<\n# `cast` is an `asciicast` object, which has some metadata and the\n# recording itself:\n# <<\n\ncast\n\n# <<\n# You can write `cast` to a GIF file with the version installed above.\n# <<\n\nsvg <- tempfile(fileext = \"gif\")\nasciicast::write_gif(cast, svg, theme = \"monokai\")\n```\n:::\n\n\n\n\n\nReally fun for adding to tweets!\n\n{fig-alt=\"An animation created with asciicast that shows that nzchar() returns TRUE when a string is nonempty and FALSE when a string is empty, using Sys.getenv() to query existing 'R_LIBS_USER' and nonexisting 'test' environment variables.\"}\n", | ||
"supporting": [], | ||
"filters": [ | ||
"rmarkdown/pagebreak.lua" | ||
], | ||
"includes": {}, | ||
"engineDependencies": {}, | ||
"preserve": {}, | ||
"postProcess": true | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: "How to open a Quarto project in GitHub Codespaces" | ||
date: '2025-02-18' | ||
category: Other | ||
output: html_document | ||
--- | ||
|
||
I recently received a question on [YouTube](https://www.youtube.com/watch?v=uLGe9zuuNl0) about running a Quarto project in GitHub Codespaces. This was new to me, so I did some research (thanks to [Mickaël Canouil](https://github.com/mcanouil) and others for their help!). The key takeaway is that everything needs to be containerized: Quarto, Jupyter, the Quarto extension, R, Python, etc. Simply installing the VS Code Quarto extension is not enough. The easiest way to achieve this is by using the [quarto-codespaces](https://github.com/mcanouil/quarto-codespaces) repository. | ||
|
||
1. Fork Mickaël's `quarto-codespaces` repo: <https://github.com/mcanouil/quarto-codespaces> | ||
2. Click the green "Code" button, select "Codespaces," and then "Create codespace on main." | ||
|
||
 | ||
|
||
3. Click "Authorize" and continue. Creating the codespace may take a few minutes. | ||
|
||
 | ||
|
||
4. Once the codespace is ready, clone your Quarto project into it. For example, to clone the `water-insecurity-dashboard` project, run the following in the terminal: | ||
|
||
```bash | ||
git clone https://github.com/ivelasq/water-insecurity-dashboard.git | ||
``` | ||
|
||
5. Navigate to the project directory: `cd water-insecurity-dashboard` | ||
|
||
6. Create a new Python environment. In the Command Palette (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> or <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>), select "Python: Create Environment...". Choose "Venv" and the appropriate Python interpreter. **Very importantly,** make sure you check the box to install dependencies from `requirements.txt`. | ||
|
||
 | ||
|
||
7. Open your `.qmd` file (e.g., `final.qmd`) and click the "Preview" button in the top right. | ||
|
||
 | ||
|
||
That's it! Your Quarto project should now be running in GitHub Codespaces. | ||
|
||
 |
File renamed without changes
File renamed without changes.