You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It shouldn't be too hard to yank all of the notebooks and put them into one quarto folder
#!/bin/bash# Turn an Observable Notebook Collection into a directory of Quarto projects## Provide the ""@user/collection" as the only command line argument and# this script will create directories below the current directory filled with # Quarto projects made with ohq2quarto## System Requirements:# - htmlq # https://github.com/mgdm/htmlq# - jq # https://stedolan.github.io/jq/# - ohq2quarto # https://github.com/hrbrmstr/ohq2quartoif [ -z"$1" ]
thenecho"Usage: col2quarto.sh @user/collection"exitfi
curl --silent "https://observablehq.com/collection/$1"| \
htmlq --text "script#__NEXT_DATA__"| \
jq -r '.props.pageProps.collection.listings.results[] | "https://observablehq.com/@" + (.owner.login) + "/" + (.slug) '| \
whileread -r OBS_URL
do
SLUG="$(basename "${OBS_URL}")"
ohq2quarto --ohq-ref "${OBS_URL}" --output-dir "${SLUG}"done
The text was updated successfully, but these errors were encountered:
It appears that the collection info is also present in the embedded JSON:
Example Collections JSON
It shouldn't be too hard to yank all of the notebooks and put them into one quarto folder
The text was updated successfully, but these errors were encountered: