Last active
November 23, 2022 10:41
-
-
Save JJ/1e03af7cdd9d64799e832a3216aeeb26 to your computer and use it in GitHub Desktop.
Extract heading from a markdown-marked letter
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
use Text::Markdown; | |
sub MAIN( Str $letter-to-santa = 'letters/dear-santa.md' ) { | |
my $letter = Text::Markdown::Document.new($letter-to-santa.IO.slurp()); | |
say so $letter.items.grep( { $^þ ~~ Text::Markdown::Heading } ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment