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

wampert

v0.0.1

Published

Angular Markdown rendering library with unified pipeline, syntax highlighting via shiki, and GFM support

Downloads

107

Readme

@anthropic/wampert

A powerful Angular library for rendering Markdown with syntax highlighting, GFM support, and full customization.

Features

  • Syntax Highlighting: Beautiful code highlighting powered by Shiki with support for 100+ languages
  • GFM Support: Full GitHub Flavored Markdown including tables, task lists, strikethrough, and autolinks
  • Extensible: Add custom remark and rehype plugins
  • Configurable: Theme and behavior customization via dependency injection
  • SSR Compatible: Works with Angular Server-Side Rendering

Installation

npm install @anthropic/wampert

Peer Dependencies

Make sure you have the following peer dependencies installed:

npm install @angular/common @angular/core @angular/platform-browser

Setup

Add the provideMarkdown() provider to your application configuration:

import { ApplicationConfig } from '@angular/core';
import { provideMarkdown } from '@anthropic/wampert';

export const appConfig: ApplicationConfig = {
  providers: [
    provideMarkdown({
      prettyCodeTheme: {
        dark: 'github-dark',
        light: 'github-light',
      },
      keepBackground: false,
    }),
  ],
};

Usage

Import the MarkdownComponent and use it in your templates:

import { Component } from '@angular/core';
import { MarkdownComponent } from '@anthropic/wampert';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [MarkdownComponent],
  template: `
    <wampert-markdown [content]="markdownContent"></wampert-markdown>
  `,
})
export class ExampleComponent {
  markdownContent = `
# Hello World

This is **bold** and this is *italic*.

\`\`\`typescript
function greet(name: string): string {
  return \`Hello, \${name}!\`;
}
\`\`\`
  `;
}

Configuration

provideMarkdown()

The main configuration function accepts the following options:

interface MarkdownConfig {
  remarkPlugins?: RemarkPlugin[];
  rehypePlugins?: RehypePlugin[];
  prettyCodeTheme?: {
    dark: string;
    light: string;
  };
  keepBackground?: boolean;
}

Custom Plugins

You can add custom remark and rehype plugins:

import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';

provideMarkdown({
  remarkPlugins: [
    { plugin: remarkMath }
  ],
  rehypePlugins: [
    { plugin: rehypeKatex, options: { strict: false } }
  ],
})

Multi-Provider Support

For modular configuration, you can use the helper functions:

import {
  provideRemarkPlugins,
  provideRehypePlugins,
  providePrettyCodeTheme
} from '@anthropic/wampert';

export const appConfig: ApplicationConfig = {
  providers: [
    provideRemarkPlugins([{ plugin: remarkMath }]),
    provideRehypePlugins([{ plugin: rehypeKatex }]),
    providePrettyCodeTheme('one-dark-pro', 'github-light'),
  ],
};

Injection Tokens

For advanced use cases, you can inject tokens directly:

  • REMARK_PLUGINS - Multi-provider token for remark plugins
  • REHYPE_PLUGINS - Multi-provider token for rehype plugins
  • PRETTY_CODE_THEME - Theme configuration for rehype-pretty-code
  • KEEP_BACKGROUND - Boolean to control background preservation

Pipeline

The library uses the unified ecosystem with the following pipeline:

  1. remark-parse - Parse markdown
  2. Custom remark plugins (if provided)
  3. remark-gfm - GitHub Flavored Markdown
  4. remark-rehype - Convert to HTML AST
  5. rehype-slug - Add IDs to headings
  6. Custom rehype plugins (if provided)
  7. rehype-pretty-code - Syntax highlighting with Shiki
  8. rehype-stringify - Convert to HTML string

Shiki Themes

The library uses Shiki for syntax highlighting. You can use any built-in Shiki theme:

  • github-dark / github-light
  • one-dark-pro
  • dracula
  • nord
  • vitesse-dark / vitesse-light
  • And many more...

See the Shiki themes documentation for a full list.

Dark Mode Support

The component renders both light and dark themes and uses CSS to show the appropriate one:

/* Default to light mode */
pre[data-theme='dark'],
code[data-theme='dark'] {
  display: none;
}

@media (prefers-color-scheme: dark) {
  pre[data-theme='light'],
  code[data-theme='light'] {
    display: none;
  }

  pre[data-theme='dark'],
  code[data-theme='dark'] {
    display: block;
  }
}

License

MIT