@principal-ade/markdown-utils 0.1.3
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/README.md +148 -0
- package/dist/cjs/diff/diffPresentations.d.ts +17 -0
- package/dist/cjs/diff/diffPresentations.d.ts.map +1 -0
- package/dist/cjs/diff/diffSummary.d.ts +31 -0
- package/dist/cjs/diff/diffSummary.d.ts.map +1 -0
- package/dist/cjs/diff/index.d.ts +11 -0
- package/dist/cjs/diff/index.d.ts.map +1 -0
- package/dist/cjs/diff/matchSlides.d.ts +44 -0
- package/dist/cjs/diff/matchSlides.d.ts.map +1 -0
- package/dist/cjs/diff/textDiff.d.ts +30 -0
- package/dist/cjs/diff/textDiff.d.ts.map +1 -0
- package/dist/cjs/index.d.ts +12 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +773 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types/bash.d.ts +17 -0
- package/dist/cjs/types/bash.d.ts.map +1 -0
- package/dist/cjs/types/chunks.d.ts +23 -0
- package/dist/cjs/types/chunks.d.ts.map +1 -0
- package/dist/cjs/types/diff.d.ts +72 -0
- package/dist/cjs/types/diff.d.ts.map +1 -0
- package/dist/cjs/types/presentation.d.ts +48 -0
- package/dist/cjs/types/presentation.d.ts.map +1 -0
- package/dist/cjs/utils/bash-parser.d.ts +10 -0
- package/dist/cjs/utils/bash-parser.d.ts.map +1 -0
- package/dist/cjs/utils/image-urls.d.ts +15 -0
- package/dist/cjs/utils/image-urls.d.ts.map +1 -0
- package/dist/cjs/utils/markdown-parser.d.ts +7 -0
- package/dist/cjs/utils/markdown-parser.d.ts.map +1 -0
- package/dist/cjs/utils/presentation.d.ts +23 -0
- package/dist/cjs/utils/presentation.d.ts.map +1 -0
- package/dist/cjs/utils/slide-titles.d.ts +28 -0
- package/dist/cjs/utils/slide-titles.d.ts.map +1 -0
- package/dist/esm/diff/diffPresentations.d.ts +17 -0
- package/dist/esm/diff/diffPresentations.d.ts.map +1 -0
- package/dist/esm/diff/diffSummary.d.ts +31 -0
- package/dist/esm/diff/diffSummary.d.ts.map +1 -0
- package/dist/esm/diff/index.d.ts +11 -0
- package/dist/esm/diff/index.d.ts.map +1 -0
- package/dist/esm/diff/matchSlides.d.ts +44 -0
- package/dist/esm/diff/matchSlides.d.ts.map +1 -0
- package/dist/esm/diff/textDiff.d.ts +30 -0
- package/dist/esm/diff/textDiff.d.ts.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +741 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/types/bash.d.ts +17 -0
- package/dist/esm/types/bash.d.ts.map +1 -0
- package/dist/esm/types/chunks.d.ts +23 -0
- package/dist/esm/types/chunks.d.ts.map +1 -0
- package/dist/esm/types/diff.d.ts +72 -0
- package/dist/esm/types/diff.d.ts.map +1 -0
- package/dist/esm/types/presentation.d.ts +48 -0
- package/dist/esm/types/presentation.d.ts.map +1 -0
- package/dist/esm/utils/bash-parser.d.ts +10 -0
- package/dist/esm/utils/bash-parser.d.ts.map +1 -0
- package/dist/esm/utils/image-urls.d.ts +15 -0
- package/dist/esm/utils/image-urls.d.ts.map +1 -0
- package/dist/esm/utils/markdown-parser.d.ts +7 -0
- package/dist/esm/utils/markdown-parser.d.ts.map +1 -0
- package/dist/esm/utils/presentation.d.ts +23 -0
- package/dist/esm/utils/presentation.d.ts.map +1 -0
- package/dist/esm/utils/slide-titles.d.ts +28 -0
- package/dist/esm/utils/slide-titles.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# @a24z/markdown-utils
|
|
2
|
+
|
|
3
|
+
Core markdown parsing and presentation utilities without React dependencies. Extract slides, parse chunks, and handle markdown transformations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @a24z/markdown-utils
|
|
9
|
+
# or
|
|
10
|
+
bun add @a24z/markdown-utils
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- 📝 **Markdown parsing** - Parse markdown into typed chunks
|
|
16
|
+
- 🎯 **Slide extraction** - Split markdown into presentation slides
|
|
17
|
+
- 🔀 **Presentation diffing** - Compare two presentations slide-by-slide
|
|
18
|
+
- 🔌 **Extensible** - Plugin system for custom chunk types
|
|
19
|
+
- 🚀 **Zero React dependencies** - Pure TypeScript utilities
|
|
20
|
+
- 📦 **Lightweight** - ~22KB bundled
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Parse Markdown into Chunks
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { parseMarkdownChunks, CHUNK_TYPES } from '@a24z/markdown-utils';
|
|
28
|
+
|
|
29
|
+
const chunks = parseMarkdownChunks(markdownContent, 'my-prefix');
|
|
30
|
+
|
|
31
|
+
chunks.forEach(chunk => {
|
|
32
|
+
if (chunk.type === CHUNK_TYPES.MERMAID) {
|
|
33
|
+
// Handle mermaid diagram
|
|
34
|
+
console.log('Mermaid:', chunk.content);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Create Presentation from Markdown
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { parseMarkdownIntoPresentation, MarkdownPresentationFormat } from '@a24z/markdown-utils';
|
|
43
|
+
|
|
44
|
+
// Split by horizontal rules (---)
|
|
45
|
+
const presentation = parseMarkdownIntoPresentation(
|
|
46
|
+
markdownContent,
|
|
47
|
+
MarkdownPresentationFormat.HORIZONTAL_RULE
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
console.log(`${presentation.slides.length} slides found`);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Compare Two Presentations
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { diffPresentations, parseMarkdownIntoPresentation } from '@a24z/markdown-utils';
|
|
57
|
+
|
|
58
|
+
const beforePresentation = parseMarkdownIntoPresentation(beforeMarkdown);
|
|
59
|
+
const afterPresentation = parseMarkdownIntoPresentation(afterMarkdown);
|
|
60
|
+
|
|
61
|
+
const diff = diffPresentations(beforePresentation, afterPresentation);
|
|
62
|
+
|
|
63
|
+
console.log(`${diff.summary.modified} slides modified`);
|
|
64
|
+
console.log(`${diff.summary.added} slides added`);
|
|
65
|
+
console.log(`${diff.summary.removed} slides removed`);
|
|
66
|
+
|
|
67
|
+
// Iterate through slide-by-slide diffs
|
|
68
|
+
diff.slideDiffs.forEach(slideDiff => {
|
|
69
|
+
console.log(`Slide status: ${slideDiff.status}`);
|
|
70
|
+
|
|
71
|
+
if (slideDiff.status === 'modified') {
|
|
72
|
+
// Access line-by-line content changes
|
|
73
|
+
slideDiff.contentChanges?.forEach(change => {
|
|
74
|
+
if (change.type === 'add') {
|
|
75
|
+
console.log(`+ ${change.value}`);
|
|
76
|
+
} else if (change.type === 'remove') {
|
|
77
|
+
console.log(`- ${change.value}`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Extend with Custom Chunks
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { BaseChunk, parseMarkdownChunks } from '@a24z/markdown-utils';
|
|
88
|
+
|
|
89
|
+
// Define custom chunk type
|
|
90
|
+
interface MathChunk extends BaseChunk<'math_chunk'> {
|
|
91
|
+
formula: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Custom parser
|
|
95
|
+
const mathParser = (content: string, idPrefix: string): MathChunk[] => {
|
|
96
|
+
// Parse LaTeX math blocks...
|
|
97
|
+
return [];
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// Use with parser
|
|
101
|
+
const chunks = parseMarkdownChunks<MathChunk | ContentChunk>(
|
|
102
|
+
content,
|
|
103
|
+
'prefix',
|
|
104
|
+
[mathParser]
|
|
105
|
+
);
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## API
|
|
109
|
+
|
|
110
|
+
### Types
|
|
111
|
+
|
|
112
|
+
**Chunks:**
|
|
113
|
+
- `BaseChunk<T>` - Base interface for extensible chunks
|
|
114
|
+
- `MarkdownChunk`, `MermaidChunk`, `CodeChunk` - Built-in chunk types
|
|
115
|
+
|
|
116
|
+
**Presentations:**
|
|
117
|
+
- `MarkdownPresentation`, `MarkdownSlide` - Presentation types
|
|
118
|
+
|
|
119
|
+
**Diffs:**
|
|
120
|
+
- `PresentationDiff` - Complete diff analysis between two presentations
|
|
121
|
+
- `SlideDiff` - Diff between two versions of a slide
|
|
122
|
+
- `DiffSummary` - Summary statistics for a presentation diff
|
|
123
|
+
- `DiffStatus` - Status of a slide: `'added' | 'removed' | 'modified' | 'unchanged' | 'moved'`
|
|
124
|
+
- `TextDiff` - Line-level text change
|
|
125
|
+
|
|
126
|
+
### Functions
|
|
127
|
+
|
|
128
|
+
**Parsing:**
|
|
129
|
+
- `parseMarkdownChunks()` - Parse markdown into typed chunks
|
|
130
|
+
- `parseMarkdownIntoPresentation()` - Create presentation from markdown
|
|
131
|
+
- `extractSlideTitle()` - Extract title from slide content
|
|
132
|
+
|
|
133
|
+
**Diffing:**
|
|
134
|
+
- `diffPresentations()` - Compare two presentations and generate diff
|
|
135
|
+
- `calculateDiffSummary()` - Generate summary statistics from a diff
|
|
136
|
+
- `diffText()` - Low-level line-by-line text comparison
|
|
137
|
+
- `hasChanges()` - Check if a diff has any changes
|
|
138
|
+
- `formatDiffSummary()` - Format summary as human-readable string
|
|
139
|
+
|
|
140
|
+
**Utilities:**
|
|
141
|
+
- `parseBashCommands()` - Parse bash code blocks
|
|
142
|
+
- `transformImageUrl()` - Transform relative URLs to absolute
|
|
143
|
+
- `slidesAreEqual()` - Check if two slides are identical
|
|
144
|
+
- `normalizeText()` - Normalize text for comparison
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
MIT - a24z Team
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MarkdownPresentation } from '../types/presentation';
|
|
2
|
+
import { PresentationDiff } from '../types/diff';
|
|
3
|
+
/**
|
|
4
|
+
* Compares two markdown presentations and generates a complete diff analysis.
|
|
5
|
+
*
|
|
6
|
+
* The algorithm:
|
|
7
|
+
* 1. Matches slides between presentations (by title, then position)
|
|
8
|
+
* 2. Determines the status of each slide (added, removed, modified, unchanged, moved)
|
|
9
|
+
* 3. For modified slides, computes line-by-line content changes
|
|
10
|
+
* 4. Generates summary statistics
|
|
11
|
+
*
|
|
12
|
+
* @param before - The original presentation
|
|
13
|
+
* @param after - The modified presentation
|
|
14
|
+
* @returns Complete diff analysis including slide-by-slide comparison and summary
|
|
15
|
+
*/
|
|
16
|
+
export declare function diffPresentations(before: MarkdownPresentation, after: MarkdownPresentation): PresentationDiff;
|
|
17
|
+
//# sourceMappingURL=diffPresentations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diffPresentations.d.ts","sourceRoot":"","sources":["../../../src/diff/diffPresentations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAyB,MAAM,eAAe,CAAC;AAKxE;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,oBAAoB,EAC5B,KAAK,EAAE,oBAAoB,GAC1B,gBAAgB,CA6BlB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PresentationDiff, DiffSummary } from '../types/diff';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates summary statistics for a presentation diff.
|
|
4
|
+
* Counts the number of slides in each status category.
|
|
5
|
+
*
|
|
6
|
+
* @param diff - The presentation diff to summarize
|
|
7
|
+
* @returns Summary statistics with counts for each diff status
|
|
8
|
+
*/
|
|
9
|
+
export declare function calculateDiffSummary(diff: PresentationDiff): DiffSummary;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a presentation diff has any changes.
|
|
12
|
+
*
|
|
13
|
+
* @param diff - The presentation diff to check
|
|
14
|
+
* @returns true if there are any changes (added, removed, modified, or moved slides)
|
|
15
|
+
*/
|
|
16
|
+
export declare function hasChanges(diff: PresentationDiff): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Gets the total number of changed slides (excluding unchanged).
|
|
19
|
+
*
|
|
20
|
+
* @param summary - The diff summary
|
|
21
|
+
* @returns Total number of changed slides
|
|
22
|
+
*/
|
|
23
|
+
export declare function getTotalChangedSlides(summary: DiffSummary): number;
|
|
24
|
+
/**
|
|
25
|
+
* Formats a diff summary as a human-readable string.
|
|
26
|
+
*
|
|
27
|
+
* @param summary - The diff summary to format
|
|
28
|
+
* @returns Formatted string describing the changes
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatDiffSummary(summary: DiffSummary): string;
|
|
31
|
+
//# sourceMappingURL=diffSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diffSummary.d.ts","sourceRoot":"","sources":["../../../src/diff/diffSummary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,CAiCxE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAQ1D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAqB9D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diff utilities for comparing markdown presentations
|
|
3
|
+
* @module diff
|
|
4
|
+
*/
|
|
5
|
+
export { diffPresentations } from './diffPresentations';
|
|
6
|
+
export { calculateDiffSummary, hasChanges, getTotalChangedSlides, formatDiffSummary, } from './diffSummary';
|
|
7
|
+
export { diffText, normalizedTextEquals, normalizeText } from './textDiff';
|
|
8
|
+
export { matchSlides, slidesAreEqual, normalizeSlideContent, } from './matchSlides';
|
|
9
|
+
export type { SlideMatch } from './matchSlides';
|
|
10
|
+
export type { DiffStatus, TextDiffType, TextDiff, SlideDiff, DiffSummary, PresentationDiff, } from '../types/diff';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/diff/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3E,OAAO,EACL,WAAW,EACX,cAAc,EACd,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,YAAY,EACV,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { MarkdownSlide } from '../types/presentation';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a matched pair of slides from before and after presentations
|
|
4
|
+
*/
|
|
5
|
+
export interface SlideMatch {
|
|
6
|
+
/** Slide from before presentation (undefined if added) */
|
|
7
|
+
beforeSlide?: MarkdownSlide;
|
|
8
|
+
/** Slide from after presentation (undefined if removed) */
|
|
9
|
+
afterSlide?: MarkdownSlide;
|
|
10
|
+
/** Index in before presentation (undefined if added) */
|
|
11
|
+
beforeIndex?: number;
|
|
12
|
+
/** Index in after presentation (undefined if removed) */
|
|
13
|
+
afterIndex?: number;
|
|
14
|
+
/** Whether the slide was matched by title or position */
|
|
15
|
+
matchedBy: 'title' | 'position' | 'none';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Matches slides between two presentations using a two-phase approach:
|
|
19
|
+
* 1. First, match slides by title
|
|
20
|
+
* 2. Then, match remaining slides by position
|
|
21
|
+
*
|
|
22
|
+
* @param beforeSlides - Slides from the before presentation
|
|
23
|
+
* @param afterSlides - Slides from the after presentation
|
|
24
|
+
* @returns Array of matched slide pairs
|
|
25
|
+
*/
|
|
26
|
+
export declare function matchSlides(beforeSlides: MarkdownSlide[], afterSlides: MarkdownSlide[]): SlideMatch[];
|
|
27
|
+
/**
|
|
28
|
+
* Checks if two slides are equal (identical content).
|
|
29
|
+
* Compares normalized content to avoid false positives from whitespace differences.
|
|
30
|
+
*
|
|
31
|
+
* @param slide1 - First slide to compare
|
|
32
|
+
* @param slide2 - Second slide to compare
|
|
33
|
+
* @returns true if slides have identical content
|
|
34
|
+
*/
|
|
35
|
+
export declare function slidesAreEqual(slide1: MarkdownSlide, slide2: MarkdownSlide): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Normalizes slide content for comparison.
|
|
38
|
+
* Extracts and normalizes the text content from the slide's location.
|
|
39
|
+
*
|
|
40
|
+
* @param slide - Slide to normalize
|
|
41
|
+
* @returns Normalized content string
|
|
42
|
+
*/
|
|
43
|
+
export declare function normalizeSlideContent(slide: MarkdownSlide): string;
|
|
44
|
+
//# sourceMappingURL=matchSlides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchSlides.d.ts","sourceRoot":"","sources":["../../../src/diff/matchSlides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,SAAS,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;CAC1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,aAAa,EAAE,EAC7B,WAAW,EAAE,aAAa,EAAE,GAC3B,UAAU,EAAE,CAyFd;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,GACpB,OAAO,CAGT;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAElE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TextDiff } from '../types/diff';
|
|
2
|
+
/**
|
|
3
|
+
* Performs a line-by-line diff between two text strings.
|
|
4
|
+
* Uses a simple longest common subsequence (LCS) based algorithm.
|
|
5
|
+
*
|
|
6
|
+
* @param beforeContent - The original text
|
|
7
|
+
* @param afterContent - The modified text
|
|
8
|
+
* @returns Array of TextDiff objects representing the changes
|
|
9
|
+
*/
|
|
10
|
+
export declare function diffText(beforeContent: string, afterContent: string): TextDiff[];
|
|
11
|
+
/**
|
|
12
|
+
* Checks if two text strings are equal after normalization.
|
|
13
|
+
* Normalization includes trimming whitespace and normalizing line endings.
|
|
14
|
+
*
|
|
15
|
+
* @param text1 - First text to compare
|
|
16
|
+
* @param text2 - Second text to compare
|
|
17
|
+
* @returns true if texts are equal after normalization
|
|
18
|
+
*/
|
|
19
|
+
export declare function normalizedTextEquals(text1: string, text2: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Normalizes text by:
|
|
22
|
+
* - Trimming leading/trailing whitespace
|
|
23
|
+
* - Normalizing line endings to \n
|
|
24
|
+
* - Removing trailing whitespace from each line
|
|
25
|
+
*
|
|
26
|
+
* @param text - Text to normalize
|
|
27
|
+
* @returns Normalized text
|
|
28
|
+
*/
|
|
29
|
+
export declare function normalizeText(text: string): string;
|
|
30
|
+
//# sourceMappingURL=textDiff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textDiff.d.ts","sourceRoot":"","sources":["../../../src/diff/textDiff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GACnB,QAAQ,EAAE,CAeZ;AA+ED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOlD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { CHUNK_TYPES, type ChunkType, type BaseChunk, type MarkdownChunk, type MermaidChunk, type SlideChunk, type CodeChunk, type ContentChunk, isMarkdownChunk, isMermaidChunk, isCodeChunk, } from './types/chunks';
|
|
2
|
+
export { MarkdownSourceType, type MarkdownSource, type MarkdownSlideLocation, type MarkdownSlide, type RepositoryInfo, type MarkdownPresentation, } from './types/presentation';
|
|
3
|
+
export { type BashCommand, type BashCommandOptions, type BashCommandResult, } from './types/bash';
|
|
4
|
+
export { parseMarkdownChunks, } from './utils/markdown-parser';
|
|
5
|
+
export { extractSlideTitle, parseMarkdownIntoPresentationFromSource, parseMarkdownIntoPresentation, serializePresentationToMarkdown, updatePresentationSlide, } from './utils/presentation';
|
|
6
|
+
export { parseBashCommands, getCommandDisplayName, } from './utils/bash-parser';
|
|
7
|
+
export { isRelativeUrl, transformImageUrl, transformMarkdownImageUrls, } from './utils/image-urls';
|
|
8
|
+
export { extractAllSlideTitles, getAllSlideTitles, findSlideByTitle, findSlideIndexByTitle, } from './utils/slide-titles';
|
|
9
|
+
export type { DiffStatus, TextDiffType, TextDiff, SlideDiff, DiffSummary, PresentationDiff, } from './types/diff';
|
|
10
|
+
export { diffPresentations, calculateDiffSummary, hasChanges, getTotalChangedSlides, formatDiffSummary, diffText, normalizedTextEquals, normalizeText, matchSlides, slidesAreEqual, normalizeSlideContent, } from './diff';
|
|
11
|
+
export type { SlideMatch } from './diff';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,iBAAiB,EACjB,uCAAuC,EACvC,6BAA6B,EAC7B,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EACV,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,cAAc,EACd,qBAAqB,GACtB,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC"}
|