Skip to content

Commit

Permalink
feat: allow defining custom edge renderer instance during entry rende…
Browse files Browse the repository at this point in the history
…ring
  • Loading branch information
thetutlage committed Apr 5, 2024
1 parent 881984f commit 0bce8a8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/base_entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,17 @@ export abstract class BaseEntry {
/**
* Render collection entry
*/
async render(state?: Record<string, any>): Promise<string> {
async render(
state?: Record<string, any>,
edgeRenderer?: ReturnType<Edge['createRenderer']>
): Promise<string> {
const file = await this.#load()

/**
* Use rendering options
*/
const { shiki, view } = this.#renderer.getRenderingOptions()
const viewInstance = view ? view.engine.createRenderer() : undefined
const viewInstance = edgeRenderer || (view ? view.engine.createRenderer() : undefined)
await shiki.boot()

/**
Expand Down

0 comments on commit 0bce8a8

Please sign in to comment.