-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from DarrenBaldwin07/docs-website
Docs website
- Loading branch information
Showing
23 changed files
with
623 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist | ||
build | ||
target | ||
*.mdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { Text } from '@rapid-web/ui'; | ||
import { Link } from '@remix-run/react'; | ||
import Github from '../../assets/github.svg'; | ||
import { faChevronRight } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { getNextDocPathName, shouldShowDocsNavigation } from '../routes/docs'; | ||
|
||
const NextDoc = () => { | ||
const [pathName, setPathName] = useState<string>(); | ||
const [isShowingDocsNavigation, setIsShowingDocsNavigation] = | ||
useState(false); | ||
|
||
useEffect(() => { | ||
setPathName(window.location.pathname); | ||
setIsShowingDocsNavigation( | ||
shouldShowDocsNavigation(pathName as string), | ||
); | ||
}, [pathName]); | ||
|
||
return ( | ||
<> | ||
{isShowingDocsNavigation && ( | ||
<div className='mt-16 flex flex-col items-center gap-4 md:flex-row'> | ||
<a | ||
href='https://github.com/Cincinnati-Ventures/rapid' | ||
className='exclude-from-markdown w-full no-underline md:w-1/3' | ||
> | ||
<div className='hover:border-mainBlue flex items-center gap-2 rounded-lg border-[0.5px] border-[#222222] p-4 transition-all duration-100 ease-linear'> | ||
<img width={20} src={Github} alt='github' /> | ||
<Text className='text-sm font-bold text-white'> | ||
View on Github | ||
</Text> | ||
</div> | ||
</a> | ||
<Link | ||
to={getNextDocPathName(pathName).path} | ||
className='exclude-from-markdown w-full no-underline md:w-1/3' | ||
> | ||
<div className='hover:border-mainBlue flex items-center gap-2 rounded-lg border-[0.5px] border-[#222222] p-4 transition-all duration-100 ease-linear'> | ||
<FontAwesomeIcon | ||
icon={faChevronRight} | ||
color='white' | ||
width={20} | ||
height={20} | ||
/> | ||
<Text className='text-sm font-bold text-white'> | ||
Next Doc: {getNextDocPathName(pathName)?.text} | ||
</Text> | ||
</div> | ||
</Link> | ||
</div> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default NextDoc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import CodeBlock from '../components/CodeBlock'; | ||
|
||
Every Rapid project must have a configuration file called `rapid.toml`. This document outlines all of the possible configuration options and what they do in detail. | ||
<br /> | ||
## Base configurations | ||
|
||
### Server | ||
This is the default config for a Rapid server project scaffolded with `rapid new --server`: | ||
<CodeBlock language='rust' code={`app_type = "server" | ||
[server] | ||
serve_static_files = true // Toggles static file serving from the "/public" directory | ||
is_logging = true // Toggles request/response logging | ||
typescript_generation = true | ||
port = 8080 // Changes the port that the Rapid server is served on | ||
routes_directory = "src/routes" // Specifies the directory where rapid will parse for file-based routing | ||
bindings_export_path = "/" // The path where you want your typescript bindings to be exported from | ||
`} /> | ||
|
||
<br /> | ||
|
||
### Remix | ||
This is the default config for a Rapid remix project scaffolded with `rapid new --remix`: | ||
<CodeBlock language='rust' code={`app_type = "remix" | ||
[remix] | ||
server_port = 8080 | ||
serve_static_files = true | ||
is_logging = true | ||
typescript_generation = true | ||
bindings_export_path = "app/api" | ||
`} /> | ||
|
||
<br /> | ||
|
||
### NextJS | ||
This is the default config for a Rapid nextjs project scaffolded with `rapid new --nextjs`: | ||
<CodeBlock language='rust' code={`app_type = "nextjs" | ||
[nextjs] | ||
server_port = 8080 | ||
serve_static_files = true | ||
is_logging = true | ||
typescript_generation = true | ||
bindings_export_path = "pages/api" | ||
`} /> | ||
|
||
<br /> | ||
|
||
## Config options | ||
> Coming soon... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from 'react'; | ||
import { docsSetup } from '~/helpers'; | ||
import { Heading } from '@rapid-web/ui'; | ||
import type { LoaderFunction, LinksFunction } from '@remix-run/node'; | ||
import { useLoaderData, Outlet } from '@remix-run/react'; | ||
import { BreadCrumb } from '~/components/BreadCrumb'; | ||
import styles from '../styles/markdown.css'; | ||
import prism from '../styles/prism.css'; | ||
import NextDoc from '~/components/NextDoc'; | ||
|
||
interface LoaderOutput { | ||
routes: string[]; | ||
} | ||
|
||
export const links: LinksFunction = () => { | ||
return [ | ||
{ | ||
rel: 'stylesheet', | ||
href: styles, | ||
}, | ||
{ | ||
rel: 'stylesheet', | ||
href: prism, | ||
}, | ||
]; | ||
}; | ||
|
||
export const loader: LoaderFunction = ({ request }) => { | ||
return docsSetup('configuration', request); | ||
}; | ||
|
||
const Configuration = () => { | ||
const data = useLoaderData<LoaderOutput>(); | ||
return ( | ||
<div className='w-full'> | ||
<BreadCrumb routes={data.routes} /> | ||
<Heading styles='exclude-from-markdown text-white text-5xl font-bold'> | ||
Configuration | ||
</Heading> | ||
<div className='mt-12 w-full text-white'> | ||
<Outlet /> | ||
</div> | ||
<NextDoc /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Configuration; |
Oops, something went wrong.