. */ declare(strict_types=1); namespace Fisharebest\Webtrees\CommonMark; use League\CommonMark\Environment\EnvironmentBuilderInterface; use League\CommonMark\Extension\ConfigurableExtensionInterface; use League\Config\ConfigurationBuilderInterface; /** * Convert webtrees 1.x census-assistant markup into tables. * Note that webtrees 2.0 generates markdown tables directly. * * .start_formatted_area. * .b.HEADING1|.b.HEADING2|.b.HEADING3 * COL1|COL2|COL3 * COL1|COL2|COL3 * .end_formatted_area. */ class CensusTableExtension implements ConfigurableExtensionInterface { // Keywords used to create the webtrees 1.x census-assistant notes. public const string CA_PREFIX = '.start_formatted_area.'; public const string CA_SUFFIX = '.end_formatted_area.'; public const string TH_PREFIX = '.b.'; /** * The core TableExtension will already have configured tables. * * @param ConfigurationBuilderInterface $builder */ public function configureSchema(ConfigurationBuilderInterface $builder): void { } /** * Assumes we have also registered the core TableExtension. * * @param EnvironmentBuilderInterface $environment */ public function register(EnvironmentBuilderInterface $environment): void { $environment->addBlockStartParser(new CensusTableStartParser()); } }