Repository navigation
|
Hello What is the best way to extract the first Example: -> The expected output is I tried
Thank you... |
Answered by
harehare
Dec 28, 2025
Replies: 2 comments 3 replies
|
Hi! You can extract the first sh code block using: The -A flag aggregates all nodes into a single array, then filter selects for sh blocks, and first() returns the first one. |
1 reply
Answer selected by
ruzickap
|
@harehare is there any practical difference between the following 4: Which would be the preferred/canonical form? |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! You can extract the first sh code block using:
The -A flag aggregates all nodes into a single array, then filter selects for sh blocks, and first() returns the first one.
However, I feel that the current syntax is a bit cumbersome, so I’m considering ways to make it easier to use in the future.