Skip to content

Commit

Permalink
Detect Jupytext header more robustly.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Sep 18, 2024
1 parent d82a708 commit a79edb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion convert_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a79edb3

Please sign in to comment.