Formatting and working setup page

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
This commit is contained in:
Joshua Castle committed 2024-01-25 22:38:57 -08:00
1 parent 7ee23e37a5
commit 1e1c80cc0c
26 files changed
+1415 -15887

No files matched your search

+56 -56
View File
@@ -3,68 +3,68 @@ import Heading from '@theme/Heading';
import styles from './styles.module.css';
type FeatureItem = {
title: string;
Svg: React.ComponentType<React.ComponentProps<'svg'>>;
description: JSX.Element;
title: string;
Svg: React.ComponentType<React.ComponentProps<'svg'>>;
description: JSX.Element;
};
const FeatureList: FeatureItem[] = [
{
title: 'Easy to Use',
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
used to get your website up and running quickly.
</>
),
},
{
title: 'Focus on What Matters',
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
ahead and move your docs into the <code>docs</code> directory.
</>
),
},
{
title: 'Powered by React',
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
be extended while reusing the same header and footer.
</>
),
},
{
title: 'Easy to Use',
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
used to get your website up and running quickly.
</>
),
},
{
title: 'Focus on What Matters',
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
ahead and move your docs into the <code>docs</code> directory.
</>
),
},
{
title: 'Powered by React',
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
be extended while reusing the same header and footer.
</>
),
},
];
function Feature({title, Svg, description}: FeatureItem) {
return (
<div className={clsx('col col--4')}>
<div className="text--center">
<Svg className={styles.featureSvg} role="img" />
</div>
<div className="text--center padding-horiz--md">
<Heading as="h3">{title}</Heading>
<p>{description}</p>
</div>
</div>
);
function Feature({ title, Svg, description }: FeatureItem) {
return (
<div className={clsx('col col--4')}>
<div className="text--center">
<Svg className={styles.featureSvg} role="img" />
</div>
<div className="text--center padding-horiz--md">
<Heading as="h3">{title}</Heading>
<p>{description}</p>
</div>
</div>
);
}
export default function HomepageFeatures(): JSX.Element {
return (
<section className={styles.features}>
<div className="container">
<div className="row">
{FeatureList.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</div>
</div>
</section>
);
return (
<section className={styles.features}>
<div className="container">
<div className="row">
{FeatureList.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</div>
</div>
</section>
);
}
+68 -21
View File
@@ -1,29 +1,76 @@
import type {Providers, HostingProvider, ProviderType} from "@site/src/types/providers";
import type { Providers, HostingProvider, ProviderType } from "@site/src/types/providers";
import ReactMarkdown from "react-markdown";
import Admonition from '@theme/Admonition';
import React, { useState } from 'react';
export const noP = (props: { children: any; }) => {
const { children } = props;
return children;
const { children } = props;
return children;
}
export const Provider = ({type}) => {
const data: Providers = require('@site/_data/providers.json')
const providers: HostingProvider[] = data[type as ProviderType]
export const Provider = ({ type }) => {
const data: Providers = require('@site/_data/providers.json')
const providers: HostingProvider[] = data[type as ProviderType]
console.log(data, type, providers)
console.log(data, type, providers)
return (
<div>
<ul>{providers.map((provider: HostingProvider) => (
<li>
<a href={provider.url}>{provider.name}</a>
{provider.description != null || provider.description_template != null ? (
<ReactMarkdown children={`&nbsp;&hyphen; ${data.description_templates[provider.description_template] || ''} ${provider.description || ''}`} components={{p: noP}} />
) : (
''
)}
</li>
))}</ul>
</div>
)
return (
<div>
<ul>{providers.map((provider: HostingProvider) => (
<li>
<a href={provider.url}>{provider.name}</a>
{provider.description != null || provider.description_template != null ? (
<ReactMarkdown children={`&nbsp;&hyphen; ${data.description_templates[provider.description_template] || ''} ${provider.description || ''}`} components={{ p: noP }} />
) : (
''
)}
</li>
))}</ul>
</div>
)
}
export const ProviderSelector = () => {
const data: Providers = require('@site/_data/providers.json')
const providers: HostingProvider[] = [
...Object.values(data.built_in),
...Object.values(data.support),
...Object.values(data.no_support)
].flat();
// update providers if description_template is set
providers.forEach((provider) => {
if (provider.description_template != null) {
provider.description = data.description_templates[provider.description_template]
}
})
const [selectedProvider, setSelectedProvider] = useState(null);
const handleSelectionChange = (event) => {
const selectedName = event.target.value;
const provider = providers.find(p => p.name === selectedName);
setSelectedProvider(provider);
}
return (
<div>
<select onChange={handleSelectionChange}>
<option value="none">Select a provider</option>
{providers.map((provider) => (
<option key={provider.name} value={provider.name}>
{provider.name}
</option>
))}
</select>
<Admonition type="info">
{selectedProvider ? (
<ReactMarkdown>{selectedProvider.description}</ReactMarkdown>
) : (
<p>Select a provider to see the description</p>
)}
</Admonition>
</div>
);
}
+5
View File
@@ -0,0 +1,5 @@
import versions from '../../_data/versions.json';
export const Versions = ({ platform }) => {
return versions[platform]
};
+29 -29
View File
@@ -8,36 +8,36 @@ import Heading from '@theme/Heading';
import styles from './index.module.css';
function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
return (
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<Heading as="h1" className="hero__title">
{siteConfig.title}
</Heading>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/geyser">
Docusaurus Tutorial - 5min ⏱️
</Link>
</div>
</div>
</header>
);
const { siteConfig } = useDocusaurusContext();
return (
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<Heading as="h1" className="hero__title">
{siteConfig.title}
</Heading>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/geyser">
Docusaurus Tutorial - 5min ⏱️
</Link>
</div>
</div>
</header>
);
}
export default function Home(): JSX.Element {
const {siteConfig} = useDocusaurusContext();
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
<HomepageHeader />
<main>
<HomepageFeatures />
</main>
</Layout>
);
const { siteConfig } = useDocusaurusContext();
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
<HomepageHeader />
<main>
<HomepageFeatures />
</main>
</Layout>
);
}
+13 -13
View File
@@ -1,20 +1,20 @@
export type HostingProvider = {
name: string;
url: string;
description?: string;
description_template?: "default" | "ip_and_port" | "forwarding_option" | "java_ip";
name: string;
url: string;
description?: string;
description_template?: "default" | "ip_and_port" | "forwarding_option" | "java_ip";
}
export type ProviderType = "built_in" | "support" | "no_support";
export type Providers = {
description_templates: {
default: string;
ip_and_port: string;
forwarding_option: string;
java_ip: string;
},
built_in: HostingProvider[];
support: HostingProvider[];
no_support: HostingProvider[];
description_templates: {
default: string;
ip_and_port: string;
forwarding_option: string;
java_ip: string;
},
built_in: HostingProvider[];
support: HostingProvider[];
no_support: HostingProvider[];
}