npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

obsidian-quick-preview

v0.5.10

Published

An Obsidian.md plugin to quickly preview a suggestion before selecting it in link suggestions & quick swicher.

Downloads

20

Readme

Obsidian Quick Preview

This Obsidian.md plugin adds a quick preview functionality to

Hold down Alt/Option (by default) to quickly preview a suggestion before actually selecting it.

Link suggestions (file/heading/block)

Screen Recording 2023-12-13 at 18 27 42

Quick switcher / Quick switcher++

Screen Recording 2023-12-13 at 18 24 34

[!tip]

  • You can adjust the font size for quick preview via Style Settings.
  • Other plugins also can utilize the quick preview feature via the API. See below for more details.

Installation

You can find this plugin in the community plugin browser within Obsidian.

You can also install the latest beta release using BRAT:

  1. Install BRAT and enable it.
  2. Go to Options. In the Beta Plugin List section, click on the Add Beta plugin button.
  3. Copy and paste RyotaUshio/obsidian-quick-preview in the pop-up prompt and click on Add Plugin.
  4. (Optional but highly recommended) Turn on Auto-update plugins at startup at the top of the page.
  5. Go to Community plugins > Installed plugins. You will find “Quick Preview” in the list. Click on the toggle button to enable it.

Using the API

This plugin provides an API to allow other plugins to add the quick preview functionality to their custom suggesters. Supported suggester types are:

Installation

npm install -D obsidian-quick-preview

Usage examples

import { Plugin, EditorSuggest, SuggestModal, TFile, SectionCache } from "obsidian";
import { registerQuickPreview } from "obsidian-quick-preview";

class MyCustomEditorSuggest extends EditorSuggest<{ file: TFile }> { ... }

class MyCustomSuggestModal extends SuggestModal<{ path: string, cache: SectionCache }> { ... }

export default MyPlugin extends Plugin {
    excludedFiles: string[];

    onload() {
        registerQuickPreview(this.app, this, MyCustomEditorSuggest, (item) => {
            // - `linktext` can be any string representing a proper internal link,
            //   e.g. "note", "note.md", "folder/note", "folder/note.md", "note#heading", "note#^block-id" etc
            // - `sourcePath` is used to resolve relative links. In many cases, you can just pass an empty string.
            return { linktext: item.file.path, sourcePath: "" };
        });
        // or
        registerQuickPreview(this.app, this, MyCustomSuggestModal, (item) => {
            if (this.excludedFiles.contains(item.path)) {
                // Return `null` when you don't want to show a quick preview for the item.
                return null;
            }
            // Add a `line` parameter to focus on a specific line.
            return { linktext: item.path, sourcePath: "", line: item.cache.position.start.line };
        });
    }
}

Support development

If you find my plugins useful, please support my work by buying me a coffee!