diff --git a/lib/DB.rakumod b/lib/DB.rakumod index 1b8fd90..b7bbb05 100644 --- a/lib/DB.rakumod +++ b/lib/DB.rakumod @@ -9,17 +9,7 @@ use JSON::Class:auth; 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)) {} diff --git a/lib/DB/IdrisPost.rakumod b/lib/DB/IdrisPost.rakumod new file mode 100644 index 0000000..e195dac --- /dev/null +++ b/lib/DB/IdrisPost.rakumod @@ -0,0 +1,18 @@ +use v6.e.PREVIEW; + +use Pandoc; +use JSON::Class:auth; + +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) +}