com web/pres2: Add column-count to lists: pres2reveal
| From: | Rasmus Lerdorf | Date: | Sun, 16 Sep 2018 14:53:53 +0000 |
| Subject: | com web/pres2: Add column-count to lists: pres2reveal | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-2289@lists.php.net to get a copy of this message | ||
Commit: 8e9cee03f48101cb56929a2f723421e2f4f6b9a6
Author: Rasmus Lerdorf <rasmus@php.net> Sun, 16 Sep 2018 07:53:53 -0700
Parents: e7e33d7e85e373be9c9a54ec0a82d199ae0055d9
Branches: master
Link: http://git.php.net/?p=web/pres2.git;a=commitdiff;h=8e9cee03f48101cb56929a2f723421e2f4f6b9a6
Log:
Add column-count to lists
Changed paths:
M pres2reveal
Diff:
diff --git a/pres2reveal b/pres2reveal
index 53526c8..cbbcf2c 100755
--- a/pres2reveal
+++ b/pres2reveal
@@ -145,7 +145,7 @@ function render_link($link) {
}
function render_list($e) {
- $ret = '';
+ $ret = $columns = '';
if(!empty($e['title'])) {
$style = $align = '';
if(!empty($e['fontsize'])) $style .= "font-size:
".$e['fontsize'].';';
@@ -154,7 +154,11 @@ function render_list($e) {
if(!empty($align)) $align = " align=\"$align\"";
$ret .= "\t\t<div $align
style=\"$style\">".markup_text($e['title'])."</div>\n";
}
- $ret .= "\t\t<ul>\n";
+ if(!empty($e['column-count'])) {
+ $gap = $e['column-gap'] ?? "1.8em";
+ $columns = "
style=\"column-count:{$e['column-count']};column-gap:{$gap}\"";
+ }
+ $ret .= "\t\t<ul{$columns}>\n";
foreach($e->item as $v) {
$text = markup_text((string)$v);
$ret .= "\t\t\t<li>$text</li>\n";