mirror of
https://github.com/outline/outline.git
synced 2026-11-20 21:23:06 +03:00
* feat: Add Open Knowledge Format (OKF) import support Maps the OKF service onto the existing Markdown zip import pipeline. Document titles are now read from YAML frontmatter when present, for all Markdown-based imports. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Switch to Globe icon * Strip YAML frontmatter on import, derive import service labels from plugins - Remove frontmatter from the document body instead of converting it to a YAML codeblock - Drop a leading H1 that repeats the frontmatter title - Read plugin importer labels from their Hook.Imports registration --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import type { IntegrationService } from "@shared/types";
|
|
import type { ImportTask } from "@server/models";
|
|
import MarkdownAPIImportTask from "./MarkdownAPIImportTask";
|
|
|
|
// Supertype of the base task's generic so the `scheduleNextTask` override
|
|
// remains a valid override of MarkdownAPIImportTask's Markdown-typed method.
|
|
type Service = IntegrationService.Markdown | IntegrationService.OKF;
|
|
|
|
/**
|
|
* Imports an Open Knowledge Format (OKF) bundle.
|
|
*
|
|
* An OKF bundle is a directory tree of Markdown documents with YAML
|
|
* frontmatter, so all conversion (including frontmatter-based titles),
|
|
* attachment, and persistence logic is inherited from
|
|
* {@link MarkdownAPIImportTask}. This subclass exists so OKF imports are
|
|
* scheduled, traced, and retried under their own task name rather than the
|
|
* generic Markdown one.
|
|
*/
|
|
export default class OKFAPIImportTask extends MarkdownAPIImportTask {
|
|
protected async scheduleNextTask(
|
|
importTask: ImportTask<Service>
|
|
): Promise<void> {
|
|
await new OKFAPIImportTask().schedule({ importTaskId: importTask.id });
|
|
}
|
|
}
|