@lukoweb/create-apitogo 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/templates/default/js/apitogo.config.jsx +14 -2
- package/dist/templates/default/js/pages/example.mdx +125 -3
- package/dist/templates/default/js/pages/introduction.mdx +5 -1
- package/dist/templates/default/ts/apitogo.config.tsx +14 -2
- package/dist/templates/default/ts/pages/example.mdx +126 -3
- package/dist/templates/default/ts/pages/introduction.mdx +5 -1
- package/package.json +1 -1
|
@@ -11,6 +11,9 @@ const config = {
|
|
|
11
11
|
metadata: {
|
|
12
12
|
favicon: "/Icon.png",
|
|
13
13
|
},
|
|
14
|
+
docs: {
|
|
15
|
+
files: "/pages/**/*.{md,mdx}",
|
|
16
|
+
},
|
|
14
17
|
navigation: [
|
|
15
18
|
{
|
|
16
19
|
type: "category",
|
|
@@ -21,7 +24,16 @@ const config = {
|
|
|
21
24
|
label: "Getting Started",
|
|
22
25
|
icon: "sparkles",
|
|
23
26
|
items: [
|
|
24
|
-
|
|
27
|
+
{
|
|
28
|
+
type: "doc",
|
|
29
|
+
file: "pages/introduction.mdx",
|
|
30
|
+
label: "Introduction",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "doc",
|
|
34
|
+
file: "pages/example.mdx",
|
|
35
|
+
label: "MDX examples",
|
|
36
|
+
},
|
|
25
37
|
{
|
|
26
38
|
type: "link",
|
|
27
39
|
icon: "folder-cog",
|
|
@@ -61,7 +73,7 @@ const config = {
|
|
|
61
73
|
{
|
|
62
74
|
type: "file",
|
|
63
75
|
input: "./apis/openapi.yaml",
|
|
64
|
-
path: "
|
|
76
|
+
path: "api",
|
|
65
77
|
},
|
|
66
78
|
],
|
|
67
79
|
};
|
|
@@ -1,9 +1,131 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: MDX examples
|
|
3
|
+
description:
|
|
4
|
+
Callouts, fenced code, tabbed code, tables, task lists, links, badges, and buttons available in
|
|
5
|
+
APIToGo MDX pages.
|
|
3
6
|
---
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
This page lists patterns you can copy into any `.mdx` file under `pages/`. Your site title comes from
|
|
9
|
+
front matter (`title` above) and appears in the sidebar for this route.
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
<Link to="/introduction">Introduction</Link> · <Link to="/api">API reference</Link> ·{" "}
|
|
12
|
+
<Badge variant="secondary">built-in</Badge> <Badge variant="outline">mdx</Badge>
|
|
13
|
+
|
|
14
|
+
## Callouts (directives)
|
|
15
|
+
|
|
16
|
+
:::note{title="Note"}
|
|
17
|
+
|
|
18
|
+
Neutral context readers should notice.
|
|
19
|
+
|
|
20
|
+
:::
|
|
21
|
+
|
|
22
|
+
:::tip{title="Tip"}
|
|
23
|
+
|
|
24
|
+
Suggested workflows or shortcuts.
|
|
25
|
+
|
|
26
|
+
:::
|
|
27
|
+
|
|
28
|
+
:::info{title="Info"}
|
|
29
|
+
|
|
30
|
+
Extra detail that is not urgent.
|
|
31
|
+
|
|
32
|
+
:::
|
|
33
|
+
|
|
34
|
+
:::caution{title="Caution"}
|
|
35
|
+
|
|
36
|
+
Something might break if misconfigured.
|
|
37
|
+
|
|
38
|
+
:::
|
|
39
|
+
|
|
40
|
+
:::danger{title="Danger"}
|
|
41
|
+
|
|
42
|
+
Destructive or security-sensitive actions.
|
|
8
43
|
|
|
9
44
|
:::
|
|
45
|
+
|
|
46
|
+
## Fenced code
|
|
47
|
+
|
|
48
|
+
Inline: `ApitogoConfig`, `apitogo dev`, `pages/example.mdx`.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
apitogo dev
|
|
52
|
+
apitogo build
|
|
53
|
+
apitogo preview
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{ "example": true }
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
/** @type {import('@lukoweb/apitogo').ApitogoConfig} */
|
|
62
|
+
const config = {
|
|
63
|
+
site: { title: "My API docs" },
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default config;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Tabbed code (`CodeTabs`)
|
|
70
|
+
|
|
71
|
+
<CodeTabs>
|
|
72
|
+
|
|
73
|
+
```bash title="curl"
|
|
74
|
+
curl -sS https://httpbin.org/get
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```bash title="HTTPie"
|
|
78
|
+
http GET https://httpbin.org/get
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```ts title="fetch"
|
|
82
|
+
const res = await fetch("https://httpbin.org/get");
|
|
83
|
+
console.log(await res.json());
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
</CodeTabs>
|
|
87
|
+
|
|
88
|
+
<CodeTabs>
|
|
89
|
+
|
|
90
|
+
```json title="JSON"
|
|
91
|
+
{ "status": "ok" }
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```yaml title="YAML"
|
|
95
|
+
status: ok
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
</CodeTabs>
|
|
99
|
+
|
|
100
|
+
## Table
|
|
101
|
+
|
|
102
|
+
| Topic | Where to look |
|
|
103
|
+
| ----- | ------------- |
|
|
104
|
+
| Config | `apitogo.config.jsx` |
|
|
105
|
+
| Pages | `pages/**/*.mdx` |
|
|
106
|
+
| OpenAPI | `apis/openapi.yaml` |
|
|
107
|
+
|
|
108
|
+
## Lists
|
|
109
|
+
|
|
110
|
+
1. Edit Markdown or MDX under `pages/`.
|
|
111
|
+
2. Adjust `apitogo.config.jsx`.
|
|
112
|
+
3. Run `apitogo build` before deploy.
|
|
113
|
+
|
|
114
|
+
Task list (GFM):
|
|
115
|
+
|
|
116
|
+
- [x] Scaffold created
|
|
117
|
+
- [ ] Customize for your API
|
|
118
|
+
|
|
119
|
+
## Markdown
|
|
120
|
+
|
|
121
|
+
> Blockquote for quotes or asides.
|
|
122
|
+
|
|
123
|
+
**Bold**, _italic_, ~~strikethrough~~, and [link to API](/api).
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Button
|
|
128
|
+
|
|
129
|
+
<Button variant="outline" type="button">
|
|
130
|
+
Example button
|
|
131
|
+
</Button>
|
|
@@ -13,4 +13,8 @@ To edit this page, open the `pages/introduction.mdx` file.
|
|
|
13
13
|
You can find the full configuration for your APIToGo site in the `apitogo.config.jsx` file.
|
|
14
14
|
|
|
15
15
|
For further information on how to customize your site, check out the
|
|
16
|
-
[APIToGo documentation](https://
|
|
16
|
+
[APIToGo documentation](https://docs.apitogo.com).
|
|
17
|
+
|
|
18
|
+
## MDX building blocks
|
|
19
|
+
|
|
20
|
+
See [MDX examples](/example) for callouts, code blocks, tabs, tables, and common components.
|
|
@@ -12,6 +12,9 @@ const config: ApitogoConfig = {
|
|
|
12
12
|
metadata: {
|
|
13
13
|
favicon: "/Icon.png",
|
|
14
14
|
},
|
|
15
|
+
docs: {
|
|
16
|
+
files: "/pages/**/*.{md,mdx}",
|
|
17
|
+
},
|
|
15
18
|
navigation: [
|
|
16
19
|
{
|
|
17
20
|
type: "category",
|
|
@@ -22,7 +25,16 @@ const config: ApitogoConfig = {
|
|
|
22
25
|
label: "Getting Started",
|
|
23
26
|
icon: "sparkles",
|
|
24
27
|
items: [
|
|
25
|
-
|
|
28
|
+
{
|
|
29
|
+
type: "doc",
|
|
30
|
+
file: "pages/introduction.mdx",
|
|
31
|
+
label: "Introduction",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "doc",
|
|
35
|
+
file: "pages/example.mdx",
|
|
36
|
+
label: "MDX examples",
|
|
37
|
+
},
|
|
26
38
|
{
|
|
27
39
|
type: "link",
|
|
28
40
|
icon: "folder-cog",
|
|
@@ -62,7 +74,7 @@ const config: ApitogoConfig = {
|
|
|
62
74
|
{
|
|
63
75
|
type: "file",
|
|
64
76
|
input: "./apis/openapi.yaml",
|
|
65
|
-
path: "
|
|
77
|
+
path: "api",
|
|
66
78
|
},
|
|
67
79
|
],
|
|
68
80
|
};
|
|
@@ -1,9 +1,132 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: MDX examples
|
|
3
|
+
description:
|
|
4
|
+
Callouts, fenced code, tabbed code, tables, task lists, links, badges, and buttons available in
|
|
5
|
+
APIToGo MDX pages.
|
|
3
6
|
---
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
This page lists patterns you can copy into any `.mdx` file under `pages/`. Your site title comes from
|
|
9
|
+
front matter (`title` above) and appears in the sidebar for this route.
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
<Link to="/introduction">Introduction</Link> · <Link to="/api">API reference</Link> ·{" "}
|
|
12
|
+
<Badge variant="secondary">built-in</Badge> <Badge variant="outline">mdx</Badge>
|
|
13
|
+
|
|
14
|
+
## Callouts (directives)
|
|
15
|
+
|
|
16
|
+
:::note{title="Note"}
|
|
17
|
+
|
|
18
|
+
Neutral context readers should notice.
|
|
19
|
+
|
|
20
|
+
:::
|
|
21
|
+
|
|
22
|
+
:::tip{title="Tip"}
|
|
23
|
+
|
|
24
|
+
Suggested workflows or shortcuts.
|
|
8
25
|
|
|
9
26
|
:::
|
|
27
|
+
|
|
28
|
+
:::info{title="Info"}
|
|
29
|
+
|
|
30
|
+
Extra detail that is not urgent.
|
|
31
|
+
|
|
32
|
+
:::
|
|
33
|
+
|
|
34
|
+
:::caution{title="Caution"}
|
|
35
|
+
|
|
36
|
+
Something might break if misconfigured.
|
|
37
|
+
|
|
38
|
+
:::
|
|
39
|
+
|
|
40
|
+
:::danger{title="Danger"}
|
|
41
|
+
|
|
42
|
+
Destructive or security-sensitive actions.
|
|
43
|
+
|
|
44
|
+
:::
|
|
45
|
+
|
|
46
|
+
## Fenced code
|
|
47
|
+
|
|
48
|
+
Inline: `ApitogoConfig`, `apitogo dev`, `pages/example.mdx`.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
apitogo dev
|
|
52
|
+
apitogo build
|
|
53
|
+
apitogo preview
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{ "example": true }
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import type { ApitogoConfig } from "@lukoweb/apitogo";
|
|
62
|
+
|
|
63
|
+
const config: ApitogoConfig = {
|
|
64
|
+
site: { title: "My API docs" },
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default config;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Tabbed code (`CodeTabs`)
|
|
71
|
+
|
|
72
|
+
<CodeTabs>
|
|
73
|
+
|
|
74
|
+
```bash title="curl"
|
|
75
|
+
curl -sS https://httpbin.org/get
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```bash title="HTTPie"
|
|
79
|
+
http GET https://httpbin.org/get
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```ts title="fetch"
|
|
83
|
+
const res = await fetch("https://httpbin.org/get");
|
|
84
|
+
console.log(await res.json());
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
</CodeTabs>
|
|
88
|
+
|
|
89
|
+
<CodeTabs>
|
|
90
|
+
|
|
91
|
+
```json title="JSON"
|
|
92
|
+
{ "status": "ok" }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```yaml title="YAML"
|
|
96
|
+
status: ok
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
</CodeTabs>
|
|
100
|
+
|
|
101
|
+
## Table
|
|
102
|
+
|
|
103
|
+
| Topic | Where to look |
|
|
104
|
+
| ----- | ------------- |
|
|
105
|
+
| Config | `apitogo.config.tsx` |
|
|
106
|
+
| Pages | `pages/**/*.mdx` |
|
|
107
|
+
| OpenAPI | `apis/openapi.yaml` |
|
|
108
|
+
|
|
109
|
+
## Lists
|
|
110
|
+
|
|
111
|
+
1. Edit Markdown or MDX under `pages/`.
|
|
112
|
+
2. Adjust `apitogo.config.tsx`.
|
|
113
|
+
3. Run `apitogo build` before deploy.
|
|
114
|
+
|
|
115
|
+
Task list (GFM):
|
|
116
|
+
|
|
117
|
+
- [x] Scaffold created
|
|
118
|
+
- [ ] Customize for your API
|
|
119
|
+
|
|
120
|
+
## Markdown
|
|
121
|
+
|
|
122
|
+
> Blockquote for quotes or asides.
|
|
123
|
+
|
|
124
|
+
**Bold**, _italic_, ~~strikethrough~~, and [link to API](/api).
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Button
|
|
129
|
+
|
|
130
|
+
<Button variant="outline" type="button">
|
|
131
|
+
Example button
|
|
132
|
+
</Button>
|
|
@@ -13,4 +13,8 @@ To edit this page, open the `pages/introduction.mdx` file.
|
|
|
13
13
|
You can find the full configuration for your APIToGo site in the `apitogo.config.tsx` file.
|
|
14
14
|
|
|
15
15
|
For further information on how to customize your site, check out the
|
|
16
|
-
[APIToGo documentation](https://
|
|
16
|
+
[APIToGo documentation](https://docs.apitogo.com).
|
|
17
|
+
|
|
18
|
+
## MDX building blocks
|
|
19
|
+
|
|
20
|
+
See [MDX examples](/example) for callouts, code blocks, tabs, tables, and common components.
|