aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrançois Kooman <fkooman@tuxed.net>2019-10-11 14:16:47 +0200
committerFrançois Kooman <fkooman@tuxed.net>2019-10-11 14:16:47 +0200
commitec3829807ad6a27dcabb749767ee513055bbb727 (patch)
tree5551997db0a6815e0ae882002dfaf9f79960429b
parentee6b9cbcb250e4728242df4982a07074c6f50646 (diff)
downloadwww.tuxed.net-ec3829807ad6a27dcabb749767ee513055bbb727.zip
www.tuxed.net-ec3829807ad6a27dcabb749767ee513055bbb727.tar.gz
www.tuxed.net-ec3829807ad6a27dcabb749767ee513055bbb727.tar.xz
update commonmark, enable table extension, add table css
-rw-r--r--bin/generate.php6
-rw-r--r--composer.json4
-rw-r--r--composer.lock254
-rw-r--r--css/screen.css16
-rw-r--r--views/page.php2
-rw-r--r--views/post.php2
6 files changed, 244 insertions, 40 deletions
diff --git a/bin/generate.php b/bin/generate.php
index a7ad295..4c7400f 100644
--- a/bin/generate.php
+++ b/bin/generate.php
@@ -3,10 +3,11 @@
require_once dirname(__DIR__).'/vendor/autoload.php';
$baseDir = dirname(__DIR__);
-use fkooman\Tpl\Template;
+use fkooman\Template\Tpl;
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use League\CommonMark\Ext\SmartPunct\SmartPunctExtension;
+use League\CommonMark\Ext\Table\TableExtension;
$cgitRepoWebUrl = 'https://git.tuxed.net/fkooman/www.tuxed.net/';
$dateTime = new DateTime();
@@ -24,9 +25,10 @@ $templateDir = sprintf('%s/views', $baseDir);
$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new SmartPunctExtension());
+$environment->addExtension(new TableExtension());
$converter = new CommonMarkConverter([], $environment);
-$templates = new Template([$templateDir]);
+$templates = new Tpl([$templateDir]);
$templates->addDefault(
[
'blogTitle' => 'François\' Blog',
diff --git a/composer.json b/composer.json
index 6a74e4c..d8fc8ad 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
],
"require": {
"fkooman/tpl": "dev-master",
- "league/commonmark": "^0.19",
- "league/commonmark-extras": "^0.3.0"
+ "league/commonmark": "^1",
+ "league/commonmark-extras": "^1"
}
}
diff --git a/composer.lock b/composer.lock
index 96f46d5..8a0ec4e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "49ec32d73c26f14e9c5d8641e7973a83",
+ "content-hash": "a68739cce0396fa57819b874db881b9a",
"packages": [
{
"name": "fkooman/tpl",
@@ -12,7 +12,7 @@
"source": {
"type": "git",
"url": "https://git.tuxed.net/fkooman/php-tpl",
- "reference": "3183ad815e30baa8bc660c11af2c04d72ef57935"
+ "reference": "f1b54e1577fde06bccac767aa4e884ee73258a1a"
},
"require": {
"php": ">=5.4"
@@ -23,12 +23,12 @@
"type": "library",
"autoload": {
"psr-4": {
- "fkooman\\Tpl\\": "src/"
+ "fkooman\\Template\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
- "fkooman\\Tpl\\Tests\\": "tests/"
+ "fkooman\\Template\\Tests\\": "tests/"
}
},
"license": [
@@ -45,20 +45,20 @@
"email": "fkooman@tuxed.net",
"source": "https://git.tuxed.net/fkooman/php-tpl"
},
- "time": "2019-04-01T16:31:15+00:00"
+ "time": "2019-09-02T09:33:49+00:00"
},
{
"name": "league/commonmark",
- "version": "0.19.1",
+ "version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
- "reference": "d42b2d4a5d0a8eb2a4514f828ecb6f5db13a7c6f"
+ "reference": "7a40f2b0931602c504c2a9692d9f1e33635fd5ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d42b2d4a5d0a8eb2a4514f828ecb6f5db13a7c6f",
- "reference": "d42b2d4a5d0a8eb2a4514f828ecb6f5db13a7c6f",
+ "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/7a40f2b0931602c504c2a9692d9f1e33635fd5ef",
+ "reference": "7a40f2b0931602c504c2a9692d9f1e33635fd5ef",
"shasum": ""
},
"require": {
@@ -88,7 +88,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "0.20-dev"
+ "dev-master": "1.1-dev"
}
},
"autoload": {
@@ -115,24 +115,24 @@
"markdown",
"parser"
],
- "time": "2019-04-11T04:37:01+00:00"
+ "time": "2019-06-29T11:19:01+00:00"
},
{
"name": "league/commonmark-ext-autolink",
- "version": "v0.3.0",
+ "version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark-ext-autolink.git",
- "reference": "a49a2d116b6211dab7e019d1c563526eefe31da6"
+ "reference": "9f6da88485412b1c37a982c9fee8f4fbc2fa5ade"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/commonmark-ext-autolink/zipball/a49a2d116b6211dab7e019d1c563526eefe31da6",
- "reference": "a49a2d116b6211dab7e019d1c563526eefe31da6",
+ "url": "https://api.github.com/repos/thephpleague/commonmark-ext-autolink/zipball/9f6da88485412b1c37a982c9fee8f4fbc2fa5ade",
+ "reference": "9f6da88485412b1c37a982c9fee8f4fbc2fa5ade",
"shasum": ""
},
"require": {
- "league/commonmark": "^0.19",
+ "league/commonmark": "^1.0",
"php": "^7.1"
},
"require-dev": {
@@ -141,7 +141,7 @@
"type": "commonmark-extension",
"extra": {
"branch-alias": {
- "dev-master": "0.4-dev"
+ "dev-master": "1.1-dev"
}
},
"autoload": {
@@ -172,24 +172,24 @@
"markdown",
"twitter"
],
- "time": "2019-04-11T02:46:12+00:00"
+ "time": "2019-06-29T11:23:54+00:00"
},
{
"name": "league/commonmark-ext-smartpunct",
- "version": "v0.2.0",
+ "version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark-ext-smartpunct.git",
- "reference": "92806c302f39e9bb1b8fcdfb6fa7cb36de856744"
+ "reference": "3746a86c91903fe200999a992de064f87b352019"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/commonmark-ext-smartpunct/zipball/92806c302f39e9bb1b8fcdfb6fa7cb36de856744",
- "reference": "92806c302f39e9bb1b8fcdfb6fa7cb36de856744",
+ "url": "https://api.github.com/repos/thephpleague/commonmark-ext-smartpunct/zipball/3746a86c91903fe200999a992de064f87b352019",
+ "reference": "3746a86c91903fe200999a992de064f87b352019",
"shasum": ""
},
"require": {
- "league/commonmark": "^0.19",
+ "league/commonmark": "^1.0",
"php": "^7.1"
},
"require-dev": {
@@ -199,7 +199,7 @@
"type": "commonmark-extension",
"extra": {
"branch-alias": {
- "dev-master": "0.3-dev"
+ "dev-master": "1.2-dev"
}
},
"autoload": {
@@ -228,26 +228,212 @@
"punctuation",
"smartpunct"
],
- "time": "2019-04-11T02:51:38+00:00"
+ "time": "2019-10-03T12:57:34+00:00"
+ },
+ {
+ "name": "league/commonmark-ext-strikethrough",
+ "version": "v1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/commonmark-ext-strikethrough.git",
+ "reference": "99892ad549e101fe1fbe424ff71224efc32d2d68"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/commonmark-ext-strikethrough/zipball/99892ad549e101fe1fbe424ff71224efc32d2d68",
+ "reference": "99892ad549e101fe1fbe424ff71224efc32d2d68",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "league/commonmark": "^1.0",
+ "php": "^7.1"
+ },
+ "replace": {
+ "uafrica/commonmark-ext": ">=0.1.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.5"
+ },
+ "type": "commonmark-extension",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "League\\CommonMark\\Ext\\Strikethrough\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Colin O'Dell",
+ "email": "colinodell@gmail.com"
+ },
+ {
+ "name": "Johan Meiring",
+ "email": "johan@uafrica.com"
+ }
+ ],
+ "description": "Strikethrough support for the PHP League's CommonMark Markdown parser",
+ "homepage": "https://github.com/thephpleague/commonmark-ext-strikethrough",
+ "keywords": [
+ "commonmark",
+ "extension",
+ "markdown",
+ "strikeout",
+ "strikethrough"
+ ],
+ "time": "2019-06-29T11:34:00+00:00"
+ },
+ {
+ "name": "league/commonmark-ext-table",
+ "version": "v2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/commonmark-ext-table.git",
+ "reference": "3228888ea69636e855efcf6636ff8e6316933fe7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/commonmark-ext-table/zipball/3228888ea69636e855efcf6636ff8e6316933fe7",
+ "reference": "3228888ea69636e855efcf6636ff8e6316933fe7",
+ "shasum": ""
+ },
+ "require": {
+ "league/commonmark": "~0.19.3|^1.0",
+ "php": "^7.1"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2.14",
+ "phpstan/phpstan": "~0.11",
+ "phpunit/phpunit": "^7.0|^8.0",
+ "symfony/var-dumper": "^4.0",
+ "vimeo/psalm": "^3.0"
+ },
+ "type": "commonmark-extension",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "League\\CommonMark\\Ext\\Table\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Martin Hasoň",
+ "email": "martin.hason@gmail.com"
+ },
+ {
+ "name": "Webuni s.r.o.",
+ "homepage": "https://www.webuni.cz"
+ },
+ {
+ "name": "Colin O'Dell",
+ "email": "colinodell@gmail.com",
+ "homepage": "https://www.colinodell.com"
+ }
+ ],
+ "description": "Table extension for league/commonmark",
+ "homepage": "https://github.com/thephpleague/commonmark-ext-table",
+ "keywords": [
+ "commonmark",
+ "extension",
+ "markdown",
+ "table"
+ ],
+ "time": "2019-09-26T13:28:33+00:00"
+ },
+ {
+ "name": "league/commonmark-ext-task-list",
+ "version": "v1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/commonmark-ext-task-list.git",
+ "reference": "9fe28f3527ab913b60d44bdc8d66829733cad7c6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/commonmark-ext-task-list/zipball/9fe28f3527ab913b60d44bdc8d66829733cad7c6",
+ "reference": "9fe28f3527ab913b60d44bdc8d66829733cad7c6",
+ "shasum": ""
+ },
+ "require": {
+ "league/commonmark": "^0.19|^1.0",
+ "php": "^7.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.5"
+ },
+ "type": "commonmark-extension",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "League\\CommonMark\\Ext\\TaskList\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Colin O'Dell",
+ "email": "colinodell@gmail.com",
+ "homepage": "https://www.colinodell.com",
+ "role": "Lead Developer"
+ }
+ ],
+ "description": "Extension for league/commonmark which supports GFM-style task lists",
+ "homepage": "https://github.com/thephpleague/commonmark-ext-task-list",
+ "keywords": [
+ "Lists",
+ "commonmark",
+ "extension",
+ "gfm",
+ "github",
+ "markdown",
+ "task"
+ ],
+ "time": "2019-07-11T00:35:13+00:00"
},
{
"name": "league/commonmark-extras",
- "version": "0.3.0",
+ "version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark-extras.git",
- "reference": "9af6b88593af6f26f36be5d9682a9fc4d03c4b68"
+ "reference": "4947edfb292d6f38b309cd63c64d7b08558df315"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/commonmark-extras/zipball/9af6b88593af6f26f36be5d9682a9fc4d03c4b68",
- "reference": "9af6b88593af6f26f36be5d9682a9fc4d03c4b68",
+ "url": "https://api.github.com/repos/thephpleague/commonmark-extras/zipball/4947edfb292d6f38b309cd63c64d7b08558df315",
+ "reference": "4947edfb292d6f38b309cd63c64d7b08558df315",
"shasum": ""
},
"require": {
- "league/commonmark": "^0.19.1",
- "league/commonmark-ext-autolink": "^0.3",
- "league/commonmark-ext-smartpunct": "^0.2",
+ "league/commonmark": "^1.0",
+ "league/commonmark-ext-autolink": "^1.0",
+ "league/commonmark-ext-smartpunct": "^1.0",
+ "league/commonmark-ext-strikethrough": "^1.0",
+ "league/commonmark-ext-table": "^2.0",
+ "league/commonmark-ext-task-list": "^1.0",
"php": "^7.1"
},
"require-dev": {
@@ -256,7 +442,7 @@
"type": "commonmark-extension",
"extra": {
"branch-alias": {
- "dev-master": "0.4-dev"
+ "dev-master": "1.2-dev"
}
},
"autoload": {
@@ -285,7 +471,7 @@
"gfm",
"markdown"
],
- "time": "2019-04-11T04:39:21+00:00"
+ "time": "2019-07-13T11:56:05+00:00"
}
],
"packages-dev": [],
diff --git a/css/screen.css b/css/screen.css
index 908854f..257bbee 100644
--- a/css/screen.css
+++ b/css/screen.css
@@ -111,7 +111,23 @@ pre {
}
table {
+ border: 1px solid #ccc;
width: 100%;
+ border-collapse: collapse;
+ margin: 1em 0;
+}
+
+thead tr {
+ background-color: #eee;
+ color: #555;
+}
+
+td, th {
+ padding: 0.8em 0.5em;
+}
+
+tbody tr:nth-child(even) {
+ background-color: #f4f4f4;
}
p.center {
diff --git a/views/page.php b/views/page.php
index c44e3a3..9c74cc7 100644
--- a/views/page.php
+++ b/views/page.php
@@ -2,4 +2,4 @@
<?php $this->start('content'); ?>
<h2><?php echo $this->e($pageTitle); ?></h2>
<?php echo $pageContent['htmlContent']; ?>
-<?php $this->stop(); ?>
+<?php $this->stop('content'); ?>
diff --git a/views/post.php b/views/post.php
index 9471d37..491dc07 100644
--- a/views/post.php
+++ b/views/post.php
@@ -12,4 +12,4 @@
<p class="center"><small>Last Modified on <?php echo $this->e($post['modified']); ?></small></p>
<?php endif; ?>
<p class="center"><small><a href="<?php echo $this->e($post['postHistory']); ?>">History</a></small></p>
-<?php $this->stop(); ?>
+<?php $this->stop('content'); ?>