import type { PlimiPlugin } from "../../core/plugins/plugin-types";
import { runMarkdownToHtml } from "./run";

export interface MarkdownToHtmlOptions {
  headingStyle?: "atx" | "setext";
}

export const markdownToHtmlPlugin: PlimiPlugin<MarkdownToHtmlOptions> = {
  manifest: {
    id: "txt-markdown",
    name: "Markdown to HTML",
    description: "Convert Markdown text to raw HTML without sending anything to a server.",
    category: "text",
    version: "1.0.0",
    tags: ["markdown", "html", "convert", "md"],
    input: { type: "text", placeholder: "Type or paste Markdown here..." },
    output: { type: "text" },
    example: "# Hello World\n\nThis is **bold** and *italic*.\n\n- Item 1\n- Item 2\n\n[Visit Plimi](https://plimi.app)",
    offlineReady: true,
  },

  optionsSchema: {
    fields: [],
  },

  capabilities: {
    cancelable: false,
    worker: false,
  },

  run: runMarkdownToHtml,
};
