com web/pres2: Add column-count to lists: pres2reveal

[email protected] (Rasmus Lerdorf) Sun, 16 Sep 2018 14:53:53 +0000
Newsgroups php.pres
Message-ID <[email protected]>
Commit:    8e9cee03f48101cb56929a2f723421e2f4f6b9a6
Author:    Rasmus Lerdorf <[email protected]>         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";