Last active
December 3, 2025 20:34
-
-
Save andrewheiss/ef3ac7dfef2fdb8477a84e7e27f6853e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Required parameters: | |
| # @raycast.schemaVersion 1 | |
| # @raycast.title Create Positron playground project | |
| # @raycast.mode silent | |
| # Optional parameters: | |
| # @raycast.argument1 { "type": "text", "placeholder": "Project folder name" } | |
| # @raycast.icon 🛝 | |
| # Documentation: | |
| # @raycast.description Create ~/Development/• Mini projects/• 2025 playground/MM/DD/<folder> and open in Positron | |
| # @raycast.author andrewheiss | |
| # Check if folder name is provided | |
| if [ -z "$1" ]; then | |
| echo "Error: No folder name provided" | |
| exit 1 | |
| fi | |
| # Get the current date in MM/DD format | |
| current_date=$(date +%m/%d) | |
| # And get it as ISO-8601 for the YAML | |
| yaml_date=$(date +%Y-%m-%d) | |
| # Build the full path | |
| full_path="$HOME/Development/• Mini projects/• 2025 playground/$current_date/$1" | |
| # Create the directory | |
| mkdir -p "$full_path" | |
| # Create index.qmd with template | |
| cat > "$full_path/index.qmd" << EOF | |
| --- | |
| title: "TITLE HERE" | |
| date: $yaml_date | |
| description: "DESCRIPTION HERE (150-160 characters)" | |
| image: "img/BLAH.png" | |
| twitter-card: | |
| image: "img/BLAH.png" | |
| open-graph: | |
| image: "img/BLAH.png" | |
| categories: | |
| - SOMETHING | |
| # doi: DOI HERE | |
| citation: true | |
| --- | |
| \`\`\`{r} | |
| #| label: setup | |
| #| include: false | |
| knitr::opts_chunk$set( | |
| fig.width = 6, | |
| fig.height = 6 * 0.618, | |
| fig.retina = 3, | |
| dev = "ragg_png", | |
| fig.align = "center", | |
| out.width = "90%", | |
| collapse = TRUE, | |
| cache.extra = 1234 # Change number to invalidate cache | |
| ) | |
| options( | |
| digits = 4, | |
| width = 300, | |
| dplyr.summarise.inform = FALSE | |
| ) | |
| \`\`\` | |
| CONTENT HERE | |
| EOF | |
| # Open the folder in Positron | |
| positron "$full_path" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Slight improvement on the folder naming scheme. You can enter the title in sentence format (or whatever you want), and this will format into date-slug (first five words) and auto-title the post (use
$1as the title).