initial COmmit: Add KB Antora Importer plugin files

This commit is contained in:
Sven Steinert
2026-05-12 14:37:09 +02:00
parent cf253c1367
commit 6abf6f9c3d
39 changed files with 2945 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
/**
* Plugin Name: KB Antora Importer
* Description: Imports GitLab/Antora based AsciiDoc documentation into WordPress as a versioned knowledgebase.
* Version: 0.1.0
* Requires PHP: 8.1
* Author: Codex
* Text Domain: kb-antora-importer
*/
declare(strict_types=1);
if (! defined('ABSPATH')) {
exit;
}
define('KB_ANTORA_IMPORTER_VERSION', '0.1.0');
define('KB_ANTORA_IMPORTER_FILE', __FILE__);
define('KB_ANTORA_IMPORTER_DIR', plugin_dir_path(__FILE__));
define('KB_ANTORA_IMPORTER_URL', plugin_dir_url(__FILE__));
spl_autoload_register(static function (string $class): void {
$prefix = 'KbAntoraImporter\\';
if (0 !== strncmp($class, $prefix, strlen($prefix))) {
return;
}
$relative = substr($class, strlen($prefix));
$path = KB_ANTORA_IMPORTER_DIR . 'includes/' . str_replace('\\', '/', $relative) . '.php';
if (is_readable($path)) {
require_once $path;
}
});
register_activation_hook(__FILE__, [KbAntoraImporter\Plugin::class, 'activate']);
register_deactivation_hook(__FILE__, [KbAntoraImporter\Plugin::class, 'deactivate']);
add_action('plugins_loaded', static function (): void {
KbAntoraImporter\Plugin::instance()->boot();
});