exportNamespace( $_POST['sf_namespace'], null, array( 'recursive' => !empty($_POST['sf_recursive']), 'include_media' => !empty($_POST['sf_include_media']) ) ); $this->message = 'Export created: ' . hsc($result['name']) . ' (' . (int)$result['count'] . ' pages).'; $this->download = $result['name']; } catch (Exception $e) { $this->message = 'SkillForge export failed: ' . hsc($e->getMessage()); } } } public function html() { /** @var helper_plugin_skillforge $helper */ $helper = plugin_load('helper', 'skillforge'); $namespaces = $helper ? $helper->listNamespaces() : array(); $selectedNamespace = isset($_POST['sf_namespace']) ? $_POST['sf_namespace'] : ''; ptln('
Export a DokuWiki namespace as an AI-ready Markdown package with SKILL.md, index.md, skill.json and optional media. ZIP creation uses an internal ZIP writer and does not require PHP ZipArchive.
'); if ($this->message) ptln('If the button does not start a download, copy/open this link in a new tab: ' . hsc($url) . '
<frontmatter>\nname: my-skill\ndescription: What this skill helps the AI do.\nversion: 1.0.0\ntags:\n - ai\n - dokuwiki\n</frontmatter>'); } }