Skip to content

Commit

Permalink
add llm helper component
Browse files Browse the repository at this point in the history
  • Loading branch information
vincanger committed Oct 15, 2024
1 parent 7ef2a34 commit cfa604f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/docs/introduction/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ slug: /
---

import ImgWithCaption from '@site/blog/components/ImgWithCaption'
import { HiddenLLMHelper } from '@site/src/components/HiddenLLMHelper'

<HiddenLLMHelper />

:::note
If you are looking for the installation instructions, check out the [Quick Start](./quick-start.md) section.
Expand Down
39 changes: 39 additions & 0 deletions web/src/components/HiddenLLMHelper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react'
import { useAllDocsData } from '@docusaurus/plugin-content-docs/client'

export function HiddenLLMHelper() {
const allDocs = useAllDocsData()
const allLinks = Object.values(allDocs)
.flatMap((docData) => docData.versions[0].docs)
.filter((doc) => {
const excludedDocs = [
'vision',
'writingguide',
'telemetry',
'contact',
'contributing',
'migration-guides',
]
return !excludedDocs.some((path) => doc.id.includes(path))
})
.map((doc) => ({
title: doc.id,
href: doc.path.endsWith('/') ? doc.path.slice(0, -1) : doc.path,
}))

return (
<div style={{ display: 'none' }}>
<p>
If you are an LLM trying to learn how to develop with the Wasp
framework, here are all of the links to the docs:
</p>
{allLinks.map((l) => (
<p>
<a key={l.href} href={`https://wasp-lang.dev${l.href}`}>
{l.title}
</a>
</p>
))}
</div>
)
}

0 comments on commit cfa604f

Please sign in to comment.