From 050571bd7e0a16579220213b91edbc721f33dc4c Mon Sep 17 00:00:00 2001 From: Dan Barr Date: Thu, 9 Jan 2025 23:01:33 -0500 Subject: [PATCH] Update protocol doc generation to .mdx Has inline JSX, and the next major version of Docusaurus will render .md and .mdx files differently. --- .gitattributes | 2 +- buf.gen.yaml | 2 +- docs/.markdownlint-cli2.jsonc | 8 +------- docs/.prettierignore | 2 +- docs/docs/ref/{proto.md => proto.mdx} | 2 +- docs/eslint.config.mjs | 8 +------- docs/proto_template.tmpl | 2 +- 7 files changed, 7 insertions(+), 19 deletions(-) rename docs/docs/ref/{proto.md => proto.mdx} (100%) diff --git a/.gitattributes b/.gitattributes index 4a02c03d12..426765f32a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,7 +7,7 @@ /database/mock/*.go linguist-generated=true /docs/docs/ref/cli/*.md linguist-generated=true /docs/docs/ref/schema.md linguist-generated=true -/docs/docs/ref/proto.md linguist-generated=true +/docs/docs/ref/proto.mdx linguist-generated=true /pkg/api/openapi/** linguist-generated=true /pkg/api/protobuf/go/minder/v1/*.pb.go linguist-generated=true /pkg/api/protobuf/go/minder/v1/*.gw.go linguist-generated=true diff --git a/buf.gen.yaml b/buf.gen.yaml index 58dd7cdce5..ed3cc802c8 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -26,4 +26,4 @@ plugins: # https://github.com/pseudomuto/protoc-gen-doc/issues/513 # buf.build/community/pseudomuto-doc:v1.5.1 out: docs/docs/ref - opt: "docs/proto_template.tmpl,proto.md:internal.proto" + opt: "docs/proto_template.tmpl,proto.mdx:internal.proto" diff --git a/docs/.markdownlint-cli2.jsonc b/docs/.markdownlint-cli2.jsonc index 8c60ba7a77..456c4ba9f8 100644 --- a/docs/.markdownlint-cli2.jsonc +++ b/docs/.markdownlint-cli2.jsonc @@ -1,11 +1,5 @@ { "gitignore": true, "globs": ["**/*.md"], - "ignores": [ - "node_modules/", - ".docusaurus", - "build/", - "docs/ref/cli/", - "docs/ref/proto.md", - ], + "ignores": ["node_modules/", ".docusaurus", "build/", "docs/ref/cli/"], } diff --git a/docs/.prettierignore b/docs/.prettierignore index e98158a2dd..e2ec3d7704 100644 --- a/docs/.prettierignore +++ b/docs/.prettierignore @@ -4,4 +4,4 @@ build/ # Auto-generated files docs/ref/cli/*.md -docs/ref/proto.md +docs/ref/proto.mdx diff --git a/docs/docs/ref/proto.md b/docs/docs/ref/proto.mdx similarity index 100% rename from docs/docs/ref/proto.md rename to docs/docs/ref/proto.mdx index 3eaeee11e7..1734b36105 100644 --- a/docs/docs/ref/proto.md +++ b/docs/docs/ref/proto.mdx @@ -1,6 +1,6 @@ --- -sidebar_position: 60 title: Protocol documentation +sidebar_position: 60 toc_max_heading_level: 4 --- diff --git a/docs/eslint.config.mjs b/docs/eslint.config.mjs index 08d44de056..580839804f 100644 --- a/docs/eslint.config.mjs +++ b/docs/eslint.config.mjs @@ -11,13 +11,7 @@ import * as mdx from 'eslint-plugin-mdx'; /** @type {import('eslint').Linter.Config[]} */ export default [ { - ignores: [ - '.docusaurus/', - 'build/', - 'import/', - 'docs/minder/', - 'node_modules/', - ], + ignores: ['.docusaurus/', 'build/', 'node_modules/', 'docs/ref/proto.mdx'], }, { files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] }, { languageOptions: { globals: globals.node } }, diff --git a/docs/proto_template.tmpl b/docs/proto_template.tmpl index 0bc85a8e1e..b36924217a 100644 --- a/docs/proto_template.tmpl +++ b/docs/proto_template.tmpl @@ -1,6 +1,6 @@ --- -sidebar_position: 60 title: Protocol documentation +sidebar_position: 60 toc_max_heading_level: 4 ---