MarkdownScrollableEditView
Extends
Extended by
Properties
_children
_children:
Component
[]
Child Components attached to current component, will be unloaded on unloading parent component
Inherited from
_events
_events:
EventRef
[]
Events that are attached to the current component, will be detached on unloading parent component
Inherited from
_loaded
_loaded:
boolean
Whether the component and its children are loaded
Inherited from
app
app:
App
Reference to the app
Inherited from
cleanupLivePreview
cleanupLivePreview:
null
| () =>void
Callback to clear all elements
Inherited from
MarkdownBaseView
.cleanupLivePreview
clipboardManager
clipboardManager:
ClipBoardManager
Manager that handles pasting text, html and images into the editor
Inherited from
MarkdownBaseView
.clipboardManager
cm
cm:
EditorView
Codemirror editor instance
Inherited from
cmInit
cmInit:
boolean
Whether CodeMirror is initialized
Inherited from
containerEl
containerEl:
HTMLElement
Container element of the editor view
Inherited from
cssClasses
cssClasses: []
List of CSS classes applied to the editor
cursorPopupEl
cursorPopupEl:
null
|HTMLElement
Popup element for internal link
Inherited from
MarkdownBaseView
.cursorPopupEl
editor?
optional
editor:Editor
Obsidian editor instance
Inherited from
editorEl
editorEl:
HTMLElement
Element in which the CodeMirror editor resides
Inherited from
editorSuggest
editorSuggest:
EditorSuggests
Editor suggester for autocompleting files, links, aliases, etc.
Inherited from
MarkdownBaseView
.editorSuggest
isScrolling
isScrolling:
boolean
Whether the editor is currently scrolling
livePreviewPlugin
livePreviewPlugin:
Extension
[]
The CodeMirror plugins that handle the rendering of, and interaction with Obsidian’s Markdown
Inherited from
MarkdownBaseView
.livePreviewPlugin
localExtensions
localExtensions:
Extension
[]
Local (always active) extensions for the editor
Inherited from
MarkdownBaseView
.localExtensions
owner
owner:
MarkdownFileInfo
Controller of the editor view
Inherited from
scope
scope:
undefined
|Scope
Scope for the search component, if exists
search
search:
EditorSearchComponent
Search component for the editor, provides highlight and search functionality
sizerEl
sizerEl:
HTMLElement
Container for the editor, handles editor size
sourceMode
sourceMode:
boolean
Whether live preview rendering is disabled
Inherited from
tableCell
tableCell:
null
|TableCellEditor
Reference to editor attached to table cell, if any
Inherited from
Accessors
activeCM
get
activeCM():EditorView
Currently active CM instance (table cell CM or main CM)
Returns
EditorView
Inherited from
file
get
file():null
|TFile
Returns attached file of the owner instance
Returns
null
| TFile
Inherited from
path
get
path():string
Returns path of the attached file
Returns
string
Inherited from
Methods
addChild()
addChild<
T
>(component
):T
Adds a child component, loading it if this component is loaded
Type Parameters
• T extends Component
Parameters
• component: T
Returns
T
Inherited from
applyFoldInfo()
applyFoldInfo(
info
):void
Apply fold history to editor
Parameters
• info: FoldInfo
Returns
void
Inherited from
MarkdownBaseView
.applyFoldInfo
applyScroll()
applyScroll(
scroll
):void
Set the scroll count of the editor scrollbar
Parameters
• scroll: number
Returns
void
buildLocalExtensions()
buildLocalExtensions():
Extension
[]
Constructs local (always active) extensions for the editor
Returns
Extension
[]
Overrides
MarkdownBaseView
.buildLocalExtensions
clear()
clear():
void
Cleanup live preview, remove and then re-add all editor extensions
Returns
void
Inherited from
destroy()
destroy():
void
Clean up live preview, remove all extensions, destroy editor
Returns
void
Inherited from
destroyTableCell()
destroyTableCell(
cell
?):void
Removes specified tablecell
Parameters
• cell?: TableCellEditor
Returns
void
Inherited from
MarkdownBaseView
.destroyTableCell
editTableCell()
editTableCell(
cell
,new_cell
):TableCellEditor
Edit a specified table cell, creating a table cell editor
Parameters
• cell: TableEditor
• new_cell: TableCell
Returns
Inherited from
MarkdownBaseView
.editTableCell
focus()
focus():
void
Focus the editor (and for mobile: render keyboard)
Returns
void
get()
get():
string
Get the current editor document as a string
Returns
string
Inherited from
getDynamicExtensions()
getDynamicExtensions():
Extension
[]
Constructs extensions for the editor based on user settings
Returns
Extension
[]
Overrides
MarkdownBaseView
.getDynamicExtensions
getFoldInfo()
getFoldInfo():
null
|FoldInfo
Get the current folds of the editor
Returns
null
| FoldInfo
Inherited from
getLocalExtensions()
getLocalExtensions():
unknown
Builds all local extensions and assigns to this.localExtensions
Returns
unknown
Inherited from
MarkdownBaseView
.getLocalExtensions
getScroll()
getScroll():
number
Get the current scroll count of the editor scrollbar
Returns
number
handleScroll()
handleScroll():
void
Invokes onMarkdownScroll on scroll
Returns
void
hide()
hide():
void
Hides the editor (sets display: none)
Returns
void
load()
load():
void
Load this component and its children
Returns
void
Inherited from
onContextMenu()
onContextMenu(
event
,x
):Promise
<void
>
Creates menu on right mouse click
Parameters
• event: PointerEvent
• x: boolean
Returns
Promise
<void
>
Inherited from
MarkdownBaseView
.onContextMenu
onCssChange()
onCssChange():
void
Clear editor cache and refreshes editor on app css change
Returns
void
onEditorClick()
onEditorClick(
event
,element
?):void
Execute click functionality on token on mouse click
Parameters
• event: MouseEvent
• element?: HTMLElement
Returns
void
Inherited from
MarkdownBaseView
.onEditorClick
onEditorDragStart()
onEditorDragStart(
event
):void
Execute drag functionality on drag start
Parameters
• event: DragEvent
Returns
void
Inherited from
MarkdownBaseView
.onEditorDragStart
onEditorLinkMouseover()
onEditorLinkMouseover(
event
,target
):void
Execute hover functionality on mouse over event
Parameters
• event: MouseEvent
• target: HTMLElement
Returns
void
Inherited from
MarkdownBaseView
.onEditorLinkMouseover
onload()
onload():
void
Override this to load your component
Returns
void
Inherited from
onMenu()
onMenu(
event
):void
Execute context menu functionality on right mouse click
Parameters
• event: MouseEvent
Returns
void
Inherited from
onResize()
onResize():
void
Update editor size and bottom padding on resize
Returns
void
Overrides
onScroll()
onScroll():
void
Update editor suggest position and invokes handleScroll on scroll
Returns
void
onunload()
onunload():
void
Override this to unload your component
Returns
void
Inherited from
onUpdate()
onUpdate(
update
,changed
):void
Execute functionality on CM editor state update
Parameters
• update: ViewUpdate
• changed: boolean
Returns
void
Overrides
onViewClick()
onViewClick(
event
?):void
Close editor suggest and removes highlights on click
Parameters
• event?: MouseEvent
Returns
void
register()
register(
cb
):void
Registers a callback to be called when unloading
Parameters
• cb
Returns
void
Inherited from
registerDomEvent()
registerDomEvent(el, type, callback, options)
registerDomEvent<
K
>(el
,type
,callback
,options
?):void
Registers an DOM event to be detached when unloading
Type Parameters
• K extends keyof WindowEventMap
Parameters
• el: Window
• type: K
• callback
• options?: boolean
| AddEventListenerOptions
Returns
void
Inherited from
MarkdownBaseView
.registerDomEvent
registerDomEvent(el, type, callback, options)
registerDomEvent<
K
>(el
,type
,callback
,options
?):void
Registers an DOM event to be detached when unloading
Type Parameters
• K extends keyof DocumentEventMap
Parameters
• el: Document
• type: K
• callback
• options?: boolean
| AddEventListenerOptions
Returns
void
Inherited from
MarkdownBaseView
.registerDomEvent
registerDomEvent(el, type, callback, options)
registerDomEvent<
K
>(el
,type
,callback
,options
?):void
Registers an DOM event to be detached when unloading
Type Parameters
• K extends keyof HTMLElementEventMap
Parameters
• el: HTMLElement
• type: K
• callback
• options?: boolean
| AddEventListenerOptions
Returns
void
Inherited from
MarkdownBaseView
.registerDomEvent
registerEvent()
registerEvent(
eventRef
):void
Registers an event to be detached when unloading
Parameters
• eventRef: EventRef
Returns
void
Inherited from
MarkdownBaseView
.registerEvent
registerInterval()
registerInterval(
id
):number
Registers an interval (from setInterval) to be cancelled when unloading Use setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
Parameters
• id: number
Returns
number
Inherited from
MarkdownBaseView
.registerInterval
registerScopeEvent()
registerScopeEvent(
keymapEventHandler
):void
Parameters
• keymapEventHandler: KeymapEventHandler
Returns
void
Inherited from
MarkdownBaseView
.registerScopeEvent
reinit()
reinit():
void
Reinitialize the editor inside new container
Returns
void
Inherited from
removeChild()
removeChild<
T
>(component
):T
Removes a child component, unloading it
Type Parameters
• T extends Component
Parameters
• component: T
Returns
T
Inherited from
reparent()
reparent(
new_container
):void
Move the editor into the new container
Parameters
• new_container: HTMLElement
Returns
void
Inherited from
resetSyntaxHighlighting()
resetSyntaxHighlighting():
void
Bodge to reset the syntax highlighting
Returns
void
Inherited from
MarkdownBaseView
.resetSyntaxHighlighting
set()
set(
data
,clear
):void
Set the state of the editor
Parameters
• data: string
• clear: boolean
Returns
void
Inherited from
setCssClass()
setCssClass(
classes
):void
Add classes to the editor, functions as a toggle
Parameters
• classes: string
[]
Returns
void
show()
show():
void
Reveal the editor (sets display: block)
Returns
void
showSearch()
showSearch(
replace
):void
Reveal the search (and replace) component
Parameters
• replace: boolean
Returns
void
toggleFoldFrontmatter()
toggleFoldFrontmatter():
void
Enables/disables frontmatter folding
Returns
void
Inherited from
MarkdownBaseView
.toggleFoldFrontmatter
toggleSource()
toggleSource():
void
Toggle source mode for editor and dispatch effect
Returns
void
Inherited from
triggerClickableToken()
triggerClickableToken(
token
,new_leaf
):void
Execute functionality of token (open external link, open internal link in leaf, …)
Parameters
• token: Token
• new_leaf: boolean
Returns
void
Inherited from
MarkdownBaseView
.triggerClickableToken
unload()
unload():
void
Unload this component and its children
Returns
void
Inherited from
updateBottomPadding()
updateBottomPadding(
height
):void
Update the bottom padding of the CodeMirror contentdom
Parameters
• height: number
Returns
void
updateLinkPopup()
updateLinkPopup():
void
In mobile, creates a popover link on clickable token, if exists
Returns
void
Inherited from
MarkdownBaseView
.updateLinkPopup
updateOptions()
updateOptions():
void
Reconfigure/re-add all the dynamic extensions
Returns
void