Skip to content

Instantly share code, notes, and snippets.

@JJ JJ/address.p6
Created Dec 2, 2017

Embed
What would you like to do?
Extract heading from a markdown-marked letter
use v6;
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
You can’t perform that action at this time.