Skip to content

feat: support loading multiple markdown sources via sourceUrls option#20

Merged
dpecos merged 1 commit into
masterfrom
feat/issue-7-source-urls
Apr 16, 2026
Merged

feat: support loading multiple markdown sources via sourceUrls option#20
dpecos merged 1 commit into
masterfrom
feat/issue-7-source-urls

Conversation

@dpecos
Copy link
Copy Markdown
Contributor

@dpecos dpecos commented Apr 16, 2026

Summary

  • Adds sourceUrls: string[] to SlideshowOptions
  • Fetches all URLs in parallel, concatenates results in order (joined with \n---\n slide separators), then parses as a single deck
  • Exposes loadFromUrls(urls, callback) as a public method alongside the existing loadFromUrl / loadFromString
  • When both sourceUrls and sourceUrl are provided, sourceUrls takes precedence
  • 5 new tests covering: slide count, content preservation, public API, and precedence

API

mdeck.createSlideshow({
  sourceUrls: ['intro.md', 'chapter1.md', 'chapter2.md', 'outro.md']
});

// or imperatively:
slideshow.loadFromUrls(['part1.md', 'part2.md'], (ss) => console.log(ss.getSlideCount()));

Implementation notes

  • Each URL is fetched via the existing XMLHttpRequest abstraction (same as loadFromUrl), wrapped in a Promise
  • Promise.all fetches all concurrently; order is preserved by the array join
  • Files are joined with \n---\n so each file's content starts as a new slide, even if the file itself doesn't end with a separator

Closes #7

Adds a sourceUrls option (array of URLs) to createSlideshow(). All URLs
are fetched in parallel, then their content is concatenated in order
(joined with \n---\n slide separators) and parsed as a single deck.

Also exposes loadFromUrls() as a public method on Slideshow, mirroring
the existing loadFromUrl() and loadFromString() API.

When both sourceUrls and sourceUrl are provided, sourceUrls takes
precedence.

Closes #7
@dpecos dpecos merged commit e00078c into master Apr 16, 2026
4 checks passed
@dpecos dpecos deleted the feat/issue-7-source-urls branch April 16, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: support loading multiple markdown sources via sourceUrls option

1 participant