kdp-book-generator
Version:
Generate KDP-compliant PDFs and EPUBs from Markdown for Amazon book publishing
165 lines • 4.86 kB
TypeScript
import { ParsedBook, Typography } from '../types';
export interface AssemblyConfig {
book_info: {
title: string;
subtitle?: string;
author?: string;
description?: string;
spanish_title?: string;
version?: string;
date?: string;
language?: string;
level?: string;
total_files?: number;
total_chapters?: number;
total_sections?: number;
total_appendices?: number;
cover_image?: string;
};
typography_override?: {
body_font?: number;
body_line_height?: number;
h1_font?: number;
h1_margin_top?: number;
h1_margin_bottom?: number;
h2_font?: number;
h2_margin_top?: number;
h2_margin_bottom?: number;
h3_font?: number;
h3_margin_top?: number;
h3_margin_bottom?: number;
h4_font?: number;
h5_font?: number;
h6_font?: number;
};
assembly_order: AssemblySection[];
assembly_settings: {
output_file: string;
include_table_of_contents: boolean;
include_page_numbers: boolean;
include_cross_references: boolean;
include_navigation_links: boolean;
formatting: {
page_break_marker: string;
section_separator: string;
chapter_separator: string;
};
metadata: {
include_file_info: boolean;
include_word_count: boolean;
include_generation_date: boolean;
include_version_info: boolean;
};
};
format_validation?: {
header_format?: {
required_pattern: string;
description: string;
};
file_structure?: {
required_sections: string[];
};
content_labels?: string[];
difficulty_levels?: string[];
};
quality_checks?: {
file_existence?: {
check_all_files: boolean;
required_files: number;
};
format_compliance?: {
check_header_format: boolean;
check_section_structure: boolean;
check_content_labels: boolean;
};
};
table_of_contents?: {
generate_automatically: boolean;
include_page_numbers: boolean;
include_section_numbers: boolean;
include_chapter_numbers: boolean;
max_depth: number;
sections: Array<{
name: string;
emoji: string;
include_subsections?: boolean;
include_chapters?: boolean;
include_appendices?: boolean;
}>;
};
cross_references?: {
enable_internal_links: boolean;
enable_chapter_references: boolean;
enable_appendix_references: boolean;
reference_patterns?: {
chapter_reference: string;
appendix_reference: string;
section_reference: string;
};
};
metadata?: {
created_date?: string;
last_modified?: string;
version?: string;
author?: string;
purpose?: string;
total_estimated_pages?: number;
total_estimated_words?: number;
target_audience?: string;
complementary_resource?: string;
};
}
export interface AssemblySection {
section: string;
title: string;
spanish_title?: string;
files: AssemblyFile[];
}
export interface AssemblyFile {
filename: string;
title: string;
spanish_title?: string;
type: 'introduction' | 'foundation' | 'section_intro' | 'chapter' | 'mini_review' | 'appendix' | 'conclusion';
chapter_number?: number;
section_number?: number;
appendix_letter?: string;
required: boolean;
page_break: boolean;
}
export interface AssemblyOptions {
configPath: string;
baseDir?: string;
outputPath?: string;
validateFiles?: boolean;
debug?: boolean;
}
export declare class MultiFileAssembler {
private config;
private baseDir;
private parser;
private translations;
constructor(configPath: string, baseDir?: string);
private getTranslation;
getConfig(): AssemblyConfig;
private loadConfig;
assemble(options: AssemblyOptions): Promise<ParsedBook>;
private validateFiles;
private validateFileFormat;
private assembleContent;
private generateBookHeader;
private generateTableOfContents;
private generateSectionHeader;
private processFileContent;
private addCrossReferences;
private findChapterFile;
private findAppendixFile;
private generateFrontMatter;
private getAllFiles;
private getTotalFileCount;
getTypographyConfig(): Typography;
static validateConfig(configPath: string): Promise<{
valid: boolean;
errors: string[];
}>;
}
//# sourceMappingURL=multi-file-assembler.d.ts.map