@nahisaho/katashiro-generator 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/citation/citation-generator.d.ts +68 -0
- package/dist/citation/citation-generator.d.ts.map +1 -0
- package/dist/citation/citation-generator.js +134 -0
- package/dist/citation/citation-generator.js.map +1 -0
- package/dist/citation/index.d.ts +6 -0
- package/dist/citation/index.d.ts.map +1 -0
- package/dist/citation/index.js +5 -0
- package/dist/citation/index.js.map +1 -0
- package/dist/export/export-service.d.ts +96 -0
- package/dist/export/export-service.d.ts.map +1 -0
- package/dist/export/export-service.js +278 -0
- package/dist/export/export-service.js.map +1 -0
- package/dist/export/index.d.ts +7 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/export/index.js +7 -0
- package/dist/export/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.d.ts +28 -0
- package/dist/interfaces.d.ts.map +1 -0
- package/dist/interfaces.js +5 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/presentation/index.d.ts +7 -0
- package/dist/presentation/index.d.ts.map +1 -0
- package/dist/presentation/index.js +7 -0
- package/dist/presentation/index.js.map +1 -0
- package/dist/presentation/presentation-generator.d.ts +106 -0
- package/dist/presentation/presentation-generator.d.ts.map +1 -0
- package/dist/presentation/presentation-generator.js +250 -0
- package/dist/presentation/presentation-generator.js.map +1 -0
- package/dist/report/index.d.ts +6 -0
- package/dist/report/index.d.ts.map +1 -0
- package/dist/report/index.js +5 -0
- package/dist/report/index.js.map +1 -0
- package/dist/report/report-generator.d.ts +82 -0
- package/dist/report/report-generator.d.ts.map +1 -0
- package/dist/report/report-generator.js +262 -0
- package/dist/report/report-generator.js.map +1 -0
- package/dist/summary/index.d.ts +6 -0
- package/dist/summary/index.d.ts.map +1 -0
- package/dist/summary/index.js +5 -0
- package/dist/summary/index.js.map +1 -0
- package/dist/summary/summary-generator.d.ts +42 -0
- package/dist/summary/summary-generator.d.ts.map +1 -0
- package/dist/summary/summary-generator.js +140 -0
- package/dist/summary/summary-generator.js.map +1 -0
- package/dist/template/index.d.ts +6 -0
- package/dist/template/index.d.ts.map +1 -0
- package/dist/template/index.js +5 -0
- package/dist/template/index.js.map +1 -0
- package/dist/template/template-engine.d.ts +76 -0
- package/dist/template/template-engine.d.ts.map +1 -0
- package/dist/template/template-engine.js +165 -0
- package/dist/template/template-engine.js.map +1 -0
- package/dist/types.d.ts +42 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CitationGenerator - 引用・参考文献生成
|
|
3
|
+
*
|
|
4
|
+
* @requirement REQ-GEN-003
|
|
5
|
+
* @design DES-KATASHIRO-001 §2.3 Generator Container
|
|
6
|
+
* @task TSK-033
|
|
7
|
+
*/
|
|
8
|
+
import type { Source } from '@nahisaho/katashiro-core';
|
|
9
|
+
/**
|
|
10
|
+
* 引用スタイル
|
|
11
|
+
*/
|
|
12
|
+
export type CitationStyle = 'apa' | 'mla' | 'ieee' | 'chicago' | 'harvard';
|
|
13
|
+
/**
|
|
14
|
+
* 生成された引用情報
|
|
15
|
+
*/
|
|
16
|
+
export interface GeneratedCitation {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly source: Source;
|
|
19
|
+
readonly style: CitationStyle;
|
|
20
|
+
readonly formatted: string;
|
|
21
|
+
readonly accessedAt: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 引用生成実装
|
|
25
|
+
*/
|
|
26
|
+
export declare class CitationGenerator {
|
|
27
|
+
/**
|
|
28
|
+
* 引用を生成
|
|
29
|
+
*/
|
|
30
|
+
generateCitation(source: Source, style: CitationStyle): GeneratedCitation;
|
|
31
|
+
/**
|
|
32
|
+
* 参考文献リストを生成
|
|
33
|
+
*/
|
|
34
|
+
generateBibliography(sources: Source[], style: CitationStyle): string;
|
|
35
|
+
/**
|
|
36
|
+
* インライン引用をフォーマット
|
|
37
|
+
*/
|
|
38
|
+
formatInlineCitation(source: Source, style: CitationStyle, number?: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* 引用をフォーマット
|
|
41
|
+
*/
|
|
42
|
+
private formatCitation;
|
|
43
|
+
/**
|
|
44
|
+
* APAスタイル
|
|
45
|
+
*/
|
|
46
|
+
private formatAPA;
|
|
47
|
+
/**
|
|
48
|
+
* MLAスタイル
|
|
49
|
+
*/
|
|
50
|
+
private formatMLA;
|
|
51
|
+
/**
|
|
52
|
+
* IEEEスタイル
|
|
53
|
+
*/
|
|
54
|
+
private formatIEEE;
|
|
55
|
+
/**
|
|
56
|
+
* Chicagoスタイル
|
|
57
|
+
*/
|
|
58
|
+
private formatChicago;
|
|
59
|
+
/**
|
|
60
|
+
* Harvardスタイル
|
|
61
|
+
*/
|
|
62
|
+
private formatHarvard;
|
|
63
|
+
/**
|
|
64
|
+
* 姓を抽出
|
|
65
|
+
*/
|
|
66
|
+
private getLastName;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=citation-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citation-generator.d.ts","sourceRoot":"","sources":["../../src/citation/citation-generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,iBAAiB;IAYzE;;OAEG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM;IAgBrE;;OAEG;IACH,oBAAoB,CAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,aAAa,EACpB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM;IAqBT;;OAEG;IACH,OAAO,CAAC,cAAc;IAwBtB;;OAEG;IACH,OAAO,CAAC,SAAS;IAWjB;;OAEG;IACH,OAAO,CAAC,SAAS;IAUjB;;OAEG;IACH,OAAO,CAAC,UAAU;IAUlB;;OAEG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;IACH,OAAO,CAAC,WAAW;CAOpB"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CitationGenerator - 引用・参考文献生成
|
|
3
|
+
*
|
|
4
|
+
* @requirement REQ-GEN-003
|
|
5
|
+
* @design DES-KATASHIRO-001 §2.3 Generator Container
|
|
6
|
+
* @task TSK-033
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* 引用生成実装
|
|
10
|
+
*/
|
|
11
|
+
export class CitationGenerator {
|
|
12
|
+
/**
|
|
13
|
+
* 引用を生成
|
|
14
|
+
*/
|
|
15
|
+
generateCitation(source, style) {
|
|
16
|
+
const formatted = this.formatCitation(source, style);
|
|
17
|
+
return {
|
|
18
|
+
id: `cite-${source.id}`,
|
|
19
|
+
source,
|
|
20
|
+
style,
|
|
21
|
+
formatted,
|
|
22
|
+
accessedAt: source.fetchedAt,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 参考文献リストを生成
|
|
27
|
+
*/
|
|
28
|
+
generateBibliography(sources, style) {
|
|
29
|
+
if (sources.length === 0) {
|
|
30
|
+
return '';
|
|
31
|
+
}
|
|
32
|
+
// Sort by author/title
|
|
33
|
+
const sorted = [...sources].sort((a, b) => {
|
|
34
|
+
const authorA = a.metadata?.author ?? a.metadata?.title ?? '';
|
|
35
|
+
const authorB = b.metadata?.author ?? b.metadata?.title ?? '';
|
|
36
|
+
return authorA.localeCompare(authorB, 'ja');
|
|
37
|
+
});
|
|
38
|
+
const citations = sorted.map(s => this.formatCitation(s, style));
|
|
39
|
+
return citations.join('\n\n');
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* インライン引用をフォーマット
|
|
43
|
+
*/
|
|
44
|
+
formatInlineCitation(source, style, number) {
|
|
45
|
+
const author = source.metadata?.author ?? '';
|
|
46
|
+
const date = source.metadata?.publishedAt;
|
|
47
|
+
const year = date ? new Date(date).getFullYear().toString() : 'n.d.';
|
|
48
|
+
switch (style) {
|
|
49
|
+
case 'apa':
|
|
50
|
+
return `(${this.getLastName(author)}, ${year})`;
|
|
51
|
+
case 'mla':
|
|
52
|
+
return `(${this.getLastName(author)})`;
|
|
53
|
+
case 'ieee':
|
|
54
|
+
return `[${number ?? 1}]`;
|
|
55
|
+
case 'chicago':
|
|
56
|
+
return `(${this.getLastName(author)} ${year})`;
|
|
57
|
+
case 'harvard':
|
|
58
|
+
return `(${this.getLastName(author)}, ${year})`;
|
|
59
|
+
default:
|
|
60
|
+
return `(${this.getLastName(author)}, ${year})`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 引用をフォーマット
|
|
65
|
+
*/
|
|
66
|
+
formatCitation(source, style) {
|
|
67
|
+
const title = source.metadata?.title ?? source.url;
|
|
68
|
+
const author = source.metadata?.author ?? '';
|
|
69
|
+
const date = source.metadata?.publishedAt;
|
|
70
|
+
const year = date ? new Date(date).getFullYear().toString() : 'n.d.';
|
|
71
|
+
const url = source.url;
|
|
72
|
+
const accessDate = new Date(source.fetchedAt).toLocaleDateString('ja-JP');
|
|
73
|
+
switch (style) {
|
|
74
|
+
case 'apa':
|
|
75
|
+
return this.formatAPA(author, year, title, url, accessDate);
|
|
76
|
+
case 'mla':
|
|
77
|
+
return this.formatMLA(author, title, url, accessDate);
|
|
78
|
+
case 'ieee':
|
|
79
|
+
return this.formatIEEE(author, title, url, accessDate);
|
|
80
|
+
case 'chicago':
|
|
81
|
+
return this.formatChicago(author, year, title, url, accessDate);
|
|
82
|
+
case 'harvard':
|
|
83
|
+
return this.formatHarvard(author, year, title, url, accessDate);
|
|
84
|
+
default:
|
|
85
|
+
return this.formatAPA(author, year, title, url, accessDate);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* APAスタイル
|
|
90
|
+
*/
|
|
91
|
+
formatAPA(author, year, title, url, accessDate) {
|
|
92
|
+
const authorPart = author || 'Author Unknown';
|
|
93
|
+
return `${authorPart}. (${year}). ${title}. Retrieved ${accessDate}, from ${url}`;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* MLAスタイル
|
|
97
|
+
*/
|
|
98
|
+
formatMLA(author, title, url, accessDate) {
|
|
99
|
+
const authorPart = author || 'Author Unknown';
|
|
100
|
+
return `${authorPart}. "${title}." Web. ${accessDate}. <${url}>.`;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* IEEEスタイル
|
|
104
|
+
*/
|
|
105
|
+
formatIEEE(author, title, url, accessDate) {
|
|
106
|
+
const authorPart = author || 'Author Unknown';
|
|
107
|
+
return `[#] ${authorPart}, "${title}," [Online]. Available: ${url}. [Accessed: ${accessDate}].`;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Chicagoスタイル
|
|
111
|
+
*/
|
|
112
|
+
formatChicago(author, year, title, url, accessDate) {
|
|
113
|
+
const authorPart = author || 'Author Unknown';
|
|
114
|
+
return `${authorPart}. "${title}." ${year}. Accessed ${accessDate}. ${url}.`;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Harvardスタイル
|
|
118
|
+
*/
|
|
119
|
+
formatHarvard(author, year, title, url, accessDate) {
|
|
120
|
+
const authorPart = author || 'Author Unknown';
|
|
121
|
+
return `${authorPart} (${year}) ${title}. Available at: ${url} (Accessed: ${accessDate}).`;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 姓を抽出
|
|
125
|
+
*/
|
|
126
|
+
getLastName(author) {
|
|
127
|
+
if (!author)
|
|
128
|
+
return 'Unknown';
|
|
129
|
+
// Japanese name: typically first character(s) are family name
|
|
130
|
+
const parts = author.split(/[\s ]+/);
|
|
131
|
+
return parts[0] ?? author;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=citation-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citation-generator.js","sourceRoot":"","sources":["../../src/citation/citation-generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAC5B;;OAEG;IACH,gBAAgB,CAAC,MAAc,EAAE,KAAoB;QACnD,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAErD,OAAO;YACL,EAAE,EAAE,QAAQ,MAAM,CAAC,EAAE,EAAE;YACvB,MAAM;YACN,KAAK;YACL,SAAS;YACT,UAAU,EAAE,MAAM,CAAC,SAAS;SAC7B,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,OAAiB,EAAE,KAAoB;QAC1D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,uBAAuB;QACvB,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CA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ACd,IAAY,EACZ,KAAa,EACb,GAAW,EACX,UAAkB;QAElB,MAAM,UAAU,GAAG,MAAM,IAAI,gBAAgB,CAAC;QAC9C,OAAO,GAAG,UAAU,KAAK,IAAI,KAAK,KAAK,mBAAmB,GAAG,eAAe,UAAU,IAAI,CAAC;IAC7F,CAAC;IAED;;OAEG;IACK,WAAW,CAAC,MAAc;QAChC,IAAI,CAAC,MAAM;YAAE,OAAO,SAAS,CAAC;QAE9B,8DAA8D;QAC9D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACrC,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/citation/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,aAAa,EACb,iBAAiB,GAClB,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/citation/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,iBAAiB,GAClB,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExportService - Multi-format content export
|
|
3
|
+
*
|
|
4
|
+
* Exports content to various formats (Markdown, HTML, JSON, Text)
|
|
5
|
+
*
|
|
6
|
+
* @module @nahisaho/katashiro-generator
|
|
7
|
+
* @task TSK-035
|
|
8
|
+
*/
|
|
9
|
+
import { type Result, type Content } from '@nahisaho/katashiro-core';
|
|
10
|
+
/**
|
|
11
|
+
* Supported export formats
|
|
12
|
+
*/
|
|
13
|
+
export type ExportFormat = 'markdown' | 'html' | 'json' | 'text';
|
|
14
|
+
/**
|
|
15
|
+
* Export options
|
|
16
|
+
*/
|
|
17
|
+
export interface ExportOptions {
|
|
18
|
+
/** Include metadata in export */
|
|
19
|
+
includeMetadata?: boolean;
|
|
20
|
+
/** Include sources/citations */
|
|
21
|
+
includeSources?: boolean;
|
|
22
|
+
/** Custom template for export */
|
|
23
|
+
template?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Export result
|
|
27
|
+
*/
|
|
28
|
+
export interface ExportResult {
|
|
29
|
+
/** Export format */
|
|
30
|
+
format: ExportFormat;
|
|
31
|
+
/** Exported content */
|
|
32
|
+
content: string;
|
|
33
|
+
/** MIME type */
|
|
34
|
+
mimeType: string;
|
|
35
|
+
/** Suggested filename */
|
|
36
|
+
filename: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* ExportService
|
|
40
|
+
*
|
|
41
|
+
* Provides multi-format export capabilities for content
|
|
42
|
+
*/
|
|
43
|
+
export declare class ExportService {
|
|
44
|
+
/**
|
|
45
|
+
* Export content to specified format
|
|
46
|
+
*
|
|
47
|
+
* @param content - Content to export
|
|
48
|
+
* @param format - Target format
|
|
49
|
+
* @param options - Export options
|
|
50
|
+
* @returns Export result
|
|
51
|
+
*/
|
|
52
|
+
export(content: Content, format: ExportFormat, options?: ExportOptions): Promise<Result<ExportResult, Error>>;
|
|
53
|
+
/**
|
|
54
|
+
* Export to Markdown format
|
|
55
|
+
*/
|
|
56
|
+
private exportToMarkdown;
|
|
57
|
+
/**
|
|
58
|
+
* Export to HTML format
|
|
59
|
+
*/
|
|
60
|
+
private exportToHtml;
|
|
61
|
+
/**
|
|
62
|
+
* Export to JSON format
|
|
63
|
+
*/
|
|
64
|
+
private exportToJson;
|
|
65
|
+
/**
|
|
66
|
+
* Export to plain text format
|
|
67
|
+
*/
|
|
68
|
+
private exportToText;
|
|
69
|
+
/**
|
|
70
|
+
* Get suggested filename for content
|
|
71
|
+
*
|
|
72
|
+
* @param content - Content
|
|
73
|
+
* @param format - Export format
|
|
74
|
+
* @returns Suggested filename
|
|
75
|
+
*/
|
|
76
|
+
getFilename(content: Content, format: ExportFormat): string;
|
|
77
|
+
/**
|
|
78
|
+
* Get list of supported export formats
|
|
79
|
+
*
|
|
80
|
+
* @returns Array of supported formats
|
|
81
|
+
*/
|
|
82
|
+
getSupportedFormats(): ExportFormat[];
|
|
83
|
+
/**
|
|
84
|
+
* Convert basic Markdown to HTML
|
|
85
|
+
*/
|
|
86
|
+
private markdownToHtml;
|
|
87
|
+
/**
|
|
88
|
+
* Escape HTML special characters
|
|
89
|
+
*/
|
|
90
|
+
private escapeHtml;
|
|
91
|
+
/**
|
|
92
|
+
* Strip Markdown formatting from text
|
|
93
|
+
*/
|
|
94
|
+
private stripMarkdown;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=export-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-service.d.ts","sourceRoot":"","sources":["../../src/export/export-service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAW,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gCAAgC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAsBD;;;;GAIG;AACH,qBAAa,aAAa;IACxB;;;;;;;OAOG;IACG,MAAM,CACV,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAgCvC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiCxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAsDpB;;OAEG;IACH,OAAO,CAAC,YAAY;IAoBpB;;OAEG;IACH,OAAO,CAAC,YAAY;IAgCpB;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM;IAS3D;;;;OAIG;IACH,mBAAmB,IAAI,YAAY,EAAE;IAIrC;;OAEG;IACH,OAAO,CAAC,cAAc;IA8BtB;;OAEG;IACH,OAAO,CAAC,UAAU;IASlB;;OAEG;IACH,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExportService - Multi-format content export
|
|
3
|
+
*
|
|
4
|
+
* Exports content to various formats (Markdown, HTML, JSON, Text)
|
|
5
|
+
*
|
|
6
|
+
* @module @nahisaho/katashiro-generator
|
|
7
|
+
* @task TSK-035
|
|
8
|
+
*/
|
|
9
|
+
import { ok, err } from '@nahisaho/katashiro-core';
|
|
10
|
+
/**
|
|
11
|
+
* MIME types for each format
|
|
12
|
+
*/
|
|
13
|
+
const MIME_TYPES = {
|
|
14
|
+
markdown: 'text/markdown',
|
|
15
|
+
html: 'text/html',
|
|
16
|
+
json: 'application/json',
|
|
17
|
+
text: 'text/plain',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* File extensions for each format
|
|
21
|
+
*/
|
|
22
|
+
const EXTENSIONS = {
|
|
23
|
+
markdown: '.md',
|
|
24
|
+
html: '.html',
|
|
25
|
+
json: '.json',
|
|
26
|
+
text: '.txt',
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* ExportService
|
|
30
|
+
*
|
|
31
|
+
* Provides multi-format export capabilities for content
|
|
32
|
+
*/
|
|
33
|
+
export class ExportService {
|
|
34
|
+
/**
|
|
35
|
+
* Export content to specified format
|
|
36
|
+
*
|
|
37
|
+
* @param content - Content to export
|
|
38
|
+
* @param format - Target format
|
|
39
|
+
* @param options - Export options
|
|
40
|
+
* @returns Export result
|
|
41
|
+
*/
|
|
42
|
+
async export(content, format, options = {}) {
|
|
43
|
+
try {
|
|
44
|
+
let exportedContent;
|
|
45
|
+
switch (format) {
|
|
46
|
+
case 'markdown':
|
|
47
|
+
exportedContent = this.exportToMarkdown(content, options);
|
|
48
|
+
break;
|
|
49
|
+
case 'html':
|
|
50
|
+
exportedContent = this.exportToHtml(content, options);
|
|
51
|
+
break;
|
|
52
|
+
case 'json':
|
|
53
|
+
exportedContent = this.exportToJson(content, options);
|
|
54
|
+
break;
|
|
55
|
+
case 'text':
|
|
56
|
+
exportedContent = this.exportToText(content, options);
|
|
57
|
+
break;
|
|
58
|
+
default:
|
|
59
|
+
return err(new Error(`Unsupported format: ${format}`));
|
|
60
|
+
}
|
|
61
|
+
return ok({
|
|
62
|
+
format,
|
|
63
|
+
content: exportedContent,
|
|
64
|
+
mimeType: MIME_TYPES[format],
|
|
65
|
+
filename: this.getFilename(content, format),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Export to Markdown format
|
|
74
|
+
*/
|
|
75
|
+
exportToMarkdown(content, options) {
|
|
76
|
+
const lines = [];
|
|
77
|
+
// Title
|
|
78
|
+
lines.push(`# ${content.title}`);
|
|
79
|
+
lines.push('');
|
|
80
|
+
// Metadata
|
|
81
|
+
if (options.includeMetadata) {
|
|
82
|
+
lines.push('---');
|
|
83
|
+
lines.push(`作成日: ${content.createdAt}`);
|
|
84
|
+
lines.push(`更新日: ${content.updatedAt}`);
|
|
85
|
+
lines.push('---');
|
|
86
|
+
lines.push('');
|
|
87
|
+
}
|
|
88
|
+
// Body
|
|
89
|
+
lines.push(content.body);
|
|
90
|
+
// Sources
|
|
91
|
+
if (options.includeSources && content.sources.length > 0) {
|
|
92
|
+
lines.push('');
|
|
93
|
+
lines.push('## 参考文献');
|
|
94
|
+
lines.push('');
|
|
95
|
+
content.sources.forEach((source, index) => {
|
|
96
|
+
const title = source.metadata?.title ?? source.url;
|
|
97
|
+
lines.push(`${index + 1}. [${title}](${source.url})`);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return lines.join('\n');
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Export to HTML format
|
|
104
|
+
*/
|
|
105
|
+
exportToHtml(content, options) {
|
|
106
|
+
const bodyHtml = this.markdownToHtml(content.body);
|
|
107
|
+
let metadataHtml = '';
|
|
108
|
+
if (options.includeMetadata) {
|
|
109
|
+
metadataHtml = `
|
|
110
|
+
<div class="metadata">
|
|
111
|
+
<p>作成日: ${content.createdAt}</p>
|
|
112
|
+
<p>更新日: ${content.updatedAt}</p>
|
|
113
|
+
</div>`;
|
|
114
|
+
}
|
|
115
|
+
let sourcesHtml = '';
|
|
116
|
+
if (options.includeSources && content.sources.length > 0) {
|
|
117
|
+
const sourceItems = content.sources
|
|
118
|
+
.map((source) => {
|
|
119
|
+
const title = source.metadata?.title ?? source.url;
|
|
120
|
+
return ` <li><a href="${source.url}">${this.escapeHtml(title)}</a></li>`;
|
|
121
|
+
})
|
|
122
|
+
.join('\n');
|
|
123
|
+
sourcesHtml = `
|
|
124
|
+
<section class="sources">
|
|
125
|
+
<h2>参考文献</h2>
|
|
126
|
+
<ol>
|
|
127
|
+
${sourceItems}
|
|
128
|
+
</ol>
|
|
129
|
+
</section>`;
|
|
130
|
+
}
|
|
131
|
+
return `<!DOCTYPE html>
|
|
132
|
+
<html lang="ja">
|
|
133
|
+
<head>
|
|
134
|
+
<meta charset="UTF-8">
|
|
135
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
136
|
+
<title>${this.escapeHtml(content.title)}</title>
|
|
137
|
+
<style>
|
|
138
|
+
body { font-family: sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; }
|
|
139
|
+
h1 { border-bottom: 2px solid #333; padding-bottom: 10px; }
|
|
140
|
+
.metadata { color: #666; font-size: 0.9em; margin-bottom: 20px; }
|
|
141
|
+
.sources { margin-top: 30px; border-top: 1px solid #ccc; padding-top: 20px; }
|
|
142
|
+
</style>
|
|
143
|
+
</head>
|
|
144
|
+
<body>
|
|
145
|
+
<article>
|
|
146
|
+
<h1>${this.escapeHtml(content.title)}</h1>${metadataHtml}
|
|
147
|
+
<div class="content">
|
|
148
|
+
${bodyHtml}
|
|
149
|
+
</div>${sourcesHtml}
|
|
150
|
+
</article>
|
|
151
|
+
</body>
|
|
152
|
+
</html>`;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Export to JSON format
|
|
156
|
+
*/
|
|
157
|
+
exportToJson(content, options) {
|
|
158
|
+
const data = {
|
|
159
|
+
title: content.title,
|
|
160
|
+
body: content.body,
|
|
161
|
+
type: content.type,
|
|
162
|
+
};
|
|
163
|
+
if (options.includeMetadata) {
|
|
164
|
+
data.createdAt = content.createdAt;
|
|
165
|
+
data.updatedAt = content.updatedAt;
|
|
166
|
+
data.id = content.id;
|
|
167
|
+
}
|
|
168
|
+
if (options.includeSources) {
|
|
169
|
+
data.sources = content.sources;
|
|
170
|
+
}
|
|
171
|
+
return JSON.stringify(data, null, 2);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Export to plain text format
|
|
175
|
+
*/
|
|
176
|
+
exportToText(content, options) {
|
|
177
|
+
const lines = [];
|
|
178
|
+
// Title
|
|
179
|
+
lines.push(content.title);
|
|
180
|
+
lines.push('='.repeat(content.title.length));
|
|
181
|
+
lines.push('');
|
|
182
|
+
// Metadata
|
|
183
|
+
if (options.includeMetadata) {
|
|
184
|
+
lines.push(`作成日: ${content.createdAt}`);
|
|
185
|
+
lines.push(`更新日: ${content.updatedAt}`);
|
|
186
|
+
lines.push('');
|
|
187
|
+
}
|
|
188
|
+
// Body (strip markdown)
|
|
189
|
+
lines.push(this.stripMarkdown(content.body));
|
|
190
|
+
// Sources
|
|
191
|
+
if (options.includeSources && content.sources.length > 0) {
|
|
192
|
+
lines.push('');
|
|
193
|
+
lines.push('参考文献');
|
|
194
|
+
lines.push('-'.repeat(8));
|
|
195
|
+
content.sources.forEach((source, index) => {
|
|
196
|
+
const title = source.metadata?.title ?? source.url;
|
|
197
|
+
lines.push(`${index + 1}. ${title}: ${source.url}`);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return lines.join('\n');
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Get suggested filename for content
|
|
204
|
+
*
|
|
205
|
+
* @param content - Content
|
|
206
|
+
* @param format - Export format
|
|
207
|
+
* @returns Suggested filename
|
|
208
|
+
*/
|
|
209
|
+
getFilename(content, format) {
|
|
210
|
+
const safeTitle = content.title
|
|
211
|
+
.replace(/[<>:"/\\|?*]/g, '_')
|
|
212
|
+
.substring(0, 50)
|
|
213
|
+
.trim();
|
|
214
|
+
return `${safeTitle}${EXTENSIONS[format]}`;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Get list of supported export formats
|
|
218
|
+
*
|
|
219
|
+
* @returns Array of supported formats
|
|
220
|
+
*/
|
|
221
|
+
getSupportedFormats() {
|
|
222
|
+
return ['markdown', 'html', 'json', 'text'];
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Convert basic Markdown to HTML
|
|
226
|
+
*/
|
|
227
|
+
markdownToHtml(markdown) {
|
|
228
|
+
return markdown
|
|
229
|
+
.split('\n\n')
|
|
230
|
+
.map((paragraph) => {
|
|
231
|
+
// Headers
|
|
232
|
+
if (paragraph.startsWith('# ')) {
|
|
233
|
+
return ` <h1>${this.escapeHtml(paragraph.slice(2))}</h1>`;
|
|
234
|
+
}
|
|
235
|
+
if (paragraph.startsWith('## ')) {
|
|
236
|
+
return ` <h2>${this.escapeHtml(paragraph.slice(3))}</h2>`;
|
|
237
|
+
}
|
|
238
|
+
if (paragraph.startsWith('### ')) {
|
|
239
|
+
return ` <h3>${this.escapeHtml(paragraph.slice(4))}</h3>`;
|
|
240
|
+
}
|
|
241
|
+
// Lists
|
|
242
|
+
if (paragraph.startsWith('- ') || paragraph.startsWith('* ')) {
|
|
243
|
+
const items = paragraph
|
|
244
|
+
.split('\n')
|
|
245
|
+
.map((line) => ` <li>${this.escapeHtml(line.slice(2))}</li>`)
|
|
246
|
+
.join('\n');
|
|
247
|
+
return ` <ul>\n${items}\n </ul>`;
|
|
248
|
+
}
|
|
249
|
+
// Regular paragraph
|
|
250
|
+
return ` <p>${this.escapeHtml(paragraph)}</p>`;
|
|
251
|
+
})
|
|
252
|
+
.join('\n');
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Escape HTML special characters
|
|
256
|
+
*/
|
|
257
|
+
escapeHtml(text) {
|
|
258
|
+
return text
|
|
259
|
+
.replace(/&/g, '&')
|
|
260
|
+
.replace(/</g, '<')
|
|
261
|
+
.replace(/>/g, '>')
|
|
262
|
+
.replace(/"/g, '"')
|
|
263
|
+
.replace(/'/g, ''');
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Strip Markdown formatting from text
|
|
267
|
+
*/
|
|
268
|
+
stripMarkdown(markdown) {
|
|
269
|
+
return markdown
|
|
270
|
+
.replace(/^#+\s*/gm, '') // Headers
|
|
271
|
+
.replace(/\*\*(.*?)\*\*/g, '$1') // Bold
|
|
272
|
+
.replace(/\*(.*?)\*/g, '$1') // Italic
|
|
273
|
+
.replace(/`(.*?)`/g, '$1') // Code
|
|
274
|
+
.replace(/\[(.*?)\]\(.*?\)/g, '$1') // Links
|
|
275
|
+
.replace(/^[-*]\s*/gm, '• '); // Lists
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=export-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-service.js","sourceRoot":"","sources":["../../src/export/export-service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,EAAE,EAAE,GAAG,EAA6B,MAAM,0BAA0B,CAAC;AAiC9E;;GAEG;AACH,MAAM,UAAU,GAAiC;IAC/C,QAAQ,EAAE,eAAe;IACzB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,YAAY;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAiC;IAC/C,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,MAAM;CACb,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,aAAa;IACxB;;;;;;;OAOG;IACH,KAAK,CAAC,MAAM,CACV,OAAgB,EAChB,MAAoB,EACpB,UAAyB,EAAE;QAE3B,IAAI,CAAC;YACH,IAAI,eAAuB,CAAC;YAE5B,QAAQ,MAAM,EAAE,CAAC;gBACf,KAAK,UAAU;oBACb,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBAC1D,MAAM;gBACR,KAAK,MAAM;oBACT,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBACtD,MAAM;gBACR,KAAK,MAAM;oBACT,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBACtD,MAAM;gBACR,KAAK,MAAM;oBACT,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBACtD,MAAM;gBACR;oBACE,OAAO,GAAG,CAAC,IAAI,KAAK,CAAC,uBAAuB,MAAM,EA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MAAM,CAAC;QACtD,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACK,UAAU,CAAC,IAAY;QAC7B,OAAO,IAAI;aACR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;aACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;aACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;aACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;aACvB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,QAAgB;QACpC,OAAO,QAAQ;aACZ,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,UAAU;aAClC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,OAAO;aACvC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,SAAS;aACrC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,OAAO;aACjC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC,QAAQ;aAC3C,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,aAAa,GAId,MAAM,qBAAqB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nahisaho/katashiro-generator
|
|
3
|
+
* コンテンツ生成パッケージ
|
|
4
|
+
*
|
|
5
|
+
* @requirement REQ-GENERATE-001 ~ REQ-GENERATE-010
|
|
6
|
+
* @design DES-KATASHIRO-001 §2.2 Generator Container
|
|
7
|
+
*/
|
|
8
|
+
export type { IContentGenerator, ICitationManager, IOutlineGenerator, ISummaryGenerator, ITranslationGenerator, IChartGenerator, IPlatformFormatter, } from './interfaces.js';
|
|
9
|
+
export type { GenerationOptions, Outline, Citation, ChartConfig, PlatformFormat, } from './types.js';
|
|
10
|
+
export { ReportGenerator, type ReportConfig, type ReportSection, } from './report/index.js';
|
|
11
|
+
export { SummaryGenerator, type SummaryConfig, } from './summary/index.js';
|
|
12
|
+
export { CitationGenerator, type CitationStyle, type GeneratedCitation, } from './citation/index.js';
|
|
13
|
+
export { TemplateEngine, type Template, type HelperFunction, } from './template/index.js';
|
|
14
|
+
export { PresentationGenerator, type SlideType, type Slide, type Presentation, type PresentationConfig, } from './presentation/index.js';
|
|
15
|
+
export { ExportService, type ExportFormat, type ExportOptions, type ExportResult, } from './export/index.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|