37 lines
848 B
Raku
37 lines
848 B
Raku
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(:pretty);
|
|
|
|
#| Marker for disambiguation between post types in json representation, the
|
|
#| cheaty way
|
|
has Bool:D $.idris = True;
|
|
|
|
#| Location of the ipkg for the package containing the post
|
|
has IO::Path:D $.ipkg
|
|
is required
|
|
is json(
|
|
:to-json(*.Str),
|
|
:from-json(*.IO)
|
|
);
|
|
|
|
method title(--> Str:D) {
|
|
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) {
|
|
# Do a pack build to make sure we have the needed files
|
|
# TODO: Figure out how to only do this once
|
|
|
|
# Run through katla
|
|
# Send output
|
|
die "Not implemented";
|
|
}
|