Skip to content

Commit 9e7025a

Browse files
authored
Merge pull request #48 from open-rpc/feat/edits
Feat/edits
2 parents 6803085 + b9d85ae commit 9e7025a

File tree

76 files changed

+14031
-13788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+14031
-13788
lines changed

.changeset/strict-sloths-play.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@open-rpc/markdown-generator": patch
3+
"@open-rpc/docusaurus-plugin": patch
4+
---
5+
6+
Changes here fix bugs with the edits interface, adds missing cli deps, and adds support for a more pure markdown output

bun.lock

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docusaurus-plugin/src/lib.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { parseOpenRPCDocument } from "@open-rpc/schema-utils-js";
3-
import type { Edits } from "@open-rpc/markdown-generator";
3+
import type { Edits, SchemaEdits } from "@open-rpc/markdown-generator";
44
import {
55
identityEdits,
66
identitySchemaEdits,
@@ -21,6 +21,9 @@ type JSONSchema = any;
2121

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

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

63-
const methods = await renderMethodsToMarkdown(
64-
doc,
65-
methodEdits,
66-
identitySchemaEdits,
67-
);
66+
const methods = await renderMethodsToMarkdown(doc, schemaEdits, methodEdits);
6867

6968
const outDir = outputPath;
7069
const methodsDir = path.join(outDir, "methods");

0 commit comments

Comments
 (0)