You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This event is called just before any CodeMirror instances are initialised so that the instance configuration can be viewed and altered before the instance is created.
260
+
261
+
#### Event Data
262
+
263
+
-`usage` - A string label to identify the usage type of the CodeMirror instance in BookStack.
264
+
-`editorViewConfig` - A reference to the [EditorViewConfig](https://codemirror.net/docs/ref/#view.EditorViewConfig) that will be used to create the instance.
265
+
-`libEditorView` - The CodeMirror [EditorView](https://codemirror.net/docs/ref/#view.EditorView) class object, provided for convenience.
266
+
-`libEditorState` - The CodeMirror [EditorState](https://codemirror.net/docs/ref/#state.EditorState) class object, provided for convenience.
267
+
-`libCompartment` - The CodeMirror [Compartment](https://codemirror.net/docs/ref/#state.Compartment) class object, provided for convenience.
268
+
269
+
##### Example
270
+
271
+
The below shows how you'd enable the built-in line wrapping extension for page content code blocks:
This event is called just after any CodeMirror instances are initialised so that you're able to gain a reference to the CodeMirror EditorView instance.
292
+
293
+
#### Event Data
294
+
295
+
-`usage` - A string label to identify the usage type of the CodeMirror instance in BookStack.
296
+
-`editorView` - A reference to the [EditorView](https://codemirror.net/docs/ref/#view.EditorView) instance that has been created.
297
+
-`editorViewConfig` - A reference to the [EditorViewConfig](https://codemirror.net/docs/ref/#view.EditorViewConfig) that was used to create the instance.
298
+
-`libEditorView` - The CodeMirror [EditorView](https://codemirror.net/docs/ref/#view.EditorView) class object, provided for convenience.
299
+
-`libEditorState` - The CodeMirror [EditorState](https://codemirror.net/docs/ref/#state.EditorState) class object, provided for convenience.
300
+
-`libCompartment` - The CodeMirror [Compartment](https://codemirror.net/docs/ref/#state.Compartment) class object, provided for convenience.
301
+
302
+
##### Example
303
+
304
+
The below shows how you'd prepend some default text to all content (page) code blocks.
0 commit comments