Skip to content

About

Logseq plugin for pop-up preview of Wikipedia links

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

logseq-wiki-preview

Wikipedia link previews for Logseq as pop-ups. Click a Wikipedia link in your notes and instead of leaving the app, you get a small popup with the article content, themed to your Logseq theme.

It does three things, all of them small:

  • Tags Wikipedia links with a tiny W glyph so you can spot them.
  • On click, opens a popup with the article body. If the URL has a #section anchor, only that section is shown. Images, infoboxes, the lot. ESC or click outside to close. Drag the bottom-right corner to resize.
  • When you paste a Wikipedia URL into a block, it auto-converts to [Article Title](url) — the title comes from Wikipedia, not from you. The W glyph next to the rendered link is purely a display thing; it never ends up in the markdown.

That's it. No settings panel, no sync, no AI.

Install

You'll need Node 18+ and a Logseq build with developer mode enabled (Settings → Advanced → Developer mode).

npm install
npm run build

In Logseq: Plugins → "Load unpacked plugin" → point at this directory. Reload after each rebuild (Plugins → ⋯ → Reload).

Caveats

  • Wikipedia content is fetched live every time. There's no cache. If you're offline, the popup says so and gets out of the way.
  • The popup respects --ls-primary-background-color, --ls-link-text-color, and friends, so dark themes should work without a separate stylesheet.
  • HTML coming back from action=parse is sanitized — scripts, iframes, inline on* handlers, and non-http(s) URLs are stripped before anything is inserted into the host document. It is still Wikipedia's HTML though, so if Wikipedia ships you weird markup, weird markup is what you'll see.
  • The W icon is appended as a <span> child of the anchor element after the block renders. Your block's markdown source stays clean; copying the link text doesn't drag the icon along.
  • Modifier-clicks (cmd / ctrl / shift / middle) bypass the popup and open in your browser like a normal link.

License

MIT

About

Logseq plugin for pop-up preview of Wikipedia links

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages