Skip to content

Commit

Permalink
feat(parser): allow specific content
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jun 4, 2021
1 parent 01e177c commit 3e6fe27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/parser/src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { SlideInfoWithPath, SlidevMarkdown, SlidevThemeMeta } from '@slidev/type
import { parseSlide, parse, stringify, stringifySlide, mergeFeatureFlags, detectFeatures } from './core'
export * from './core'

export async function load(filepath: string, themeMeta?: SlidevThemeMeta) {
export async function load(filepath: string, themeMeta?: SlidevThemeMeta, content?: string) {
const dir = dirname(filepath)
const markdown = await fs.readFile(filepath, 'utf-8')
const markdown = content ?? await fs.readFile(filepath, 'utf-8')

const data = parse(markdown, filepath, themeMeta)

Expand Down

0 comments on commit 3e6fe27

Please sign in to comment.