legal-markdown-js
Version:
Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version
99 lines • 3.52 kB
TypeScript
/**
* @fileoverview Output Formatters for Legal Documents
*
* This module provides enhanced formatting capabilities for Legal Markdown documents
* beyond the core functionality. It includes formatters for different output styles,
* HTML generation, and document presentation optimizations.
*
* Features:
* - Enhanced document styling with line spacing options
* - Page break insertion for print-friendly output
* - HTML generation with legal-specific styling
* - Header formatting with multiple style options
* - Extensions not present in the original legal-markdown
* - Print-optimized document formatting
*
* @example
* ```typescript
* import { formatLegalDocument, toLegalHTML } from './formatters';
*
* // Format document with double line spacing
* const formatted = formatLegalDocument(content, {
* lineSpacing: 'double',
* pageBreaks: true,
* headerStyle: 'bold'
* });
*
* // Convert to HTML with legal styling
* const html = toLegalHTML(content);
* ```
*/
/**
* Formats legal document output with enhanced styling options
*
* This function provides advanced formatting capabilities for Legal Markdown documents,
* including line spacing control, page break insertion, and header styling. These
* features are extensions not present in the original legal-markdown specification.
*
* @function formatLegalDocument
* @param {string} content - The legal document content to format
* @param {Object} [options={}] - Formatting options
* @param {'single' | 'double'} [options.lineSpacing='single'] - Line spacing style
* @param {boolean} [options.pageBreaks=false] - Whether to add page breaks before major sections
* @param {'bold' | 'underline' | 'both'} [options.headerStyle] - Header styling option
* @returns {string} The formatted document content
* @example
* ```typescript
* import { formatLegalDocument } from './formatters';
*
* // Basic formatting with double line spacing
* const formatted = formatLegalDocument(content, {
* lineSpacing: 'double'
* });
*
* // Advanced formatting with page breaks and header styling
* const formatted = formatLegalDocument(content, {
* lineSpacing: 'double',
* pageBreaks: true,
* headerStyle: 'bold'
* });
*
* // Print-friendly formatting
* const printReady = formatLegalDocument(content, {
* lineSpacing: 'single',
* pageBreaks: true
* });
* ```
*/
export declare function formatLegalDocument(content: string, options?: {
lineSpacing?: 'single' | 'double';
pageBreaks?: boolean;
headerStyle?: 'bold' | 'underline' | 'both';
}): string;
/**
* Converts legal document to HTML with legal-specific styling
*
* Generates a complete HTML document with professional legal document styling,
* including Times New Roman font, proper line spacing, and structured layout
* with appropriate margins and indentation for legal document presentation.
*
* @function toLegalHTML
* @param {string} content - The legal document content to convert to HTML
* @returns {string} Complete HTML document with embedded styles
* @example
* ```typescript
* import { toLegalHTML } from './formatters';
*
* // Convert processed legal markdown to HTML
* const htmlDocument = toLegalHTML(processedContent);
*
* // Save to file
* fs.writeFileSync('contract.html', htmlDocument);
*
* // Or serve via web server
* res.setHeader('Content-Type', 'text/html');
* res.send(htmlDocument);
* ```
*/
export declare function toLegalHTML(content: string): string;
//# sourceMappingURL=index.d.ts.map