createEditor
createEditor<
T>(container?,options?, …extensions?):PrismEditor<T>
Defined in: core.ts:23
Creates a code editor using the specified container and options.
Type Parameters
Section titled “Type Parameters”T extends object = { }
Parameters
Section titled “Parameters”container?
Section titled “container?”Element to append the editor to or a selector.
This can also be a ShadowRoot or DocumentFragment for example.
If omitted, you must manually append editor.container to the DOM.
string | ParentNode | null
options?
Section titled “options?”Options the editor is initialized with.
If omitted, the editor won’t function until you call editor.setOptions.
Partial<EditorOptions<T>> & Omit<T, keyof EditorOptions> | null
extensions?
Section titled “extensions?”…EditorExtension<T>[]
Extensions added before the first render. You can still add extensions later.
Returns
Section titled “Returns”PrismEditor<T>
Object to interact with the created editor.