starlight-dot-md 0.1.0 → 0.1.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/LICENSE +21 -0
- package/README.md +1 -70
- package/package.json +51 -51
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shinya Fujino
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,73 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
A Starlight integration that exposes raw markdown files at `.md` URLs.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install starlight-dot-md
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
// astro.config.mjs
|
|
15
|
-
import starlight from "@astrojs/starlight";
|
|
16
|
-
import { defineConfig } from "astro/config";
|
|
17
|
-
import starlightDotMd from "starlight-dot-md";
|
|
18
|
-
|
|
19
|
-
export default defineConfig({
|
|
20
|
-
integrations: [
|
|
21
|
-
starlight({ ... }),
|
|
22
|
-
starlightDotMd(),
|
|
23
|
-
],
|
|
24
|
-
});
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
After build, access any page's source by appending `.md` to its URL (e.g., `/guides/example.md`).
|
|
28
|
-
|
|
29
|
-
> **Note**: By default, both `.md` and `.mdx` files are served with the `.md` extension. Use the `preserveExtension` option to keep the original extension.
|
|
30
|
-
|
|
31
|
-
## Options
|
|
32
|
-
|
|
33
|
-
### `excludePatterns`
|
|
34
|
-
|
|
35
|
-
An array of glob patterns to exclude pages from being served as `.md` files.
|
|
36
|
-
|
|
37
|
-
```js
|
|
38
|
-
starlightDotMd({
|
|
39
|
-
excludePatterns: ["private/**", "**/draft-*"],
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### `includePatterns`
|
|
44
|
-
|
|
45
|
-
An array of glob patterns to include pages for being served as `.md` files. When specified, only pages matching these patterns will be served.
|
|
46
|
-
|
|
47
|
-
```js
|
|
48
|
-
starlightDotMd({
|
|
49
|
-
includePatterns: ["guides/**"],
|
|
50
|
-
});
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
You can use both options together. Pages must match `includePatterns` (if specified) and not match `excludePatterns`.
|
|
54
|
-
|
|
55
|
-
```js
|
|
56
|
-
starlightDotMd({
|
|
57
|
-
includePatterns: ["guides/**"],
|
|
58
|
-
excludePatterns: ["guides/internal/**"],
|
|
59
|
-
});
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### `preserveExtension`
|
|
63
|
-
|
|
64
|
-
When set to `true`, `.mdx` files are served with their original `.mdx` extension instead of being normalized to `.md`.
|
|
65
|
-
|
|
66
|
-
```js
|
|
67
|
-
starlightDotMd({
|
|
68
|
-
preserveExtension: true,
|
|
69
|
-
});
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
With this option enabled:
|
|
73
|
-
- `.md` files are served at `.md` URLs (e.g., `/guides/example.md`)
|
|
74
|
-
- `.mdx` files are served at `.mdx` URLs (e.g., `/index.mdx`)
|
|
5
|
+
For installation, usage, and configuration options, see the [documentation](https://starlight-dot-md.vercel.app/).
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
2
|
+
"name": "starlight-dot-md",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "A Starlight integration that exposes raw markdown files at `.md` URLs.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"astro",
|
|
7
|
+
"withastro",
|
|
8
|
+
"astro-component",
|
|
9
|
+
"astro-integration",
|
|
10
|
+
"starlight",
|
|
11
|
+
"ai"
|
|
12
|
+
],
|
|
13
|
+
"author": "Shinya Fujino <shf0811@gmail.com> (https://github.com/morinokami)",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/morinokami/starlight-dot-md.git",
|
|
19
|
+
"directory": "packages/starlight-dot-md"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/morinokami/starlight-dot-md/issues"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": "./dist/index.mjs",
|
|
26
|
+
"./slug.md": "./dist/slug.md.mjs",
|
|
27
|
+
"./slug.mdx": "./dist/slug.mdx.mjs",
|
|
28
|
+
"./slug.mdoc": "./dist/slug.mdoc.mjs"
|
|
29
|
+
},
|
|
30
|
+
"main": "./dist/index.mjs",
|
|
31
|
+
"module": "./dist/index.mjs",
|
|
32
|
+
"types": "./dist/index.d.mts",
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"picomatch": "4.0.3"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/picomatch": "4.0.2",
|
|
41
|
+
"astro": "5.16.6",
|
|
42
|
+
"tsdown": "0.18.3",
|
|
43
|
+
"typescript": "5.9.3"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"astro": ">=5.0.0"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsdown",
|
|
50
|
+
"typecheck": "tsc --noEmit"
|
|
51
|
+
}
|
|
52
|
+
}
|