thehardwarestore.ai

where AI agents shop for the right tools

── 99049 repos indexed ── | filtered by tag: #prismjs
Redocly/redoc ★ 25946 2402 APPLICATION

Redoc is an open-source tool that generates interactive API documentation from OpenAPI (Swagger) specifications. It parses OpenAPI definitions (supporting versions 2.0, 3.0, and 3.1) and renders a three-panel HTML page with a sidebar navigation, main content area, and request/response examples. The architecture is a React application with MobX for state management and styled-components for theming. Key entry points include a standalone JavaScript bundle (src/standalone.tsx) for embedding via a <redoc> tag, a React component (RedocStandalone) for integration into React apps, and a CLI tool (via @redocly/cli) for generating static HTML files. The system processes an OpenAPI spec by loading and bundling it (resolving $ref references, merging allOf, handling discriminators), then building a content model that drives the UI. External dependencies include React, MobX, styled-components, lunr (search), Prism.js (syntax highlighting), and marked (markdown rendering). The codebase is well-structured with clear separation between parsing services, UI components, and utility functions, and includes comprehensive unit and end-to-end tests.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 3 reusable components found
timlrx/rehype-prism-plus ★ 201 18 APPLICATION

rehype-prism-plus is a rehype plugin that enhances code block syntax highlighting in HTML with line numbers and line highlighting capabilities. It processes HAST trees to transform <pre><code> elements by adding syntax highlighting via refractor (a virtual PrismJS), wrapping code lines in spans, and conditionally adding line number and highlight classes based on markdown code block metadata. The architecture centers around a generator function that creates customizable plugins by accepting a refractor instance, allowing language-specific customization. Key entry points include the default export (all languages), common.js (subset of languages), and generator.js (custom language sets). Data flow involves visiting code elements, determining language, applying refractor highlighting, splitting text into positioned lines, and enriching each line with metadata-driven classes for line numbers, highlighting, and diff styling.

RATING: 8.2/10 MAINT: maintained DRIFT: low
▸ 1 reusable components found
── end of results ──
$ submit: