Adds all official Feather Icons to Obsidian. https://feathericons.com/
SVG Attributes for the Icon. The default should work for most usecases.
Adds a specific Feather Icon to Obsidian.
official Name of the Icon (https://feathericons.com/)
SVG Attributes for the Icon. The default should work for most usecases.
Icon name
Add '.md' to noteName
if it isn't already there.
with or without '.md' on the end.
noteName with '.md' on the end.
Add a button to an HTMLELement, which, when clicked, pops up a RenderedMarkdownModal showing rendered markdown.
Use fetch
to indicate whether the markdown string needs to be fetched, or if it has been provided as a string already.
HTMLElement to add the button to
Raw markdown content or url to find raw markdown.
True → fetch markdown from source
as url. False → source
is already a markdown string.
Text to display in the button.
Convert a base64 String to an ArrayBuffer. You can then use the ArrayBuffer to save the asset to disk.
base64 string to be converted.
ArrayBuffer
Copy content
to the users clipboard.
The content to be copied to clipboard.
The callback to run when text is successfully copied. Default throws a new Notice
The callback to run when text was not able to be copied. Default throws a new Notice
, and console logs the error.`
Create a new markdown note named newName
in the user's preffered new-note-folder.
Name of new note (with or without '.md')
new TFile
Return cached file content or return what's on disk.
This is a helper method for an undocumented API of Obsidian.
The Filename for your Attachment
The Fileformat of your Attachment
The Sourcefile from where the Attachment gets added, this is needed because the Attachment Folder might be different based on where it gets inserted.
The Attachment Path
Check if something is selected in the current file and return that selection, otherwise return the entire content of the current file.
null
if not focussed on a markdown file
Given an editor, check if something is selected and return that selection, otherwise return the entire content of the editor
When hovering a link going to to
, show the Obsidian hover-preview of that note.
You probably have to hold down Ctrl
when hovering the link for the preview to appear!
The ViewType of your view
The view with the link being hovered
The basename of the note to preview.
void
Check if noteName
is the name of a note that exists in the vault.
Basename of the note to search for.
boolean
Given a list of resolved links from app.metadataCache, check if from
has a link to to
Note name with link leaving (With or without '.md')
Note name with link arriving (With or without '.md')
Check if the link from
→ to
is resolved or not.
boolean
When clicking a link, check if that note is already open in another leaf, and switch to that leaf, if so. Otherwise, open the note in a new pane.
Name of note to open. If you want to open a non-md note, be sure to add the file extension.
Promise
Open your view on the chosen side
if it isn't already open
The class constructor of your view
The opened view
Check if app.metadataCache.ResolvedLinks
have fully initalised.
Used with waitForResolvedLinks.
Number of files in your vault.
Check which side of the workspace your viewType
is on, and save it into plugin.settings[settingName]
.
Tip: Run this function on plugin.unload
to save the last side your view was on when closing, then openView on the same side it was last.
side
Check if the content of a note has YAML. If so, return an array of the YAML and the rest of the note. If not, return ['', content]
Strip '.md' off the end of a note name to get its basename.
Works with the edgecase where a note has '.md' in its basename: Obsidian.md.md
, for example.
with or without '.md' on the end.
noteName without '.md'
You can await this Function to delay execution
The delay in ms
Wait for app.metadataCache.ResolvedLinks
to have fully initialised.
Generated using TypeDoc
This module contains various utility functions commonly used in Obsidian plugins.