Move IdrisPost to its own file
This commit is contained in:
parent
f767eeb589
commit
22952a01f7
2 changed files with 19 additions and 11 deletions
|
@ -9,17 +9,7 @@ use JSON::Class:auth<zef:vrurg>;
|
|||
use DB::Post;
|
||||
use DB::BlogMeta;
|
||||
use DB::MarkdownPost;
|
||||
|
||||
#| A plain markdown post
|
||||
class IdrisPost does Post is json {
|
||||
#| Marker for disambiguation between post types in json representation, the
|
||||
#| cheaty way
|
||||
has Bool:D $.idris = True;
|
||||
|
||||
method title(--> Str:D) {
|
||||
markdown-title($!source)
|
||||
}
|
||||
}
|
||||
use DB::IdrisPost;
|
||||
|
||||
class Posts is json(:dictionary(:keyof(Int:D), MarkdownPost:D, IdrisPost:D)) {}
|
||||
|
||||
|
|
18
lib/DB/IdrisPost.rakumod
Normal file
18
lib/DB/IdrisPost.rakumod
Normal file
|
@ -0,0 +1,18 @@
|
|||
use v6.e.PREVIEW;
|
||||
|
||||
use Pandoc;
|
||||
use JSON::Class:auth<zef:vrurg>;
|
||||
|
||||
use DB::Post;
|
||||
|
||||
#| A literate, markdown, idris post
|
||||
|
||||
unit class IdrisPost does Post is json;
|
||||
|
||||
#| Marker for disambiguation between post types in json representation, the
|
||||
#| cheaty way
|
||||
has Bool:D $.idris = True;
|
||||
|
||||
method title(--> Str:D) {
|
||||
markdown-title($!source)
|
||||
}
|
Loading…
Add table
Reference in a new issue