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

@sylphx/solid-tui-markdown

v0.1.5

Published

Markdown rendering components for solid-tui: Markdown parser and SyntaxHighlight

Readme

@sylphx/solid-tui-markdown

Markdown rendering and syntax highlighting for terminal applications

npm version License: MIT

Full-featured markdown rendering and code syntax highlighting for Solid-TUI terminal applications. Powered by marked.js and highlight.js.

📦 Installation

npm install @sylphx/solid-tui-markdown solid-js @sylphx/solid-tui

🎯 Components

Markdown

Complete markdown renderer with support for headers, code blocks, lists, tables, blockquotes, and more.

Supported Features:

  • Headers (h1-h6) with color coding
  • Code blocks with syntax highlighting
  • Lists (ordered and unordered)
  • Blockquotes
  • Horizontal rules
  • Tables
  • Emphasis (bold, italic)
  • Links (text display)
  • Inline code

Props:

  • children: string - Markdown content to render

Example:

import { render, Box } from '@sylphx/solid-tui';
import { Markdown } from '@sylphx/solid-tui-markdown';

function App() {
  const markdown = `# Getting Started

Welcome to **Solid-TUI**! This is a *powerful* terminal UI framework.

## Features

- Fine-grained reactivity
- No Virtual DOM
- Blazing fast performance

## Code Example

\`\`\`typescript
import { render, Text } from '@sylphx/solid-tui';

function App() {
  return <Text color="green">Hello, World!</Text>;
}

render(<App />);
\`\`\`

## Installation

1. Install dependencies
2. Import components
3. Start building

> **Note:** Requires Node.js 18+

---

Happy coding!`;

  return <Markdown>{markdown}</Markdown>;
}

render(<App />);

Rendering Details:

  • H1: Blue, bold
  • H2: Cyan, bold
  • H3-H6: White, bold
  • Code blocks: Syntax highlighted (via SyntaxHighlight component)
  • Lists: Bullet points (•) or numbers with proper indentation
  • Blockquotes: Dimmed text with "│" prefix
  • Tables: Formatted with borders and alignment
  • Horizontal rules: Dimmed line separator

SyntaxHighlight

Code syntax highlighter with support for 190+ programming languages.

Features:

  • 190+ language support via highlight.js
  • Auto-detection mode
  • Line numbers
  • Dark/light themes
  • Color-coded tokens (keywords, strings, comments, etc.)

Props:

  • code: string - Code to highlight
  • language?: string - Language name (default: 'javascript')
  • theme?: 'dark' | 'light' - Color theme (default: 'dark')
  • showLineNumbers?: boolean - Show line numbers (default: true)

Example:

import { SyntaxHighlight } from '@sylphx/solid-tui-markdown';

function CodeViewer() {
  const code = `function fibonacci(n) {
  if (n <= 1) return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
}

const result = fibonacci(10);
console.log('Result:', result);`;

  return (
    <Box flexDirection="column">
      <Text bold>JavaScript Example:</Text>
      <SyntaxHighlight code={code} language="javascript" />

      <Box marginTop={2}>
        <Text bold>Without Line Numbers:</Text>
      </Box>
      <SyntaxHighlight
        code={code}
        language="javascript"
        showLineNumbers={false}
      />
    </Box>
  );
}

Supported Languages: Over 190 languages including:

  • JavaScript / TypeScript / JSX / TSX
  • Python / Ruby / PHP / Go / Rust
  • Java / C / C++ / C#
  • HTML / CSS / SCSS / JSON / YAML / XML
  • Bash / Shell / PowerShell
  • SQL / GraphQL
  • Markdown / LaTeX
  • And many more...

Set language="auto" for automatic language detection.

🎨 Color Themes

Dark Theme (default)

  • Keywords: Magenta
  • Strings: Green
  • Numbers: Yellow
  • Comments: Dimmed
  • Functions: Blue
  • Classes: Cyan

Light Theme

Same color scheme with adjusted defaults for light terminal backgrounds.

📖 Usage Examples

Rendering README files

import { readFileSync } from 'fs';
import { Markdown } from '@sylphx/solid-tui-markdown';

function ReadmeViewer() {
  const readme = readFileSync('./README.md', 'utf-8');
  return <Markdown>{readme}</Markdown>;
}

Documentation viewer

function DocsViewer() {
  const [currentDoc, setCurrentDoc] = createSignal('intro');

  const docs = {
    intro: `# Introduction\n\nWelcome to the docs...`,
    api: `# API Reference\n\n## Functions\n\n...`,
  };

  return (
    <Box flexDirection="column">
      <Box>
        <Button onClick={() => setCurrentDoc('intro')}>Intro</Button>
        <Button onClick={() => setCurrentDoc('api')}>API</Button>
      </Box>
      <Markdown>{docs[currentDoc()]}</Markdown>
    </Box>
  );
}

Code snippet display

function SnippetGallery() {
  const snippets = [
    { name: 'Hello World', code: 'console.log("Hello!");', lang: 'javascript' },
    { name: 'Fibonacci', code: 'def fib(n):\n  ...', lang: 'python' },
  ];

  return (
    <Box flexDirection="column">
      <For each={snippets}>
        {(snippet) => (
          <Box flexDirection="column" marginBottom={2}>
            <Text bold>{snippet.name}</Text>
            <SyntaxHighlight code={snippet.code} language={snippet.lang} />
          </Box>
        )}
      </For>
    </Box>
  );
}

🎨 Examples

Run the included examples:

npm run example:markdown  # Markdown demo
npm run example:syntax    # SyntaxHighlight demo

🔧 Development

# Build package
npm run build

# Run tests
npm test

# Watch mode
npm run dev

📚 Dependencies

📖 API Reference

See TypeScript definitions for complete API documentation.

🤝 Contributing

Contributions are welcome! Please read the Contributing Guide for details.

📄 License

MIT © SylphxAI

🔗 Links