一键导入
md-to-lexical
Convert Shiroi Markdown to Haklex Lexical JSON. Use when the user wants to convert a markdown file or string to rich text editor JSON format.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Convert Shiroi Markdown to Haklex Lexical JSON. Use when the user wants to convert a markdown file or string to rich text editor JSON format.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when releasing @haklex/* packages or propagating published haklex versions into Yohaku, mx-core, mx-space, or related downstream consumers.
Use when writing Haklex articles with Markdown plus LiteXML, choosing the appropriate Haklex node for content, authoring LiteXML fragments, or converting a LightXML/LiteXML string or file into Lexical SerializedEditorState JSON, Markdown, or Static Render HTML via the `litexml` CLI.
Use when creating or modifying demo/ UI components — buttons, cards, panels, pills, inputs, badges. Reference for all component CSS classes and their exact specs.
Use when modifying demo/ UI — adding pages, components, or styles. Defines the monochrome visual system, layout patterns, and component conventions for the haklex demo site.
Use when adding or modifying colors, spacing, typography, or layout values in demo/ CSS. Complete token reference for the monochrome design system.
| name | md-to-lexical |
| description | Convert Shiroi Markdown to Haklex Lexical JSON. Use when the user wants to convert a markdown file or string to rich text editor JSON format. |
| user_invocable | true |
Converts Shiroi-flavored Markdown to Haklex's Lexical SerializedEditorState JSON.
Run the conversion script:
npx tsx scripts/md-to-lexical/index.ts <input.md> > output.json
Or pipe from stdin:
cat article.md | npx tsx scripts/md-to-lexical/index.ts - > output.json
| Markdown | Lexical Node |
| ---------------------------------------------- | ---------------------------------- | ---- | --------- | --- | ----------- |
| # heading | HeadingNode |
| paragraph | ParagraphNode |
| > quote | QuoteNode |
| > [!NOTE/TIP/WARNING/IMPORTANT/CAUTION] | AlertQuoteNode |
| - list / 1. list | ListNode |
| --- | HorizontalRuleNode |
| ```lang ``` | CodeBlockNode |
| ```mermaid ``` | MermaidNode |
|  | ImageNode |
|  | VideoNode (auto-detect) |
| <video src="..."> | VideoNode |
| | table | | TableNode |
| $eq$ | KaTeXInlineNode |
| $$eq$$ | KaTeXBlockNode |
| **bold**, *italic*, ~~strike~~ | text format flags |
| ++underline++, ==highlight== | text format flags |
| ^superscript^, ~subscript~ | text format flags |
| `code` | text format flag |
| | | text | | | SpoilerNode |
| [name]{GH@handle} | MentionNode |
| [^id] / [^id]: ... | FootnoteNode / FootnoteSectionNode |
| <ruby>base<rt>reading</rt></ruby> | RubyNode |
| <tag>text</tag> | TagNode |
| [text](url) | LinkNode |
| standalone URL paragraph | LinkCardNode |
| :::gallery/carousel | GalleryNode |
| :::warn/info/error/banner | BannerNode |
| :::grid{cols=N,gap=M} | GridContainerNode |
| :::masonry | GalleryNode (masonry) |
| <details><summary>...</summary>...</details> | DetailsNode |
| <Tabs><tab label="...">code</tab>...</Tabs> | CodeSnippetNode |
| <excalidraw>snapshot</excalidraw> | ExcalidrawNode |
| <nested-doc>content</nested-doc> | NestedDocNode |