-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rakudoc-table plugin to render procedural tables
- Loading branch information
1 parent
6d5453a
commit c06cca1
Showing
14 changed files
with
210 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
=begin pod | ||
=TITLE grid-block is a plugin for Collection | ||
|
||
The plugin is to render the enhanced C<=table> block | ||
|
||
=end pod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
%( | ||
:auth<collection>, | ||
:authors( | ||
"finanalyst", | ||
), | ||
:custom-raku(), | ||
:license<Artistic-2.0>, | ||
:name<rakudoc-table>, | ||
:render, | ||
:css<css/rakudoc-table-light.css>, | ||
:template-raku<rakudoc-table-templates.raku>, | ||
:version<0.1.2>, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* Basic code colors */ | ||
.rakudoc-table .rakudoc-cell-center, .rakudoc-table .rakudoc-cell-centre { | ||
text-align: center; | ||
} | ||
.rakudoc-table .rakudoc-cell-left { | ||
text-align: left; | ||
} | ||
.rakudoc-table .rakudoc-cell-right { | ||
text-align: right; | ||
} | ||
.rakudoc-table .rakudoc-cell-top { | ||
vertical-align: top; | ||
} | ||
.rakudoc-table .rakudoc-cell-bottom { | ||
vertical-align: bottom; | ||
} | ||
.rakudoc-table .rakudoc-cell-middle { | ||
vertical-align: middle; | ||
} | ||
.rakudoc-table .rakudoc-cell-label { | ||
text-align: left; | ||
vertical-align: middle; | ||
font-weight: 600; | ||
} | ||
.rakudoc-table.table tbody th { | ||
text-align: center; | ||
vertical-align: middle; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* Basic code colors */ | ||
.rakudoc-table .rakudoc-cell-center, .rakudoc-table .rakudoc-cell-centre { | ||
text-align: center; | ||
} | ||
.rakudoc-table .rakudoc-cell-left { | ||
text-align: left; | ||
} | ||
.rakudoc-table .rakudoc-cell-right { | ||
text-align: right; | ||
} | ||
.rakudoc-table .rakudoc-cell-top { | ||
vertical-align: top; | ||
} | ||
.rakudoc-table .rakudoc-cell-bottom { | ||
vertical-align: bottom; | ||
} | ||
.rakudoc-table .rakudoc-cell-middle { | ||
vertical-align: middle; | ||
} | ||
.rakudoc-table .rakudoc-cell-label { | ||
text-align: left; | ||
vertical-align: middle; | ||
font-weight: 600; | ||
} | ||
.rakudoc-table.table tbody th { | ||
text-align: center; | ||
vertical-align: middle; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env raku | ||
use v6.d; | ||
%( | ||
'table' => sub (%prm, %tml) { | ||
if %prm<procedural> { | ||
my $rv = "\n<table class=\"table is-bordered centered rakudoc-table { %prm<class> // '' }\">"; | ||
$rv ~= "\n<caption>$_\</caption>" with %prm<caption>; | ||
for %prm<grid>.list -> @row { | ||
$rv ~= "\n<tr>"; | ||
for @row -> $cell { | ||
next if $cell<no-cell>; | ||
my $content; | ||
$content ~= ' colspan="' ~ $cell<span>[0] ~'"' if $cell<span>:exists and $cell<span>[0] != 1; | ||
$content ~= ' rowspan="' ~ $cell<span>[1] ~'"' if $cell<span>:exists and $cell<span>[1] != 1; | ||
$content ~= ' class="'; | ||
with $cell<align> { for .list { | ||
$content ~= "rakudoc-cell-$_ " | ||
} } | ||
$content ~= 'rakudoc-cell-label' if $cell<label>; | ||
$content ~= '">' ~ $cell<data>; | ||
if $cell<header> { | ||
$rv ~= "<th$content\</th>" | ||
} | ||
else { | ||
$rv ~= "<td$content\</td>" | ||
} | ||
} | ||
$rv ~= "</tr>" | ||
} | ||
$rv ~= "</table>\n"; | ||
} | ||
else { | ||
'<table class="table is-bordered centered' | ||
~ ((%prm<class>.defined and %prm<class> ne '') ?? (' ' ~ %tml<escaped>.(%prm<class>)) !! '') | ||
~ '">' | ||
~ ((%prm<caption>.defined and %prm<caption> ne '') ?? ('<caption>' ~ %prm<caption> ~ '</caption>') !! '') | ||
~ ((%prm<headers>.defined and %prm<headers> ne '') ?? | ||
("\t<thead>\n" | ||
~ [~] %prm<headers>.map({ "\t\t<tr><th>" ~ .<cells>.join('</th><th>') ~ "</th></tr>\n" }) | ||
~ "\t</thead>" | ||
) !! '') | ||
~ "\t<tbody>\n" | ||
~ ((%prm<rows>.defined and %prm<rows> ne '') ?? | ||
[~] %prm<rows>.map({ "\t\t<tr><td>" ~ .<cells>.join('</td><td>') ~ "</td></tr>\n" }) | ||
!! '') | ||
~ "\t</tbody>\n" | ||
~ "</table>\n" | ||
} | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.rakudoc-table { | ||
.rakudoc-cell-center, .rakudoc-cell-centre { | ||
text-align: center; | ||
} | ||
.rakudoc-cell-left { | ||
text-align: left; | ||
} | ||
.rakudoc-cell-right { | ||
text-align: right; | ||
} | ||
.rakudoc-cell-top { | ||
vertical-align: top; | ||
} | ||
.rakudoc-cell-bottom { | ||
vertical-align: bottom; | ||
} | ||
.rakudoc-cell-middle { | ||
vertical-align: middle; | ||
} | ||
.rakudoc-cell-label { | ||
text-align: left; | ||
vertical-align: middle; | ||
font-weight: 600; | ||
} | ||
&.table tbody th { | ||
text-align: center; | ||
vertical-align: middle; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Common theme colors | ||
|
||
$black: #030303; | ||
$black-bis: #1B1D1E; | ||
$black-ter: #212426; | ||
|
||
$grey-darker: #3A3D4E; | ||
$grey-dark: #83858D; | ||
$grey: #cccccc; | ||
$grey-light: #d8d8d8; | ||
$grey-lighter: #e5e5e5; | ||
$grey-lightest: #f2f2f2; | ||
|
||
$white-ter: #f5f5f5; | ||
$white-bis: #f7f7f7; | ||
$white: #fafafa; | ||
|
||
$orange: hsl(14, 100%, 53%); | ||
$yellow: #EED891; | ||
$green: #1C6301; | ||
$turquoise: #005C43; | ||
$cyan: hsl(204, 71%, 53%); | ||
$blue: #004FB3; | ||
$purple: #5503B3; | ||
$red: #A30031; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* Basic code colors */ | ||
@import '_themes-colors.scss'; | ||
|
||
|
||
@import '_rakudoc-table.scss'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Basic code colors */ | ||
@import '_themes-colors.scss'; | ||
|
||
@import '_rakudoc-table.scss'; |