From a79edb3119dd3a646560e2c8ae2ce1b764b991bf Mon Sep 17 00:00:00 2001 From: Dan Allan Date: Wed, 18 Sep 2024 11:43:38 -0400 Subject: [PATCH] Detect Jupytext header more robustly. --- convert_all.sh | 2 +- test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/convert_all.sh b/convert_all.sh index 3844fe0..6d1f329 100755 --- a/convert_all.sh +++ b/convert_all.sh @@ -13,7 +13,7 @@ if [ "$1" = "ipynb" ]; then files=$(find docs/ -name "*.md" | grep -v .ipynb_checkpoints) for file in $files; do # Extract the kernel information from the Jupytext Markdown file - kernel_info=$(grep -A 10 '^---$' "$file" | grep -E 'kernelspec') + kernel_info=$(head -n 15 "$file" | grep -A 10 '^---$' | grep -E 'kernelspec') # Skip if no kernel information was found if [ -z "$kernel_info" ]; then continue diff --git a/test.sh b/test.sh index 6b11e72..2f8c5ce 100755 --- a/test.sh +++ b/test.sh @@ -33,7 +33,7 @@ if [ "$1" == "--all" ]; then for file in $files; do if [ -f "$file" ]; then # Extract the kernel information from the Jupytext Markdown file - kernel_info=$(grep -A 10 '^---$' "$file" | grep -E 'kernelspec') + kernel_info=$(head -n 15 "$file" | grep -A 10 '^---$' | grep -E 'kernelspec') # Skip if no kernel information was found if [ -z "$kernel_info" ]; then continue