add render method
This commit is contained in:
parent
6d9e32bb12
commit
72607c7f25
4 changed files with 22 additions and 0 deletions
|
@ -16,3 +16,9 @@ has Bool:D $.idris = True;
|
||||||
method title(--> Str:D) {
|
method title(--> Str:D) {
|
||||||
markdown-title($!source)
|
markdown-title($!source)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Use katla to highlight our file, mangle the resulting output, and then pass it
|
||||||
|
# through to pandoc for html generation
|
||||||
|
method render-html(--> Str:D) {
|
||||||
|
die "Not implemented";
|
||||||
|
}
|
||||||
|
|
|
@ -15,3 +15,8 @@ has Bool:D $.markdown = True;
|
||||||
method title(--> Str:D) {
|
method title(--> Str:D) {
|
||||||
markdown-title($!source)
|
markdown-title($!source)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Simply provide our source file to pandoc
|
||||||
|
method render-html(--> Str:D) {
|
||||||
|
die "Not implemented";
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,9 @@ unit class PlaceholderPost does Post is json(:pretty);
|
||||||
#| cheaty way
|
#| cheaty way
|
||||||
has Bool:D $.placeholder = True;
|
has Bool:D $.placeholder = True;
|
||||||
|
|
||||||
|
#| An optional body for the placeholder post
|
||||||
|
has Str $.body;
|
||||||
|
|
||||||
method title(--> Str:D) {
|
method title(--> Str:D) {
|
||||||
"Placeholder Article"
|
"Placeholder Article"
|
||||||
}
|
}
|
||||||
|
@ -30,3 +33,8 @@ method empty(--> PlaceholderPost:D) {
|
||||||
method all-slugs(--> Array[Str:D]) {
|
method all-slugs(--> Array[Str:D]) {
|
||||||
Array[Str:D].new
|
Array[Str:D].new
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Return the body if there is one, the empty string if there isn't one
|
||||||
|
method render-html(--> Str:D) {
|
||||||
|
$!body // ''
|
||||||
|
}
|
||||||
|
|
|
@ -50,3 +50,6 @@ method all-slugs(--> Array[Str:D]) {
|
||||||
@slugs.push($long-title-slug);
|
@slugs.push($long-title-slug);
|
||||||
@slugs;
|
@slugs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#| Render this post to an html body
|
||||||
|
method render-html(--> Str:D) {...}
|
||||||
|
|
Loading…
Add table
Reference in a new issue