「Text::FrontMatter::YAML」の版間の差分
提供: dsk's note
細 |
細 |
||
| 29行目: | 29行目: | ||
tag: [city, night, photography] | tag: [city, night, photography] | ||
--- | --- | ||
| + | $yf =~/^-{3}${1}(.*?)-{3}${1}/#Triple-dashedを含まない | ||
| + | $yf =~/^(-{3}${1}.*?-{3})${1}/#Triple-dashedを含む | ||
| + | |||
</pre> | </pre> | ||
[[Category: perl]] | [[Category: perl]] | ||
{{google/ad/01}} | {{google/ad/01}} | ||
2015年5月14日 (木) 16:01時点における版
#!/usr/bin/perl use File::Slurp; use Text::FrontMatter::YAML; # READING my $text_with_frontmatter = read_file("item.md"); my $tfm = Text::FrontMatter::YAML->new( document_string => $text_with_frontmatter ); my $metadata = $tfm->frontmatter_hashref; print qq(This is $metadata->{title}\n); print qq(This is $metadata->{date}\n); print qq(This is $metadata->{taxonomy}->{category}\n); print qq(This is $metadata->{taxonomy}->{tag}\n);
---
title: London Industry at Night
date: 13:34 06/07/2014
taxonomy:
category: blog
tag: [city, night, photography]
---
$yf =~/^-{3}${1}(.*?)-{3}${1}/#Triple-dashedを含まない
$yf =~/^(-{3}${1}.*?-{3})${1}/#Triple-dashedを含む