コンテンツにスキップ

Package API

Oxiquill は ESM-only です。node_modules/oxiquill 配下の file を直接 import せず、package export map を使ってください。

ExportPublic API
oxiquilldefineOxiquillConfig, oxiquillIntegration
oxiquill/astro同じ function と OxiquillConfig、OxiquillIntegrationOptions、OxiquillFrameworkOptions、OxiquillMarkdownConfig、OxiquillPathOptions、OxiquillPythonOptions type
oxiquill/contentcreateOxiquillCollections と OxiquillContentDependencies、OxiquillCollections type
oxiquill/runtime/InteractiveCellinteractive-cell remark transform が使う Preact component
oxiquill/runtime/MermaidDiagramMermaid remark transform が使う Preact renderer
oxiquill/runtime/typescell manifest、input、worker message、artifact、table、chart の TypeScript type
oxiquill/components/starlight/PageFrameOxiquill の Starlight page-frame override
oxiquill/components/starlight/TwoColumnContentOxiquill の折りたたみ可能な desktop 目次 layout override
oxiquill/components/starlight/LanguageSelect翻訳のある page だけを示す language select。missingTranslations: 'omit' で設定
oxiquill/components/starlight/translation-route-middlewaremissingTranslations: 'omit' で設定する Starlight route middleware
oxiquill/styles/katex.cssdefault integration が読み込む KaTeX style
oxiquill/styles/custom.cssruntime、output、media、page-frame の style
oxiquill/styles/japanese.css任意の日本語組版 style。starlight.customCss に追加します(日本語の組版)
oxiquill/tsconfigs/strictconsumer project 用 strict TypeScript base config
oxiquill/envOxiquill virtual module と asset import の ambient declaration

component、style、environment export は高度な composition 用の public API です。通常の project では defineOxiquillConfig() が読み込むため、手動 import は不要です。ただし oxiquill/styles/japanese.css は、サイトが明示的に追加して使います。

完全な site には defineOxiquillConfig(options) を使い、必須の framework.starlight integration factory を渡します。Oxiquill integration、Preact、Starlight の順に追加し、その後に consumer integration を追加します。field と優先順位は プロジェクト設定 を参照してください。

手動で Astro config を組み立てる場合だけ oxiquillIntegration(options) を使います。Markdown transform、virtual module、runtime generation、Wasm build、Vite resolution、license output を提供しますが、Preact と Starlight は自動追加しません。

不正な framework integration factory と未対応の custom Markdown processor は TypeError になります。config load や path conflict は生成 file を書く前に失敗します。

通常は dependency-injected API で Starlight docs collection を作ります。

import { defineCollection } from 'astro:content';
import { docsLoader } from '@astrojs/starlight/loaders';
import { docsSchema } from '@astrojs/starlight/schema';
import { createOxiquillCollections } from 'oxiquill/content';
export const collections = createOxiquillCollections({ defineCollection, docsLoader, docsSchema });

createOxiquillCollections({ defineCollection, docsLoader, docsSchema }) が通常の content API です。注入された Starlight loader/schema を使う { docs } を返します。

oxiquill/runtime/types は generated manifest、worker、renderer 間の public wire shape を定義します。TypeScript が producer を受け入れても runtime value は untrusted として扱われ、artifact validation と resource limit が適用されます。完全な契約は 実行可能セル と リッチ出力 を参照してください。