From b7f807f2cacca287bb654062527fa5b5c194d190 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 27 Mar 2023 20:04:56 +0300 Subject: add Gemtext output format --- guprecords.raku | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/guprecords.raku b/guprecords.raku index 67171e7..64816a4 100644 --- a/guprecords.raku +++ b/guprecords.raku @@ -5,7 +5,7 @@ use v6.d; enum Category ; enum Metric ; -enum OutputFormat ; +enum OutputFormat <Plaintext Markdown Gemtext>; subset MetricSubset of Metric where * ne any (Downtime, Lifespan); subset Natural of Int where * >= 0; @@ -98,8 +98,13 @@ role OutputFormatter { has OutputFormat $.output-format is required; has Natural $.header-indent = 1; - method output-header { $.output-format ~~ Markdown ?? '#' x $.header-indent ~ ' ' !! '' } - method output-block { $.output-format ~~ Markdown ?? '```' !! '' } + method output-header { + ($.output-format ~~ any (Markdown, Gemtext)) ?? '#' x $.header-indent ~ ' ' !! '' + } + + method output-block { + ($.output-format ~~ any (Markdown, Gemtext)) ?? '```' !! '' + } } class Reporter does OutputFormatter { -- cgit v1.2.3