diff options
| author | Paul Buetow <paul@buetow.org> | 2022-04-20 10:12:14 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2022-04-20 10:12:14 +0100 |
| commit | 6b0d4ee051f650b46af7ec50acf1122d44088fb5 (patch) | |
| tree | 6f44c35dcce84fac1d242ef356d3d06545678e80 /lib/Katana/HTML/Generate.rakumod | |
| parent | c6a252b79db57f3480221cf25213fb8c0993ac3a (diff) | |
modularize more
Diffstat (limited to 'lib/Katana/HTML/Generate.rakumod')
| -rw-r--r-- | lib/Katana/HTML/Generate.rakumod | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/Katana/HTML/Generate.rakumod b/lib/Katana/HTML/Generate.rakumod new file mode 100644 index 0000000..fb020b4 --- /dev/null +++ b/lib/Katana/HTML/Generate.rakumod @@ -0,0 +1,22 @@ +use v6.d; + +unit module Katana::HTML::Generate:api<1>; + +multi sub generate-from-tags(Str $doctype, @tags) is export { + say $doctype; + generate-from-tags @tags; +} + +multi sub generate-from-tags(@tags) is export { + my @sgat; # tags spelled in reverse. + for @tags -> $tag { + say $tag.open; + say $tag.text if $tag.has-text; + unshift @sgat, $tag; + } + for @sgat -> $tag { + say $tag.close; + generate-from-tags $tag.succ if $tag.has-succ; + } +} + |
