obsidian package

Classes

ClassDescription
AbstractTextComponent
App
ButtonComponent
CapacitorAdapterImplementation of the vault adapter for mobile devices.
ColorComponentColor picker component. Values are by default 6-digit hash-prefixed hex strings like #000000.
Component
DropdownComponent
Events
ExtraButtonComponent
FileManagerManage the creation, deletion and renaming of files from the UI.
FileSystemAdapterImplementation of the vault adapter for desktop.
HoverPopover
KeymapManages keymap lifecycle for different Scopes.
MarkdownEditViewThis is the editor for Obsidian Mobile as well as the upcoming WYSIWYG editor.
MarkdownPreviewRenderer
MarkdownPreviewView
MarkdownRenderChild
MarkdownView
Menu
MenuItem
MenuSeparator
MetadataCacheLinktext is any internal link that is composed of a path and a subpath, such as β€˜My note#Heading’ Linkpath (or path) is the path part of a linktext Subpath is the heading/block ID part of a linktext.
Modal
MomentFormatComponent
NoticeNotification component. Use to present timely, high-value information.
ProgressBarComponent
ScopeA scope receives keyboard events and binds callbacks to given hotkeys. Only one scope is active at a time, but scopes may define parent scopes (in the constructor) and inherit their hotkeys.
SearchComponent
Setting
SliderComponent
Tasks
TextAreaComponent
TextComponent
TFile
TFolder
ToggleComponent
VaultWork with files and folders stored inside a vault.
Workspace
WorkspaceFloating
WorkspaceLeaf
WorkspaceMobileDrawer
WorkspaceRibbon
WorkspaceRoot
WorkspaceSidedock
WorkspaceSplit
WorkspaceTabs
WorkspaceWindow

Abstract Classes

Abstract ClassDescription
AbstractInputSuggestAttach to an <input> element or a <div contentEditable> to add type-ahead support.
BaseComponent
EditableFileView
EditorA common interface that bridges the gap between CodeMirror 5 and CodeMirror 6.
EditorSuggest
FileView
FuzzySuggestModal
ItemView
MarkdownRenderer
Plugin
PluginSettingTabProvides a unified interface for users to configure the plugin.
PopoverSuggestBase class for adding a type-ahead popover.
SettingTab
SuggestModal
TAbstractFileThis can be either a TFile or a TFolder.
TextFileView

This class implements a plaintext-based editable file view, which can be loaded and saved given an editor.

Note that by default, this view only saves when it’s closing. To implement auto-save, your editor should call this.requestSave() when the content is changed.

ValueComponent
View
WorkspaceContainer
WorkspaceItem
WorkspaceParent

Enumerations

EnumerationDescription
PopoverState

Functions

FunctionDescription
addIcon(iconId, svgContent)Adds an icon to the library.
arrayBufferToBase64(buffer)
arrayBufferToHex(data)
base64ToArrayBuffer(base64)
debounce(cb, timeout, resetTimer)A standard debounce function. Use this to have a time-delayed function only be called once in a given timeframe.
displayTooltip(newTargetEl, content, options)

Manually trigger a tooltip that will appear over the provided element.

To display a tooltip on hover, use setTooltip() instead.

finishRenderMath()Flush the MathJax stylesheet.
getAllTags(cache)Combines all tags from frontmatter and note content into a single array.
getBlobArrayBuffer(blob)
getFrontMatterInfo(content)Given the contents of a file, get information about the frontmatter of the file, including whether there is a frontmatter block, the offsets of where it starts and ends, and the frontmatter text.
getIcon(iconId)Create an SVG from an iconId. Returns null if no icon associated with the iconId.
getIconIds()Get the list of registered icons.
getLanguage()Get the ISO code for the currently configured app language. Defaults to β€˜en’. See https://github.com/obsidianmd/obsidian-translations?tab=readme-ov-file#existing-languages for list of options.
getLinkpath(linktext)Converts the linktext to a linkpath.
hexToArrayBuffer(hex)
htmlToMarkdown(html)Converts HTML to a Markdown string.
iterateCacheRefs(cache, cb)Iterate links and embeds. If callback returns true, the iteration process will be interrupted.
iterateRefs(refs, cb)If callback returns true, the iteration process will be interrupted.
loadMathJax()Load MathJax.
loadMermaid()Load Mermaid and return a promise to the global mermaid object. Can also use mermaid after this promise resolves to get the same reference.
loadPdfJs()Load PDF.js and return a promise to the global pdfjsLib object. Can also use window.pdfjsLib after this promise resolves to get the same reference.
loadPrism()Load Prism.js and return a promise to the global Prism object. Can also use Prism after this promise resolves to get the same reference.
normalizePath(path)
parseFrontMatterAliases(frontmatter)
parseFrontMatterEntry(frontmatter, key)
parseFrontMatterStringArray(frontmatter, key, nospaces)
parseFrontMatterTags(frontmatter)
parseLinktext(linktext)Parses the linktext of a wikilink into its component parts.
parseYaml(yaml)
prepareFuzzySearch(query)Construct a fuzzy search callback that runs on a target string. Performance may be an issue if you are running the search for more than a few thousand times. If performance is a problem, consider using prepareSimpleSearch instead.
prepareSimpleSearch(query)Construct a simple search callback that runs on a target string.
removeIcon(iconId)Remove a custom icon from the library.
renderMatches(el, text, matches, offset)
renderMath(source, display)Render some LaTeX math using the MathJax engine. Returns an HTMLElement. Requires calling finishRenderMath when rendering is all done to flush the MathJax stylesheet.
renderResults(el, text, result, offset)
request(request)Similar to fetch(), request a URL using HTTP/HTTPS, without any CORS restrictions. Returns the text value of the response.
requestUrl(request)Similar to fetch(), request a URL using HTTP/HTTPS, without any CORS restrictions.
requireApiVersion(version)Returns true if the API version is equal or higher than the requested version. Use this to limit functionality that require specific API versions to avoid crashing on older Obsidian builds.
resolveSubpath(cache, subpath)Resolve the given subpath to a reference in the MetadataCache.
sanitizeHTMLToDom(html)
setIcon(parent, iconId)Insert an SVG into the element from an iconId. Does nothing if no icon associated with the iconId.
setTooltip(el, tooltip, options)
sortSearchResults(results)
stringifyYaml(obj)
stripHeading(heading)Normalizes headings for link matching by stripping out special characters and shrinking consecutive spaces.
stripHeadingForLink(heading)Prepares headings for linking by stripping out some bad combinations of special characters that could break links.

