@lexibase/create-rdx 4.2.2 → 5.0.1
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/package.json +1 -1
- package/templates/default/README.md +8 -1
- package/templates/default/docs/01-getting-started/configure.mdx +38 -0
- package/templates/default/docs/01-getting-started/intro.mdx +21 -0
- package/templates/default/docs/01-getting-started/writing-pages.mdx +58 -0
- package/templates/default/docs/{examples → 02-examples}/accordion.mdx +2 -2
- package/templates/default/docs/{examples → 02-examples}/callouts.mdx +1 -1
- package/templates/default/docs/{examples → 02-examples}/code-blocks.mdx +29 -4
- package/templates/default/docs/02-examples/colors.mdx +21 -0
- package/templates/default/docs/{examples → 02-examples}/diagrams.mdx +1 -1
- package/templates/default/docs/{examples → 02-examples}/images.mdx +1 -1
- package/templates/default/docs/{examples → 02-examples}/keyboard-shortcuts.mdx +3 -3
- package/templates/default/docs/{examples → 02-examples}/links.mdx +9 -7
- package/templates/default/docs/02-examples/markdown-exports.mdx +24 -0
- package/templates/default/docs/{examples/markdown.mdx → 02-examples/markdown.md} +2 -2
- package/templates/default/docs/02-examples/steps.mdx +57 -0
- package/templates/default/docs/{examples → 02-examples}/tabs.mdx +1 -1
- package/templates/default/package.json +1 -1
- package/templates/default/docs/examples/_category.json +0 -4
- package/templates/default/docs/examples/colors.mdx +0 -7
- package/templates/default/docs/init/_category.json +0 -4
- package/templates/default/docs/init/getting-started.mdx +0 -17
- package/templates/default/docs/init/intro.mdx +0 -10
package/package.json
CHANGED
|
@@ -16,6 +16,13 @@ pnpm dev
|
|
|
16
16
|
|
|
17
17
|
Edit files in `docs/` to create your documentation. RDX creates and maintains
|
|
18
18
|
its internal runtime in `.rdx/`.
|
|
19
|
+
|
|
20
|
+
- Start with `docs/01-getting-started/writing-pages.mdx` for page setup, sidebar ordering,
|
|
21
|
+
and `rdx check`.
|
|
22
|
+
- Browse `docs/02-examples/` for working Markdown components, including Steps.
|
|
23
|
+
- Use **Copy this page** on any document to copy its Markdown, or open
|
|
24
|
+
`/docs/llms.txt` for an index of the published documentation.
|
|
25
|
+
|
|
19
26
|
Keep custom React components in `components/` and import them from
|
|
20
27
|
`rdx.config.ts` or `components/home.tsx`. The project-root `tsconfig.json` configures JSX
|
|
21
28
|
and bundler-style imports for these files, including inside a monorepo.
|
|
@@ -60,7 +67,7 @@ Markdown components. Use site-root URLs for assets:
|
|
|
60
67
|
[Download](/downloads/example.txt)
|
|
61
68
|
```
|
|
62
69
|
|
|
63
|
-
See `docs/examples/images.mdx` for a working example. Do not include `/public`
|
|
70
|
+
See `docs/02-examples/images.mdx` for a working example. Do not include `/public`
|
|
64
71
|
in URLs and do not store private files or credentials in this directory.
|
|
65
72
|
|
|
66
73
|
RDX connects `.rdx/public` to this folder automatically. Keep your files in
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Configure your documentation site
|
|
3
|
+
navTitle: Configuration
|
|
4
|
+
description: Set your site identity and enable optional documentation features.
|
|
5
|
+
order: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Edit `rdx.config.ts` at the root of your project. Set
|
|
9
|
+
`metadata.applicationName` for the site name and `metadata.metadataBase`
|
|
10
|
+
to the public origin for the sitemap and absolute URLs in Markdown exports.
|
|
11
|
+
|
|
12
|
+
```ts title="rdx.config.ts"
|
|
13
|
+
import { defineConfig } from '@lexibase/rdx'
|
|
14
|
+
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
metadata: {
|
|
17
|
+
applicationName: 'My documentation',
|
|
18
|
+
metadataBase: 'https://docs.example.com',
|
|
19
|
+
},
|
|
20
|
+
search: true,
|
|
21
|
+
TOC: true,
|
|
22
|
+
navbar: {
|
|
23
|
+
logo: '/images/rdx.svg',
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use `search: true` to enable search in the navbar. Use `TOC: true` to show
|
|
29
|
+
heading navigation on pages with enough sections. Put your logo in
|
|
30
|
+
`public/images/` and set `navbar.logo` to its public path, starting with `/images/`.
|
|
31
|
+
|
|
32
|
+
Set `lang` to the language of your documentation. RDX uses it for the page
|
|
33
|
+
language and selects the corresponding interface messages when available.
|
|
34
|
+
To add a custom landing page, create `components/home.tsx`, import it into
|
|
35
|
+
`rdx.config.ts`, and set `homepage: { enabled: true, component: Home }`.
|
|
36
|
+
|
|
37
|
+
See the [configuration reference](https://rdx-tool.vercel.app/docs) for more
|
|
38
|
+
options, including plugins and the source edit link.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
description: Start building your documentation with RDX.
|
|
4
|
+
order: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
RDX turns folders and `.md` or `.mdx` files into a documentation site. Start by editing
|
|
8
|
+
this page or adding new pages inside `docs/`.
|
|
9
|
+
|
|
10
|
+
## Start here
|
|
11
|
+
|
|
12
|
+
- [Write your first page](./writing-pages.mdx) and organize the sidebar.
|
|
13
|
+
- [Configure your site](./configure.mdx) with your name, logo, and navigation.
|
|
14
|
+
- [Try Markdown](../02-examples/markdown.md), then explore [Callouts](../02-examples/callouts.mdx),
|
|
15
|
+
[Tabs](../02-examples/tabs.mdx), [Accordion](../02-examples/accordion.mdx), and
|
|
16
|
+
[Steps](../02-examples/steps.mdx).
|
|
17
|
+
- [Share a page as Markdown](../02-examples/markdown-exports.mdx) or open the
|
|
18
|
+
documentation index at `/docs/llms.txt`.
|
|
19
|
+
- Explore [code blocks](../02-examples/code-blocks.mdx),
|
|
20
|
+
[diagrams](../02-examples/diagrams.mdx), and
|
|
21
|
+
[keyboard shortcuts](../02-examples/keyboard-shortcuts.mdx).
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Writing pages
|
|
3
|
+
description: Learn how to add pages and categories to your site.
|
|
4
|
+
order: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Create a page
|
|
8
|
+
|
|
9
|
+
Add a `.md` or `.mdx` file inside a folder in `docs/`. Its path becomes the page URL.
|
|
10
|
+
|
|
11
|
+
```folder
|
|
12
|
+
docs/
|
|
13
|
+
03-guides/
|
|
14
|
+
01-deployment.md
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This file is available at `/docs/guides/deployment`.
|
|
18
|
+
|
|
19
|
+
## Organize the sidebar
|
|
20
|
+
|
|
21
|
+
Top-level folders become categories. A two-digit prefix sorts folders and files
|
|
22
|
+
without appearing in their URLs. Lower numbers appear first. The `order` field
|
|
23
|
+
overrides the file prefix, and `navTitle` lets you shorten a sidebar label.
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
---
|
|
27
|
+
title: Deploy your documentation site
|
|
28
|
+
description: Build your site and preview the production output.
|
|
29
|
+
navTitle: Deployment
|
|
30
|
+
order: 1
|
|
31
|
+
highlighting: new
|
|
32
|
+
---
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
All five fields are optional. `title` and `description` appear in the page
|
|
36
|
+
header. Use `highlighting: new` for a blue dot or `highlighting: important`
|
|
37
|
+
for an amber dot. Remove the field when the page no longer needs attention.
|
|
38
|
+
|
|
39
|
+
## Validate your content
|
|
40
|
+
|
|
41
|
+
Run the documentation check before deploying. It reports broken links and
|
|
42
|
+
invalid content with their source locations.
|
|
43
|
+
|
|
44
|
+
:::tabs
|
|
45
|
+
|
|
46
|
+
### pnpm
|
|
47
|
+
|
|
48
|
+
pnpm rdx check
|
|
49
|
+
|
|
50
|
+
### npm
|
|
51
|
+
|
|
52
|
+
npm exec -- rdx check
|
|
53
|
+
|
|
54
|
+
### yarn
|
|
55
|
+
|
|
56
|
+
yarn rdx check
|
|
57
|
+
|
|
58
|
+
:::
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Accordion
|
|
3
3
|
description: Optional explanations, without crowding your documentation.
|
|
4
|
-
|
|
4
|
+
order: 6
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Frequently asked questions
|
|
@@ -13,7 +13,7 @@ The answer continues until the next direct `###` or the closing `:::`.
|
|
|
13
13
|
|
|
14
14
|
### Where do I write my documentation?
|
|
15
15
|
|
|
16
|
-
Create folders and
|
|
16
|
+
Create folders and Markdown files inside **docs/**. Each top-level folder becomes a category
|
|
17
17
|
and each file becomes a page.
|
|
18
18
|
|
|
19
19
|
### How do I preview my changes?
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Code blocks
|
|
3
3
|
description: Highlight code, compare changes, and draw directory trees.
|
|
4
|
-
|
|
4
|
+
order: 9
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
All fence options are optional. These examples show each one separately before
|
|
@@ -19,7 +19,12 @@ Hello, RDX!
|
|
|
19
19
|
Hello, RDX!
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
The header uses the default code label.
|
|
22
|
+
The header uses the default code label.
|
|
23
|
+
|
|
24
|
+
## Highlight a language
|
|
25
|
+
|
|
26
|
+
Add a language such as `ts`, `tsx`, `json`, or `bash` after the opening fence.
|
|
27
|
+
Highlighting follows your light or dark theme. Unknown languages display as plain text.
|
|
23
28
|
|
|
24
29
|
````md
|
|
25
30
|
```tsx
|
|
@@ -41,12 +46,22 @@ Place `title="filename"` after the fence language:
|
|
|
41
46
|
|
|
42
47
|
````md
|
|
43
48
|
```ts title="rdx.config.ts"
|
|
44
|
-
|
|
49
|
+
import { defineConfig } from '@lexibase/rdx'
|
|
50
|
+
|
|
51
|
+
export default defineConfig({
|
|
52
|
+
metadata: { applicationName: 'My documentation' },
|
|
53
|
+
search: true,
|
|
54
|
+
})
|
|
45
55
|
```
|
|
46
56
|
````
|
|
47
57
|
|
|
48
58
|
```ts title="rdx.config.ts"
|
|
49
|
-
|
|
59
|
+
import { defineConfig } from '@lexibase/rdx'
|
|
60
|
+
|
|
61
|
+
export default defineConfig({
|
|
62
|
+
metadata: { applicationName: 'My documentation' },
|
|
63
|
+
search: true,
|
|
64
|
+
})
|
|
50
65
|
```
|
|
51
66
|
|
|
52
67
|
The title appears in the header; copying keeps only the code. Titles with spaces
|
|
@@ -107,6 +122,16 @@ const enabled = true
|
|
|
107
122
|
console.log(enabled)
|
|
108
123
|
```
|
|
109
124
|
|
|
125
|
+
## Wrap long lines
|
|
126
|
+
|
|
127
|
+
On small screens, use the wrap control in the code block header to fit long lines
|
|
128
|
+
within the available space. Try it on the block below. The copy button preserves
|
|
129
|
+
the original indentation and line breaks.
|
|
130
|
+
|
|
131
|
+
```text title="Long line"
|
|
132
|
+
Keep explanations close to the example they describe, and use wrapping to read a long line on a narrow screen.
|
|
133
|
+
```
|
|
134
|
+
|
|
110
135
|
## Long blocks on mobile
|
|
111
136
|
|
|
112
137
|
On screens narrower than 768px, blocks taller than about 12 visible lines show
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Colors
|
|
3
|
+
description: Customize the accent used by links and selected documentation controls.
|
|
4
|
+
order: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
RDX includes a clean default theme that adapts to your system preference.
|
|
8
|
+
To customize the accent, create `rdx.css` beside `rdx.config.ts` and set
|
|
9
|
+
`--rdx-highlighting` for each theme:
|
|
10
|
+
|
|
11
|
+
```css title="rdx.css"
|
|
12
|
+
:root {
|
|
13
|
+
--rdx-highlighting: #1d4ed8;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dark {
|
|
17
|
+
--rdx-highlighting: #93c5fd;
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Use a color that remains legible against the background in each theme.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Keyboard shortcuts
|
|
3
3
|
description: Describe keys and shortcut combinations with Markdown.
|
|
4
|
-
|
|
4
|
+
order: 8
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Display a key
|
|
8
8
|
|
|
9
|
-
Write `:kbd[Key]` in
|
|
9
|
+
Write `:kbd[Key]` in a Markdown or MDX page:
|
|
10
10
|
|
|
11
11
|
Press :kbd[Esc] to close a dialog or :kbd[Enter] to confirm.
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ Press :kbd[Esc] to close a dialog or :kbd[Enter] to confirm.
|
|
|
18
18
|
|
|
19
19
|
Write the complete combination inside one directive, separating keys with `+`:
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
If search is enabled, press :kbd[Ctrl + K] to open it.
|
|
22
22
|
|
|
23
23
|
```md
|
|
24
24
|
Press :kbd[Ctrl + K] to open search.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Document links
|
|
3
3
|
description: Link to documentation files using their relative paths.
|
|
4
|
-
|
|
4
|
+
order: 7
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Link to a page
|
|
8
8
|
|
|
9
|
-
Read the [introduction](../
|
|
10
|
-
[create a page](../
|
|
9
|
+
Read the [introduction](../01-getting-started/intro.mdx) or learn how to
|
|
10
|
+
[create a page](../01-getting-started/writing-pages.mdx#create-a-page).
|
|
11
11
|
|
|
12
12
|
```md
|
|
13
|
-
[Introduction](../
|
|
14
|
-
[Create a page](../
|
|
13
|
+
[Introduction](../01-getting-started/intro.mdx)
|
|
14
|
+
[Create a page](../01-getting-started/writing-pages.mdx#create-a-page)
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
RDX resolves these paths relative to this file. When viewing a snapshot,
|
|
@@ -19,11 +19,13 @@ links stay inside that snapshot instead of switching to Current.
|
|
|
19
19
|
|
|
20
20
|
## Link to a section
|
|
21
21
|
|
|
22
|
-
Jump to the [tables example](./markdown.
|
|
22
|
+
Jump to the [tables example](./markdown.md#tables), or return to
|
|
23
23
|
[the first section](#link-to-a-page) of this page.
|
|
24
24
|
|
|
25
25
|
Markdown headings receive automatic IDs. Repeated headings get suffixes such as
|
|
26
|
-
`tables-1`. Relative document links must include the `.mdx`
|
|
26
|
+
`tables-1`. Relative document links must include the actual `.md` or `.mdx`
|
|
27
|
+
extension. Select a section heading to open its anchor and copy its URL.
|
|
28
|
+
The `#` beside the title marks that link.
|
|
27
29
|
|
|
28
30
|
> [!NOTE] Keep links portable
|
|
29
31
|
> Use forward slashes and match the file's name and capitalization. If a destination
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Markdown exports and llms.txt
|
|
3
|
+
navTitle: Markdown exports
|
|
4
|
+
description: Copy a page, open its Markdown source, or browse the public index.
|
|
5
|
+
order: 12
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Copy or view a page
|
|
9
|
+
|
|
10
|
+
Select **Copy this page** beside the title to copy the document as Markdown.
|
|
11
|
+
Open the adjacent menu and choose **View Markdown** to read the same export in
|
|
12
|
+
a new tab. The export includes the page URL and a link to its documentation index.
|
|
13
|
+
|
|
14
|
+
## Find more pages
|
|
15
|
+
|
|
16
|
+
Open the documentation index at `/docs/llms.txt` to find the Markdown export for
|
|
17
|
+
each page. With versioning enabled, the index lists the latest active published
|
|
18
|
+
edition. If you publish translations, each language has its own index.
|
|
19
|
+
|
|
20
|
+
Set `metadata.metadataBase` in `rdx.config.ts` to your site's public URL to use
|
|
21
|
+
absolute links in the index and exported documents.
|
|
22
|
+
|
|
23
|
+
The export adds `lastUpdated` in `YYYY-MM-DD` format when the date is available
|
|
24
|
+
from Git history or captured in a version snapshot.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Markdown
|
|
3
3
|
description: A small Markdown and MDX example.
|
|
4
|
-
|
|
4
|
+
order: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Markdown works
|
|
@@ -41,7 +41,7 @@ Wider tables scroll horizontally on small screens without widening the page.
|
|
|
41
41
|
|
|
42
42
|
> Keep explanations close to the content they describe.
|
|
43
43
|
>
|
|
44
|
-
> A quotation can contain **formatted text**, [links](/docs/
|
|
44
|
+
> A quotation can contain **formatted text**, [links](/docs/getting-started/intro), and `inline code`.
|
|
45
45
|
|
|
46
46
|
You can also use ~~strikethrough~~ text.
|
|
47
47
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Steps
|
|
3
|
+
description: Present a procedure one step at a time in an interactive card.
|
|
4
|
+
order: 11
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Try Steps
|
|
8
|
+
|
|
9
|
+
::::steps
|
|
10
|
+
|
|
11
|
+
### Start the preview
|
|
12
|
+
|
|
13
|
+
:::tabs
|
|
14
|
+
|
|
15
|
+
### pnpm
|
|
16
|
+
|
|
17
|
+
pnpm dev
|
|
18
|
+
|
|
19
|
+
### npm
|
|
20
|
+
|
|
21
|
+
npm run dev
|
|
22
|
+
|
|
23
|
+
### yarn
|
|
24
|
+
|
|
25
|
+
yarn dev
|
|
26
|
+
|
|
27
|
+
:::
|
|
28
|
+
|
|
29
|
+
### Edit a page
|
|
30
|
+
|
|
31
|
+
Open a Markdown file in `docs/`, make a change, and save it.
|
|
32
|
+
|
|
33
|
+
### Verify the result
|
|
34
|
+
|
|
35
|
+
Visit the page in your browser and check that the change appears.
|
|
36
|
+
|
|
37
|
+
::::
|
|
38
|
+
|
|
39
|
+
## Write your own Steps
|
|
40
|
+
|
|
41
|
+
Open with `:::steps` and use `###` for each step title. Readers move between
|
|
42
|
+
steps with **Previous** and **Next**. When nesting a `:::tabs` block, open
|
|
43
|
+
and close Steps with four colons, as in the example above.
|
|
44
|
+
|
|
45
|
+
```md
|
|
46
|
+
:::steps
|
|
47
|
+
|
|
48
|
+
### Start the preview
|
|
49
|
+
|
|
50
|
+
Open the local development URL.
|
|
51
|
+
|
|
52
|
+
### Verify the result
|
|
53
|
+
|
|
54
|
+
Check the changed page in your browser.
|
|
55
|
+
|
|
56
|
+
:::
|
|
57
|
+
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Getting started
|
|
3
|
-
description: Learn how to add pages and categories to your site.
|
|
4
|
-
link_position: 2
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Create a page
|
|
8
|
-
|
|
9
|
-
Add an `.mdx` file inside a folder in `docs/`. Its path becomes the page URL.
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
docs/
|
|
13
|
-
└── guides/
|
|
14
|
-
└── deployment.mdx
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
This file is available at `/docs/guides/deployment`.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Introduction
|
|
3
|
-
description: Start building your documentation with RDX.
|
|
4
|
-
link_position: 1
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Welcome to your documentation
|
|
8
|
-
|
|
9
|
-
RDX turns folders and `.md` or `.mdx` files into a documentation site. Start by editing
|
|
10
|
-
this page or adding new pages inside `docs/`.
|