@lexibase/create-rdx 1.0.0-beta.5 → 1.0.0-beta.6
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/bin/index.js +4 -1
- package/package.json +4 -1
- package/templates/default/README.md +30 -1
- package/templates/default/docs/examples/images.mdx +33 -0
- package/templates/default/package.json +1 -1
- package/templates/default/public/downloads/example.txt +2 -0
- package/templates/default/public/images/rdx.svg +51 -0
- package/templates/default/rdx.config.ts +6 -0
package/bin/index.js
CHANGED
|
@@ -90,6 +90,7 @@ const templateDir = path.resolve(
|
|
|
90
90
|
'../templates/default'
|
|
91
91
|
)
|
|
92
92
|
await fs.copy(templateDir, targetDir, { errorOnExist: true })
|
|
93
|
+
await fs.ensureDir(path.join(targetDir, 'public'))
|
|
93
94
|
|
|
94
95
|
const gitignoreTemplatePath = path.join(targetDir, 'gitignore.template')
|
|
95
96
|
await fs.move(gitignoreTemplatePath, path.join(targetDir, '.gitignore'), {
|
|
@@ -107,7 +108,9 @@ const readmePath = path.join(targetDir, 'README.md')
|
|
|
107
108
|
const readme = await fs.readFile(readmePath, 'utf8')
|
|
108
109
|
await fs.writeFile(
|
|
109
110
|
readmePath,
|
|
110
|
-
readme
|
|
111
|
+
readme
|
|
112
|
+
.replaceAll('{{RDX_PROJECT_NAME}}', projectName)
|
|
113
|
+
.replaceAll('__RDX_PROJECT_NAME__', projectName)
|
|
111
114
|
)
|
|
112
115
|
|
|
113
116
|
const packageManager = getPackageManager()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lexibase/create-rdx",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.6",
|
|
4
4
|
"description": "Create a new RDX documentation project.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -31,5 +31,8 @@
|
|
|
31
31
|
"cross-spawn": "^7.0.6",
|
|
32
32
|
"fs-extra": "^11.1.1",
|
|
33
33
|
"prompts": "^2.4.2"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"test": "node --test tests/*.test.mjs"
|
|
34
37
|
}
|
|
35
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# {{RDX_PROJECT_NAME}}
|
|
2
2
|
|
|
3
3
|
This documentation site was created with RDX.
|
|
4
4
|
|
|
@@ -10,3 +10,32 @@ pnpm dev
|
|
|
10
10
|
|
|
11
11
|
Edit files in `docs/` to create your documentation. RDX creates and maintains
|
|
12
12
|
its internal runtime in `.rdx/`.
|
|
13
|
+
|
|
14
|
+
## Public files
|
|
15
|
+
|
|
16
|
+
Put images and downloads in the project-root `public/` folder:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
public/images/rdx.svg → /images/rdx.svg
|
|
20
|
+
public/downloads/example.txt → /downloads/example.txt
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use site-root URLs in MDX:
|
|
24
|
+
|
|
25
|
+
```md
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
[Download](/downloads/example.txt)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
See `docs/examples/images.mdx` for a working example. Do not include `/public`
|
|
32
|
+
in URLs and do not store private files or credentials in this directory.
|
|
33
|
+
|
|
34
|
+
RDX connects `.rdx/public` to this folder automatically. Keep your files in
|
|
35
|
+
`public/`; `.rdx/` is generated. All documentation versions share public files;
|
|
36
|
+
use version-specific filenames if snapshots need to retain their original assets.
|
|
37
|
+
|
|
38
|
+
For production, run `pnpm build` and `pnpm start`. Restart/redeploy the site after
|
|
39
|
+
adding or removing public files in production. Deploy `public/` with the project,
|
|
40
|
+
not just `.rdx/`. If the filesystem does not support directory links, RDX reports
|
|
41
|
+
an error without deleting the original assets.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Images and downloads
|
|
3
|
+
description: Serve files from your project's public directory.
|
|
4
|
+
link_position: 3
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Images
|
|
8
|
+
|
|
9
|
+
Put images inside `public/` and reference them from the site root:
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
```md
|
|
14
|
+

|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The file above lives at `public/images/rdx.svg`, not in `docs/` or `.rdx/`.
|
|
18
|
+
|
|
19
|
+
## Downloads
|
|
20
|
+
|
|
21
|
+
Put downloadable files in `public/` too:
|
|
22
|
+
|
|
23
|
+
[Download the example file](/downloads/example.txt)
|
|
24
|
+
|
|
25
|
+
```md
|
|
26
|
+
[Download the example file](/downloads/example.txt)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use `/images/rdx.svg`, not `/public/images/rdx.svg`. Files in `public/` are
|
|
30
|
+
publicly accessible: never put passwords, tokens or private documents there.
|
|
31
|
+
|
|
32
|
+
All documentation versions share these files. To preserve an image for a
|
|
33
|
+
snapshot, keep a version-specific filename, such as `/images/1.0.0/diagram.svg`.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
2
|
+
width="240" height="214" viewBox="0 0 681.000000 606.000000"
|
|
3
|
+
preserveAspectRatio="xMidYMid meet">
|
|
4
|
+
<title>RDX logo</title>
|
|
5
|
+
<rect width="681" height="606" rx="24" fill="#ffffff" />
|
|
6
|
+
|
|
7
|
+
<g transform="translate(0.000000,606.000000) scale(0.100000,-0.100000)"
|
|
8
|
+
fill="#000000" stroke="none">
|
|
9
|
+
<path d="M943 5656 l-28 -24 -3 -357 c-2 -260 0 -361 9 -371 7 -9 32 -14 70
|
|
10
|
+
-14 47 0 60 4 69 19 6 12 10 126 10 300 0 248 2 281 16 281 14 0 299 -65 679
|
|
11
|
+
-155 83 -19 218 -51 300 -70 83 -19 218 -50 300 -70 83 -19 249 -58 370 -86
|
|
12
|
+
366 -83 455 -108 550 -154 143 -70 242 -172 306 -315 l24 -55 3 -1915 2 -1914
|
|
13
|
+
-47 46 c-101 97 -192 152 -335 203 -57 20 -78 32 -82 48 -3 12 -6 492 -6 1067
|
|
14
|
+
l1 1045 -26 23 c-14 12 -35 22 -46 22 -28 0 -75 -26 -83 -45 -3 -9 -6 -505 -6
|
|
15
|
+
-1103 -1 -790 2 -1096 11 -1120 13 -39 17 -41 139 -81 237 -79 396 -235 460
|
|
16
|
+
-451 13 -41 27 -81 33 -87 14 -19 91 -16 116 5 12 10 27 42 36 77 50 197 195
|
|
17
|
+
357 394 432 36 14 558 148 1159 299 602 151 1098 277 1104 280 39 24 38 -10
|
|
18
|
+
38 2129 l0 2057 -29 29 c-18 18 -40 29 -56 29 -26 0 -129 -23 -435 -96 -80
|
|
19
|
+
-19 -233 -55 -340 -80 -107 -24 -231 -53 -275 -64 -137 -33 -276 -66 -695
|
|
20
|
+
-164 -223 -53 -438 -105 -478 -116 -155 -43 -297 -137 -395 -259 -33 -42 -62
|
|
21
|
+
-77 -66 -79 -4 -1 -14 11 -24 27 -61 103 -169 201 -299 270 -102 55 -198 83
|
|
22
|
+
-573 165 -60 14 -177 41 -260 61 -82 20 -258 61 -390 91 -273 62 -373 86 -962
|
|
23
|
+
224 -95 22 -186 40 -202 40 -17 0 -42 -10 -58 -24z m5375 -2141 c-2 -1509 -6
|
|
24
|
+
-1957 -15 -1963 -11 -7 -390 -102 -1616 -407 -633 -157 -693 -181 -844 -328
|
|
25
|
+
l-63 -61 0 1840 c0 2024 -2 1949 60 2078 55 114 146 205 265 264 68 34 125 50
|
|
26
|
+
450 126 227 53 824 194 1105 261 80 18 215 50 300 70 85 19 189 44 230 54 41
|
|
27
|
+
11 88 20 103 20 l28 1 -3 -1955z"/>
|
|
28
|
+
<path d="M811 4798 c-238 -35 -442 -211 -525 -455 -69 -202 -55 -398 41 -592
|
|
29
|
+
81 -165 250 -313 423 -372 82 -28 262 -38 353 -19 80 16 196 70 264 121 l53
|
|
30
|
+
40 0 -1055 c0 -580 -3 -1057 -7 -1059 -5 -3 -84 14 -178 37 l-170 42 0 846 c0
|
|
31
|
+
818 -1 847 -19 867 -25 27 -85 28 -117 2 l-24 -19 -3 -896 -2 -897 24 -24 c13
|
|
32
|
+
-13 48 -30 77 -39 129 -35 489 -116 517 -116 66 0 62 -95 62 1362 0 1140 2
|
|
33
|
+
1319 15 1331 12 13 121 14 782 12 805 -2 811 -2 827 40 13 36 6 82 -17 103
|
|
34
|
+
l-23 22 -802 0 -802 0 -29 65 c-53 116 -176 223 -300 259 -76 22 -194 21 -273
|
|
35
|
+
-4 -161 -50 -268 -188 -268 -349 0 -128 60 -232 165 -286 50 -26 70 -30 134
|
|
36
|
+
-30 63 0 86 5 134 28 69 34 92 64 83 109 -13 66 -56 84 -111 48 -21 -14 -47
|
|
37
|
+
-20 -88 -20 -53 0 -61 3 -100 39 -42 39 -42 40 -42 110 0 61 4 75 30 113 40
|
|
38
|
+
58 119 98 191 98 190 0 351 -188 331 -386 -12 -115 -109 -255 -213 -306 -145
|
|
39
|
+
-73 -326 -70 -472 7 -127 66 -245 206 -292 346 -63 186 -12 428 121 573 58 63
|
|
40
|
+
161 120 247 136 33 6 494 10 1205 10 1138 0 1152 0 1172 20 29 29 27 96 -4
|
|
41
|
+
121 -21 17 -41 19 -195 19 -94 0 -610 1 -1147 3 -537 1 -999 -1 -1028 -5z"/>
|
|
42
|
+
<path d="M1743 3618 c-11 -13 -23 -31 -26 -41 -10 -27 18 -84 44 -92 12 -4
|
|
43
|
+
335 -8 716 -8 l694 -1 21 22 c32 31 28 89 -7 119 l-26 23 -698 0 -698 0 -20
|
|
44
|
+
-22z"/>
|
|
45
|
+
<path d="M1959 3197 c-39 -30 -39 -23 -39 -1110 0 -990 1 -1056 18 -1076 9
|
|
46
|
+
-12 34 -24 54 -27 30 -5 41 -2 62 19 l26 26 2 953 c0 524 2 1000 3 1058 1 109
|
|
47
|
+
-9 152 -40 164 -26 10 -69 6 -86 -7z"/>
|
|
48
|
+
<path d="M2484 3186 l-28 -23 -1 -1198 0 -1197 25 -20 c19 -15 34 -19 64 -15
|
|
49
|
+
77 11 71 -101 74 1233 l2 1195 -24 24 c-32 32 -76 32 -112 1z"/>
|
|
50
|
+
</g>
|
|
51
|
+
</svg>
|
|
@@ -3,6 +3,12 @@ import { defineConfig } from '@lexibase/rdx-next'
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
title: 'My documentation',
|
|
5
5
|
description: 'Documentation built with RDX.',
|
|
6
|
+
navbar: {
|
|
7
|
+
title: '',
|
|
8
|
+
},
|
|
9
|
+
homepage: {
|
|
10
|
+
enabled: false,
|
|
11
|
+
},
|
|
6
12
|
theme: {
|
|
7
13
|
defaultTheme: 'system',
|
|
8
14
|
},
|