Interfaces

InterfaceDescription
BlockCache
BlockSubpathResult
CachedMetadata
CacheItem
CloseableComponentA closeable component that can get dismissed via the Android β€˜back’ button.
Command
DataAdapterWork directly with files and folders inside a vault. If possible prefer using the Vault API over this.
DataWriteOptions
Debouncer
EditorChange
EditorPosition
EditorRange
EditorRangeOrCaret
EditorScrollInfo
EditorSelection
EditorSelectionOrCaret
EditorSuggestContext
EditorSuggestTriggerInfo
EditorTransaction
EmbedCache
EventRef
FileStats
FootnoteCache
FootnoteRefCache
FootnoteSubpathResult
FrontMatterCache
FrontMatterInfo
FrontmatterLinkCache
FuzzyMatch
HeadingCache
HeadingSubpathResult
Hotkey
HoverLinkSource
HoverParent
HSL
Instruction
ISuggestOwner
KeymapContext
KeymapEventHandler
KeymapInfo
LinkCache
ListedFiles
ListItemCache
LivePreviewStateTypeThe object stored in the view plugin livePreviewState
LocLocation within a Markdown document
MarkdownFileInfo
MarkdownPostProcessor

A post processor receives an element which is a section of the preview.

Post processors can mutate the DOM to render various things, such as mermaid graphs, latex equations, or custom controls.

If your post processor requires lifecycle management, for example, to clear an interval, kill a subprocess, etc when this element is removed from the app, look into MarkdownPostProcessorContext.addChild()

MarkdownPostProcessorContext
MarkdownPreviewEvents*
MarkdownSectionInformation
MarkdownSubView
MenuPositionDef
ObsidianProtocolData
OpenViewState
PluginManifestMetadata about a Community plugin.
Point
PosDescribes a text range in a Markdown document.
ReferenceBase interface for items that point to a different location.
ReferenceCache
ReferenceLinkCache
RequestUrlParam
RequestUrlResponse
RequestUrlResponsePromise
RGB
SearchResult
SearchResultContainer
SectionCache
Stat
SubpathResult
TagCache
TooltipOptions
ViewState
ViewStateResult
WorkspaceWindowInitData

Variables

VariableDescription
apiVersionThis is the API version of the app, which follows the release cycle of the desktop app. Example: β€˜0.13.21’
editorEditorFieldUse this StateField to get a reference to the EditorView
editorInfoFieldUse this StateField to get information about this Markdown editor, such as the associated file, or the Editor.
editorLivePreviewFieldUse this StateField to check whether Live Preview is active
editorViewFieldThis is now deprecated - it is now mapped directly to editorInfoField, which return a MarkdownFileInfo, which may be a MarkdownView but not necessarily.
livePreviewState
moment
Platform

Type Aliases

Type AliasDescription
Constructor
EditorCommandName
HexStringHex strings are 6-digit hash-prefixed rgb strings in lowercase form. Example: ffffff
IconName
KeymapEventListenerReturn false to automatically preventDefault
MarkdownViewModeType
ModifierMod = Cmd on MacOS and Ctrl on other OS Ctrl = Ctrl key for every OS Meta = Cmd on MacOS and Win key on other OS
ObsidianProtocolHandler
PaneType
SearchMatches
SearchMatchPartText position offsets within text file. Represents a text range [from offset, to offset].
Side
SplitDirection
TooltipPlacement
UserEvent
ViewCreator

213건의 ν•­λͺ©