1656793f4SSungbin Jeon<?php 2656793f4SSungbin Jeon 3656793f4SSungbin Jeondeclare(strict_types=1); 4656793f4SSungbin Jeon 5656793f4SSungbin Jeon/* 6656793f4SSungbin Jeon * This file is part of the clockoon/dokuwiki-commonmark-plugin package. 7656793f4SSungbin Jeon * 8656793f4SSungbin Jeon * (c) Sungbin Jeon <clockoon@gmail.com> 9656793f4SSungbin Jeon * 10656793f4SSungbin Jeon * Original code based on the followings: 11656793f4SSungbin Jeon * - CommonMark JS reference parser (https://bitly.com/commonmark-js) (c) John MacFarlane 12656793f4SSungbin Jeon * - league/commonmark (https://github.com/thephpleague/commonmark) (c) Colin O'Dell <colinodell@gmail.com> 13656793f4SSungbin Jeon * - Commonmark Table extension (c) Martin Hasoň <martin.hason@gmail.com>, Webuni s.r.o. <info@webuni.cz>, Colin O'Dell <colinodell@gmail.com> 14656793f4SSungbin Jeon * 15656793f4SSungbin Jeon * For the full copyright and license information, please view the LICENSE 16656793f4SSungbin Jeon * file that was distributed with this source code. 17656793f4SSungbin Jeon */ 18656793f4SSungbin Jeon 19656793f4SSungbin Jeonnamespace DokuWiki\Plugin\Commonmark\Extension; 20656793f4SSungbin Jeon 2194a075eeSSungbin Jeonuse League\CommonMark\Environment\EnvironmentBuilderInterface; 22656793f4SSungbin Jeonuse League\CommonMark\Extension\ExtensionInterface; 23*b0a36678SSungbin Jeonuse League\CommonMark\Extension\Table\TableStartParser; 24656793f4SSungbin Jeonuse League\CommonMark\Extension\Table\Table; 25656793f4SSungbin Jeonuse League\CommonMark\Extension\Table\TableCell; 26656793f4SSungbin Jeonuse League\CommonMark\Extension\Table\TableRow; 27656793f4SSungbin Jeonuse League\CommonMark\Extension\Table\TableSection; 28656793f4SSungbin Jeonuse Dokuwiki\Plugin\Commonmark\Extension\Renderer\Block\TableRenderer; 29656793f4SSungbin Jeonuse Dokuwiki\Plugin\Commonmark\Extension\Renderer\Block\TableSectionRenderer; 30656793f4SSungbin Jeonuse Dokuwiki\Plugin\Commonmark\Extension\Renderer\Block\TableRowRenderer; 31656793f4SSungbin Jeonuse Dokuwiki\Plugin\Commonmark\Extension\Renderer\Block\TableCellRenderer; 32656793f4SSungbin Jeon 33656793f4SSungbin Jeonfinal class TableExtension implements ExtensionInterface 34656793f4SSungbin Jeon{ 3594a075eeSSungbin Jeon public function register(EnvironmentBuilderInterface $environment): void 36656793f4SSungbin Jeon { 37656793f4SSungbin Jeon $environment 38*b0a36678SSungbin Jeon ->addBlockStartParser(new TableStartParser()) 39656793f4SSungbin Jeon 40*b0a36678SSungbin Jeon ->addRenderer(Table::class, new TableRenderer()) 41*b0a36678SSungbin Jeon ->addRenderer(TableSection::class, new TableSectionRenderer()) 42*b0a36678SSungbin Jeon ->addRenderer(TableRow::class, new TableRowRenderer()) 43*b0a36678SSungbin Jeon ->addRenderer(TableCell::class, new TableCellRenderer()) 44656793f4SSungbin Jeon ; 45656793f4SSungbin Jeon } 46656793f4SSungbin Jeon} 47