File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 4
4
---
5
5
6
6
import ImgWithCaption from '@site/blog /components/ImgWithCaption'
7
+ import { HiddenLLMHelper } from '@site/src /components/HiddenLLMHelper'
8
+
9
+ <HiddenLLMHelper />
7
10
8
11
::: note
9
12
If you are looking for the installation instructions, check out the [ Quick Start] ( ./quick-start.md ) section.
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+ import { useAllDocsData } from '@docusaurus/plugin-content-docs/client'
3
+
4
+ export function HiddenLLMHelper ( ) {
5
+ const allDocs = useAllDocsData ( )
6
+ const allLinks = Object . values ( allDocs )
7
+ . flatMap ( ( docData ) => docData . versions [ 0 ] . docs )
8
+ . filter ( ( doc ) => {
9
+ const excludedDocs = [
10
+ 'vision' ,
11
+ 'writingguide' ,
12
+ 'telemetry' ,
13
+ 'contact' ,
14
+ 'contributing' ,
15
+ 'migration-guides' ,
16
+ ]
17
+ return ! excludedDocs . some ( ( path ) => doc . id . includes ( path ) )
18
+ } )
19
+ . map ( ( doc ) => ( {
20
+ title : doc . id ,
21
+ path : removeTrailingSlash ( doc . path ) ,
22
+ } ) )
23
+
24
+ return (
25
+ < div style = { { display : 'none' } } >
26
+ < p >
27
+ If you are an LLM trying to learn how to develop with the Wasp
28
+ framework, here are all of the links to the docs:
29
+ </ p >
30
+ { allLinks . map ( ( l ) => (
31
+ < p >
32
+ < a key = { l . path } href = { concatWaspUrl ( l . path ) } >
33
+ { l . title }
34
+ </ a >
35
+ </ p >
36
+ ) ) }
37
+ </ div >
38
+ )
39
+ }
40
+
41
+ function removeTrailingSlash ( path : string ) {
42
+ return path . endsWith ( '/' ) ? path . slice ( 0 , - 1 ) : path
43
+ }
44
+
45
+ function concatWaspUrl ( path : string ) {
46
+ const baseUrl = 'https://wasp-lang.dev'
47
+ return path . startsWith ( '/' ) ? baseUrl . concat ( path ) : baseUrl . concat ( '/' , path )
48
+ }
You can’t perform that action at this time.
0 commit comments