Updated
This commit is contained in:
parent
8bb807c8e7
commit
c66dd4d39c
3 changed files with 10 additions and 6 deletions
File diff suppressed because one or more lines are too long
|
@ -31,14 +31,15 @@ async function processBinding({ inputFilePath, options }: CLIArguments) {
|
|||
return ExitCode.Success;
|
||||
}
|
||||
|
||||
if (options.markdown) {
|
||||
await compileMarkdownInPlaybill(binding);
|
||||
}
|
||||
|
||||
// Serialize (default: JSON)
|
||||
let serializedPlaybill = "";
|
||||
|
||||
switch (options.renderer) {
|
||||
case "json":
|
||||
if (options.markdown) {
|
||||
await compileMarkdownInPlaybill(binding);
|
||||
}
|
||||
serializedPlaybill = binding.playbill.serialize();
|
||||
break;
|
||||
case "html":
|
||||
|
|
|
@ -8,7 +8,10 @@ import { toSlug } from "./slug";
|
|||
import rehypeRaw from "rehype-raw";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import rehypeShiftHeading from "rehype-shift-heading";
|
||||
import type { AnyPlaybillComponent } from "@proscenium/playbill";
|
||||
import {
|
||||
parseProsceniumScript,
|
||||
type AnyPlaybillComponent,
|
||||
} from "@proscenium/playbill";
|
||||
|
||||
export type MarkdownParserFunction = (input: string) => Promise<string>;
|
||||
|
||||
|
@ -53,7 +56,8 @@ export async function compileMarkdownInPlaybill(
|
|||
|
||||
// Define a processor function to iterate over all components and process their markdown
|
||||
const processMarkdownInComponent = async (entry: AnyPlaybillComponent) => {
|
||||
entry.description = await renderMarkdown(entry.description);
|
||||
const preparsed = parseProsceniumScript(entry.description, playbill);
|
||||
entry.description = await renderMarkdown(preparsed);
|
||||
|
||||
if (entry._component === "resource" && entry.type === "table") {
|
||||
const newData: string[][] = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue