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 🙏

© 2025 – Pkg Stats / Ryan Hefner

prism-wiki

v1.0.1

Published

A Prism gadget for MediaWiki sites

Readme

Prism-Wiki

npm version CodeQL Codacy Badge

Prism-Wiki 是由 Bhsd 编写的一款用于 MediaWiki 站点的代码块高亮小工具,主要基于 Prism,并使用 WikiParser-Node 改进对维基文本的高亮模式。

Prism-Wiki 也能用于在非 MediaWiki 的浏览器或 Node.js 环境下改进 Prism维基文本的高亮支持,详见 Node.js 用法。使用案例可以参考 WikiParser-Node 渲染的 <syntaxhighlight> 标签

MediaWiki 站点小工具

使用方法

个人 JS 页添加以下代码:

mw.loader.load('//cdn.jsdelivr.net/npm/prism-wiki');

mw.loader.load('//unpkg.com/prism-wiki/dist/main.min.js');

所有指定了语言的代码块都会被自动高亮,未指定语言的代码块可以双击后手动输入语言并高亮。

设置

根据需要在加载小工具之前添加以下代码:

window.Prism = window.Prism || {};
Prism.theme = ''; // 主题,可省略
Prism.pluginPaths = []; // 插件相对路径,可省略

主题

所有可用的 Prism 主题都可以在这里找到。

插件相对路径

所有可用的 Prism 插件都可以在这里找到。插件路径需相对于 plugins/ 填写,注意有些插件同时包含了 JavaScript 和 CSS 文件,例如加载 autolinker 插件:

Prism.pluginPaths = [
	'autolinker/prism-autolinker.min.js',
	'autolinker/prism-autolinker.min.css',
];

小工具总是加载 line-numbersshow-languagecopy-to-clipboardinline-color 插件,不需要手动添加。

Node.js 用法

安装

npm install prismjs wikilint # peer dependencies
npm install prism-wiki

示例

const Prism = require('prismjs'),
	Parser = require('wikilint'),
	registerWiki = require('prism-wiki').default;

registerWiki(Prism, Parser);
Prism.highlight('[[Foo]]', Prism.languages.wiki, 'wiki');