Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/strict-sloths-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@open-rpc/markdown-generator": patch
"@open-rpc/docusaurus-plugin": patch
---

Changes here fix bugs with the edits interface, adds missing cli deps, and adds support for a more pure markdown output
5 changes: 4 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions packages/docusaurus-plugin/src/lib.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { parseOpenRPCDocument } from "@open-rpc/schema-utils-js";
import type { Edits } from "@open-rpc/markdown-generator";
import type { Edits, SchemaEdits } from "@open-rpc/markdown-generator";
import {
identityEdits,
identitySchemaEdits,
Expand All @@ -21,6 +21,9 @@ type JSONSchema = any;

const reactComponent: string = `import {TwoColumnLayout, InteractiveRequest, ResponseExample} from '@open-rpc/docusaurus-plugin/components';\nimport { useState } from 'react';`;
const methodEdits: Edits = { ...identityEdits };
const schemaEdits: SchemaEdits = {
...identitySchemaEdits,
};

methodEdits.editMethod = (content, method) => {
const m = method as DereffedMethodObject;
Expand Down Expand Up @@ -60,11 +63,7 @@ export async function generateDocs(inputPath: string, outputPath: string) {
raw,
)) as DereffedOpenrpcDocument;

const methods = await renderMethodsToMarkdown(
doc,
methodEdits,
identitySchemaEdits,
);
const methods = await renderMethodsToMarkdown(doc, schemaEdits, methodEdits);

const outDir = outputPath;
const methodsDir = path.join(outDir, "methods");
Expand Down
Loading
Loading