diff --git a/bin/synopsis-rahx b/bin/synopsis-rahx index 8f776ed..814a707 100755 --- a/bin/synopsis-rahx +++ b/bin/synopsis-rahx @@ -4,7 +4,7 @@ use v6.d; use HTMX; - +say list-regulars; say h1('text', :class); say h1 :class; diff --git a/lib/HTMX.rakumod b/lib/HTMX.rakumod index 35d7bd2..b144da3 100644 --- a/lib/HTMX.rakumod +++ b/lib/HTMX.rakumod @@ -17,16 +17,16 @@ constant @all-tags = ; -my @regular-tags = (@all-tags.Set (-) @singular-tags.Set ).List; +my @regular-tags = (@all-tags.Set (-) @singular-tags.Set).keys; sub list-tags is export {@all-tags.sort } sub list-singulars is export { @singular-tags.sort } -sub list-regulars is export { @regular-tags.sort } +sub list-regulars is export { @regular-tags } # Export them so that `h1("text")` makes `

text

` and so on # eg sub h1(Str $inner) {do-tag 'h1', $inner} -sub do-tag( $tag, $inner?, *%h ) { +sub do-regular-tag( $tag, $inner?, *%h ) { my $attrs = +%h ?? (' ' ~ %h.map({.key ~ '="' ~ .value ~ '"'}).join(' ') ) !! ''; @@ -37,8 +37,8 @@ sub do-tag( $tag, $inner?, *%h ) { # viz. https://docs.raku.org/language/modules#Exporting_and_selective_importing my package EXPORT::DEFAULT { - for @all-tags -> $tag { - OUR::{'&' ~ $tag} := sub ($inner?, *%h) { do-tag( "$tag", $inner, |%h ) } + for @regular-tags -> $tag { + OUR::{'&' ~ $tag} := sub ($inner?, *%h) { do-regular-tag( "$tag", $inner, |%h ) } } }