Hierarchy-Diagram

UML class diagram of default
Legend
icon for a class in the UML class diagram class
icon for a public property in the UML class diagram public property
icon for a public method in the UML class diagram public method

Hierarchy

  • Plugin
    • default

Constructors

  • Parameters

    • app: App
    • manifest: PluginManifest

    Returns default

Properties

app: App
blockManager: default = ...
	blockManager = new HistoricaBlockManager(this)
configManager: default = ...
historicaChrono: default = ...
	historicaChrono = new HistoricaChrono()
manifest: PluginManifest
modesToKeep: string[] = ...
	modesToKeep = ["hypermd", "markdown", "null", "xml"];

Methods

  • Adds a child component, loading it if this component is loaded

    Type Parameters

    • T extends Component<T>

    Parameters

    • component: T

    Returns T

  • Register a command globally. Registered commands will be available from the @{link https://help.obsidian.md/Plugins/Command+palette Command palette}. The command id and name will be automatically prefixed with this plugin's id and name.

    Parameters

    • command: Command

    Returns Command

  • Adds a ribbon icon to the left bar.

    Parameters

    • icon: string

      The icon name to be used. See addIcon

    • title: string

      The title to be displayed in the tooltip.

    • callback: (evt: MouseEvent) => any

      The click callback.

    Returns HTMLElement

  • Adds a status bar item to the bottom of the app. Not available on mobile.

    Returns HTMLElement

    HTMLElement - element to modify.

  • Returns void

  • Load this component and its children

    Returns void

  • Called when the data.json file is modified on disk externally from Obsidian. This usually means that a Sync service or external program has modified the plugin settings.

    Implement this method to reload plugin settings when they have changed externally.

    Returns any

  • Returns Promise<void>

  • Returns Promise<void>

  • Perform any initial setup code. The user has explicitly interacted with the plugin so its safe to engage with the user. If your plugin registers a custom view, you can open it here.

    Returns void

  • Returns void

  • Registers a callback to be called when unloading

    Parameters

    • cb: () => any

    Returns void

  • Registers an DOM event to be detached when unloading

    Type Parameters

    • K extends keyof WindowEventMap

    Parameters

    • el: Window
    • type: K
    • callback: (this: HTMLElement, ev: WindowEventMap[K]) => any
    • Optionaloptions: boolean | AddEventListenerOptions

    Returns void

  • Registers an DOM event to be detached when unloading

    Type Parameters

    • K extends keyof DocumentEventMap

    Parameters

    • el: Document
    • type: K
    • callback: (this: HTMLElement, ev: DocumentEventMap[K]) => any
    • Optionaloptions: boolean | AddEventListenerOptions

    Returns void

  • Registers an DOM event to be detached when unloading

    Type Parameters

    • K extends keyof HTMLElementEventMap

    Parameters

    • el: HTMLElement
    • type: K
    • callback: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any
    • Optionaloptions: boolean | AddEventListenerOptions

    Returns void

  • Registers a CodeMirror 6 extension. To reconfigure cm6 extensions for a plugin on the fly, an array should be passed in, and modified dynamically. Once this array is modified, calling Workspace.updateOptions will apply the changes.

    Parameters

    • extension: Extension

      must be a CodeMirror 6 Extension, or an array of Extensions.

    Returns void

  • Register an EditorSuggest which can provide live suggestions while the user is typing.

    Parameters

    • editorSuggest: EditorSuggest<any>

    Returns void

  • Registers an event to be detached when unloading

    Parameters

    • eventRef: EventRef

    Returns void

  • Parameters

    • extensions: string[]
    • viewType: string

    Returns void

  • Registers a view with the 'Page preview' core plugin as an emitter of the 'hover-link' event.

    Parameters

    • id: string
    • info: HoverLinkSource

    Returns void

  • Registers an interval (from setInterval) to be cancelled when unloading Use window.setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API

    Parameters

    • id: number

    Returns number

  • Returns void

  • Register a special post processor that handles fenced code given a language and a handler. This special post processor takes care of removing the <pre><code> and create a <div> that will be passed to the handler, and is expected to be filled with custom elements.

    Parameters

    • language: string
    • handler: (
          source: string,
          el: HTMLElement,
          ctx: MarkdownPostProcessorContext,
      ) => void | Promise<any>
    • OptionalsortOrder: number

    Returns MarkdownPostProcessor

  • Registers a post processor, to change how the document looks in reading mode.

    Parameters

    • postProcessor: MarkdownPostProcessor
    • OptionalsortOrder: number

    Returns MarkdownPostProcessor

  • Register a handler for obsidian:// URLs.

    Parameters

    • action: string

      the action string. For example, 'open' corresponds to obsidian://open.

    • handler: ObsidianProtocolHandler

      the callback to trigger. A key-value pair that is decoded from the query will be passed in. For example, obsidian://open?key=value would generate {'action': 'open', 'key': 'value'}.

    Returns void

  • Parameters

    • type: string
    • viewCreator: ViewCreator

    Returns void

  • Removes a child component, unloading it

    Type Parameters

    • T extends Component<T>

    Parameters

    • component: T

    Returns T

  • Manually remove a command from the list of global commands. This should not be needed unless your plugin registers commands dynamically.

    Parameters

    • commandId: string

    Returns void

  • Write settings data to disk. Data is stored in data.json in the plugin folder.

    Parameters

    • data: any

    Returns Promise<void>

  • Unload this component and its children

    Returns void