summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-03-27 20:04:56 +0300
committerPaul Buetow <paul@buetow.org>2023-03-27 20:04:56 +0300
commitb7f807f2cacca287bb654062527fa5b5c194d190 (patch)
tree664e5a5e5e17c764ac5bdf53e7a725e326c623ef
parent08b31315b19a98d709201e13071aab9f7449f7d0 (diff)
add Gemtext output format
-rw-r--r--guprecords.raku11
1 files 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 <Host OS OSMajor Uname>;
enum Metric <Boots Uptime MetaScore Downtime Lifespan>;
-enum OutputFormat <Plaintext Markdown>;
+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 {