MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / createConfig

Function createConfig

app/src/components/diffHtml.tsx:124–140  ·  view source on GitHub ↗
(
	doc: string,
	theme: 'light' | 'dark',
	extensions: Array<Extension | LRLanguage>,
)

Source from the content-addressed store, hash-verified

122}
123
124function createConfig(
125 doc: string,
126 theme: 'light' | 'dark',
127 extensions: Array<Extension | LRLanguage>,
128) {
129 const maybeDark = theme === 'dark' ? [oneDark] : []
130 return {
131 doc,
132 extensions: [
133 [...basicSetup],
134 EditorView.editable.of(false),
135 EditorState.readOnly.of(true),
136 ...maybeDark,
137 [...(doc === '' ? [] : extensions)], // no need for any extensions if template is empty
138 ],
139 }
140}

Callers 1

MergeCompFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected