Cleanup docusaurus leftover (#4962)
Remove the `@theme` aliasing and update regen docs to render correct import for starlight
This commit is contained in:
Родитель
2d7eecff6d
Коммит
3b17396f9b
|
@ -155,7 +155,7 @@ op read(): string;
|
|||
Specify OpenAPI additional information.
|
||||
|
||||
```typespec
|
||||
@TypeSpec.OpenAPI.tagMetadata(name: valueof string, tagMetadata?: valueof TypeSpec.OpenAPI.TagMetadata)
|
||||
@TypeSpec.OpenAPI.tagMetadata(name: valueof string, tagMetadata: valueof TypeSpec.OpenAPI.TagMetadata)
|
||||
```
|
||||
|
||||
##### Target
|
||||
|
|
|
@ -13,7 +13,6 @@ import {
|
|||
inlinecode,
|
||||
renderMarkdowDoc,
|
||||
section,
|
||||
tabs,
|
||||
} from "../utils/markdown.js";
|
||||
import { MarkdownRenderer, groupByNamespace } from "./markdown.js";
|
||||
|
||||
|
@ -301,3 +300,24 @@ export class DocusaurusRenderer extends MarkdownRenderer {
|
|||
return [":::warning", `**Deprecated**: ${notice.message}`, ":::"];
|
||||
}
|
||||
}
|
||||
|
||||
type Tab = {
|
||||
id: string;
|
||||
label: string;
|
||||
content: string;
|
||||
};
|
||||
|
||||
function tabs(tabs: Tab[]) {
|
||||
const result = ["<Tabs>"];
|
||||
for (const tab of tabs) {
|
||||
result.push(
|
||||
`<TabItem value="${tab.id}" label="${tab.label}" default>`,
|
||||
"",
|
||||
tab.content,
|
||||
"",
|
||||
"</TabItem>",
|
||||
);
|
||||
}
|
||||
result.push("</Tabs>", "");
|
||||
return result.join("\n");
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ import {
|
|||
inlinecode,
|
||||
renderMarkdowDoc,
|
||||
section,
|
||||
tabs,
|
||||
} from "../utils/markdown.js";
|
||||
import { MarkdownRenderer, groupByNamespace } from "./markdown.js";
|
||||
|
||||
|
@ -61,8 +60,7 @@ function renderIndexFile(renderer: DocusaurusRenderer, refDoc: TypeSpecLibraryRe
|
|||
"toc_min_heading_level: 2",
|
||||
"toc_max_heading_level: 3",
|
||||
"---",
|
||||
"import Tabs from '@theme/Tabs';",
|
||||
"import TabItem from '@theme/TabItem';",
|
||||
"import { Tabs, TabItem } from '@astrojs/starlight/components';",
|
||||
"",
|
||||
|
||||
refDoc.description ?? [],
|
||||
|
@ -242,12 +240,10 @@ export class DocusaurusRenderer extends MarkdownRenderer {
|
|||
"Install",
|
||||
tabs([
|
||||
{
|
||||
id: "spec",
|
||||
label: "In a spec",
|
||||
content: codeblock(`npm install ${refDoc.name}`, "bash"),
|
||||
},
|
||||
{
|
||||
id: "library",
|
||||
label: "In a library",
|
||||
content: codeblock(`npm install --save-peer ${refDoc.name}`, "bash"),
|
||||
},
|
||||
|
@ -285,3 +281,17 @@ export class DocusaurusRenderer extends MarkdownRenderer {
|
|||
return [":::warning", `**Deprecated**: ${notice.message}`, ":::"];
|
||||
}
|
||||
}
|
||||
|
||||
type Tab = {
|
||||
label: string;
|
||||
content: string;
|
||||
};
|
||||
|
||||
function tabs(tabs: Tab[]) {
|
||||
const result = ["<Tabs>"];
|
||||
for (const tab of tabs) {
|
||||
result.push(`<TabItem label="${tab.label}" default>`, "", tab.content, "", "</TabItem>");
|
||||
}
|
||||
result.push("</Tabs>", "");
|
||||
return result.join("\n");
|
||||
}
|
||||
|
|
|
@ -40,27 +40,6 @@ export function table([header, ...rows]: string[][]) {
|
|||
].join("\n");
|
||||
}
|
||||
|
||||
export type Tab = {
|
||||
id: string;
|
||||
label: string;
|
||||
content: string;
|
||||
};
|
||||
|
||||
export function tabs(tabs: Tab[]) {
|
||||
const result = ["<Tabs>"];
|
||||
for (const tab of tabs) {
|
||||
result.push(
|
||||
`<TabItem value="${tab.id}" label="${tab.label}" default>`,
|
||||
"",
|
||||
tab.content,
|
||||
"",
|
||||
"</TabItem>",
|
||||
);
|
||||
}
|
||||
result.push("</Tabs>", "");
|
||||
return result.join("\n");
|
||||
}
|
||||
|
||||
export interface MarkdownSection {
|
||||
kind: "section";
|
||||
title: string;
|
||||
|
|
|
@ -101,6 +101,7 @@ const sidebar: SidebarItem[] = [
|
|||
{
|
||||
label: "📚 Libraries",
|
||||
items: [
|
||||
createLibraryReferenceStructure("libraries/events", "Events", false, []),
|
||||
createLibraryReferenceStructure("libraries/http", "Http", true, [
|
||||
"libraries/http/cheat-sheet",
|
||||
"libraries/http/authentication",
|
||||
|
@ -115,6 +116,8 @@ const sidebar: SidebarItem[] = [
|
|||
"libraries/rest/resource-routing",
|
||||
]),
|
||||
createLibraryReferenceStructure("libraries/openapi", "OpenAPI", false, []),
|
||||
createLibraryReferenceStructure("libraries/sse", "Server-Sent Events", false, []),
|
||||
createLibraryReferenceStructure("libraries/streams", "Streams", false, []),
|
||||
createLibraryReferenceStructure("libraries/versioning", "Versioning", false, [
|
||||
"libraries/versioning/guide",
|
||||
]),
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec library for emitting TypeSpec to JSON Schema and converting JSON Schema to TypeSpec
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/json-schema
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/json-schema
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec library for emitting OpenAPI 3.0 from the TypeSpec REST protocol binding and converting OpenAPI3 to TypeSpec
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/openapi3
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/openapi3
|
||||
|
|
|
@ -50,7 +50,7 @@ model TestMessage {
|
|||
|
||||
will be transformed into the Protobuf message below:
|
||||
|
||||
```proto3
|
||||
```protobuf
|
||||
message TestMessage {
|
||||
int32 n = 1;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ model TestMessage {
|
|||
|
||||
will be transformed into the Protobuf message below:
|
||||
|
||||
```proto3
|
||||
```protobuf
|
||||
message TestMessage {
|
||||
int32 n = 1;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ namespace Example {
|
|||
|
||||
will generate the following Protobuf file (named `example.proto`):
|
||||
|
||||
```proto3
|
||||
```protobuf
|
||||
syntax = "proto3";
|
||||
|
||||
package example;
|
||||
|
@ -131,7 +131,7 @@ interface Example {
|
|||
|
||||
Results in the following `.proto` file:
|
||||
|
||||
```proto3
|
||||
```protobuf
|
||||
message Input {
|
||||
string exampleField = 1;
|
||||
}
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec library and emitter for Protobuf (gRPC)
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/protobuf
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/protobuf
|
||||
|
|
|
@ -56,7 +56,7 @@ For VSCode to respect the TypeSpec standard style set the following options styl
|
|||
|
||||
If using `.editorconfig` with the editor config extension
|
||||
|
||||
```editorconfig
|
||||
```toml
|
||||
[*.tsp]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec library providing events bindings
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/events
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/events
|
||||
|
|
|
@ -5,8 +5,7 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec HTTP protocol binding
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/http
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/http
|
||||
|
|
|
@ -142,7 +142,7 @@ op read(): string;
|
|||
Specify OpenAPI additional information.
|
||||
|
||||
```typespec
|
||||
@TypeSpec.OpenAPI.tagMetadata(name: valueof string, tagMetadata?: valueof TypeSpec.OpenAPI.TagMetadata)
|
||||
@TypeSpec.OpenAPI.tagMetadata(name: valueof string, tagMetadata: valueof TypeSpec.OpenAPI.TagMetadata)
|
||||
```
|
||||
|
||||
#### Target
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec library providing OpenAPI concepts
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/openapi
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/openapi
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec REST protocol binding
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/rest
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/rest
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec library providing server sent events bindings
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/sse
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/sse
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
title: "Data types"
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
|
||||
|
||||
## TypeSpec.Streams
|
||||
|
||||
### `Stream` {#TypeSpec.Streams.Stream}
|
||||
|
||||
Defines a model that represents a stream protocol type whose data is described
|
||||
by `Type`.
|
||||
|
||||
This can be useful when the underlying data type is not relevant, or to serve as
|
||||
a base type for custom streams.
|
||||
|
||||
```typespec
|
||||
model TypeSpec.Streams.Stream<Type>
|
||||
```
|
||||
|
||||
#### Template Parameters
|
||||
|
||||
| Name | Description |
|
||||
| ---- | ------------------------------ |
|
||||
| Type | The type of the stream's data. |
|
||||
|
||||
#### Properties
|
||||
|
||||
None
|
|
@ -1,42 +0,0 @@
|
|||
---
|
||||
title: "Decorators"
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
|
||||
|
||||
## TypeSpec.Streams
|
||||
|
||||
### `@streamOf` {#@TypeSpec.Streams.streamOf}
|
||||
|
||||
Specify that a model represents a stream protocol type whose data is described
|
||||
by `Type`.
|
||||
|
||||
```typespec
|
||||
@TypeSpec.Streams.streamOf(type: unknown)
|
||||
```
|
||||
|
||||
#### Target
|
||||
|
||||
`Model`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | --------- | ------------------------------------------------------- |
|
||||
| type | `unknown` | The type that models the underlying data of the stream. |
|
||||
|
||||
#### Examples
|
||||
|
||||
```typespec
|
||||
model Message {
|
||||
id: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
@streamOf(Message)
|
||||
model Response {
|
||||
@body body: string;
|
||||
}
|
||||
```
|
|
@ -1,42 +0,0 @@
|
|||
---
|
||||
title: Overview
|
||||
sidebar_position: 0
|
||||
toc_min_heading_level: 2
|
||||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
|
||||
|
||||
TypeSpec library providing stream bindings
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/streams
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/streams
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## TypeSpec.Streams
|
||||
|
||||
### Decorators
|
||||
|
||||
- [`@streamOf`](./decorators.md#@TypeSpec.Streams.streamOf)
|
||||
|
||||
### Models
|
||||
|
||||
- [`Stream`](./data-types.md#TypeSpec.Streams.Stream)
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec library providing stream bindings
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/streams
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/streams
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec library for declaring and emitting versioned APIs
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/versioning
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/versioning
|
||||
|
|
|
@ -5,22 +5,21 @@ toc_min_heading_level: 2
|
|||
toc_max_heading_level: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
TypeSpec library providing xml bindings
|
||||
|
||||
## Install
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="spec" label="In a spec" default>
|
||||
<TabItem label="In a spec" default>
|
||||
|
||||
```bash
|
||||
npm install @typespec/xml
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="library" label="In a library" default>
|
||||
<TabItem label="In a library" default>
|
||||
|
||||
```bash
|
||||
npm install --save-peer @typespec/xml
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
"baseUrl": "./",
|
||||
"noImplicitAny": false,
|
||||
"paths": {
|
||||
"@site/*": ["*"],
|
||||
"@docusaurus/*": ["src/components/docusaurus/core/*"],
|
||||
"@theme/*": ["src/components/docusaurus/theme/*"]
|
||||
"@site/*": ["*"]
|
||||
},
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react"
|
||||
|
|
Загрузка…
Ссылка в новой задаче