Skip to main content

@barocss/converter

Version in this checkout: 1.0.3. npm · Source

HTML, Markdown, and LaTeX conversion helpers plus browser PDF export.

Purpose

Use format-specific converters and register the rules needed for the target schema.

Install

npm install @barocss/converter

The published package provides ES modules and TypeScript declarations. Use a bundler that supports package exports.

Public entry points

ImportRole
@barocss/converterPublic JavaScript and TypeScript API

Import only these public paths. Source paths such as @barocss/converter/src/... are not part of the published API.

Usage

import { MarkdownConverter, registerDefaultMarkdownRules } from '@barocss/converter';

registerDefaultMarkdownRules();
const converter = new MarkdownConverter();
const nodes = converter.parse('# Weekly report\n\nProgress this week.');
console.log(nodes); // Validate these nodes against the receiving document's schema.

Integration notes

Register conversion rules before parsing. Conversion output still needs schema validation before insertion. Browser HTML parsing and PDF output require browser APIs; importing a converter does not establish untrusted-content sanitization policy.

Documentation

License

MIT. The published archive includes the license in dist/LICENSE.