legal-markdown-js
Version:
Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version
64 lines • 1.97 kB
TypeScript
/**
* Remark Plugin for Mixin Processing
*
* This plugin processes mixins in legal documents using AST processing.
* Mixins provide a way to include reusable content blocks and templates
* within legal documents, with support for variable substitution and
* conditional logic.
*
* Features:
* - Mixin inclusion with @include directive
* - Variable substitution within mixins
* - Nested mixin support
* - Template field processing within mixins
* - File-based mixin imports
*
* @example
* ```typescript
* import { unified } from 'unified';
* import remarkParse from 'remark-parse';
* import remarkStringify from 'remark-stringify';
* import { remarkMixins } from './mixins';
*
* const processor = unified()
* .use(remarkParse)
* .use(remarkMixins, {
* metadata: { client: 'ACME Corp' },
* basePath: './mixins'
* })
* .use(remarkStringify);
* ```
*
* @module
*/
import { Plugin } from 'unified';
import { Root } from 'mdast';
/**
* Options for the remark mixins plugin
* @interface RemarkMixinsOptions
*/
export interface RemarkMixinsOptions {
/** Document metadata for variable substitution */
metadata: Record<string, any>;
/** Base path for resolving mixin files */
basePath?: string;
/** Enable debug logging */
debug?: boolean;
/** Maximum recursion depth for nested mixins */
maxDepth?: number;
/** Custom mixin definitions */
customMixins?: Record<string, string>;
}
/**
* Remark plugin for processing mixins
*
* This plugin identifies and processes mixin inclusion directives in markdown text,
* loading mixin content from files or inline definitions and performing variable
* substitution within the mixin content.
*
* @param options - Configuration options for mixin processing
* @returns Remark plugin transformer function
*/
export declare const remarkMixins: Plugin<[RemarkMixinsOptions], Root>;
export default remarkMixins;
//# sourceMappingURL=mixins.d.ts.map