File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,33 @@ import { readFileSync } from "node:fs";
2
2
import { defineConfig } from "astro/config" ;
3
3
import starlight from "@astrojs/starlight" ;
4
4
5
+ const starlightPlugin = {
6
+ name : "RescriptAPIDocs" ,
7
+ hooks : {
8
+ setup : ( { config, updateConfig, addIntegration } ) => {
9
+ console . log ( `Setup yow!` )
10
+ addIntegration ( {
11
+ name : "RescriptAPIDocs" ,
12
+ hooks : {
13
+ "astro:config:setup" : ( { injectRoute } ) => {
14
+ injectRoute ( {
15
+ pattern : "meh" ,
16
+ entrypoint : "docs/apidocs/meh.astro"
17
+ } )
18
+ }
19
+ }
20
+ } )
21
+
22
+ updateConfig ( {
23
+ sidebar : [
24
+ ...config . sidebar ,
25
+ { label : "meh" , link : "meh" }
26
+ ]
27
+ } ) ;
28
+ }
29
+ }
30
+ }
31
+
5
32
const rescriptTM = JSON . parse (
6
33
readFileSync ( "./docs/assets/rescript.tmLanguage.json" , "utf-8" ) ,
7
34
) ;
@@ -44,6 +71,7 @@ export default defineConfig({
44
71
langs : [ rescriptTM ] ,
45
72
} ,
46
73
} ,
74
+ plugins : [ starlightPlugin ] ,
47
75
} ) ,
48
76
] ,
49
77
} ) ;
Original file line number Diff line number Diff line change
1
+ ---
2
+ import StarlightPage from " @astrojs/starlight/components/StarlightPage.astro" ;
3
+
4
+ const frontmatter = {
5
+ title: " Meh" ,
6
+ }
7
+ ---
8
+
9
+ <StarlightPage frontmatter ={ frontmatter } >
10
+ <h1 >Muhahah</h1 >
11
+ </StarlightPage >
You can’t perform that action at this time.
0 commit comments