Skip to content

Commit 903a176

Browse files
committed
Docs work!
1 parent 6f8b759 commit 903a176

14 files changed

Lines changed: 471 additions & 214 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Heading, SubHeading, Text } from "@/components/docs_elements";
2+
3+
export default function DocsPageExample() {
4+
return (
5+
<div>
6+
<Text>
7+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi eu sapien hendrerit, pretium lectus ac,
8+
ultricies sem. Duis suscipit eros nulla. Ut congue finibus felis vel sollicitudin. Nunc aliquet commodo
9+
justo vel suscipit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae;
10+
Praesent orci ipsum, tristique quis erat ut, porta fringilla felis. Suspendisse turpis nisi, maximus a
11+
semper at, efficitur vel orci.
12+
</Text>
13+
<Heading>Use a Heading for big ideas</Heading>
14+
<Text>
15+
Suspendisse consequat orci eu tincidunt pulvinar. Quisque vel libero arcu. Donec arcu metus, eleifend non
16+
tincidunt nec, molestie at purus. Nam porttitor est vitae elit varius tincidunt. Aenean tristique nisi at
17+
sollicitudin ultrices. Sed nisl quam, accumsan vel leo vitae, ullamcorper bibendum ipsum. Interdum et
18+
malesuada fames ac ante ipsum primis in faucibus. Integer eget accumsan ipsum. Praesent vel nulla lacus. In
19+
mollis ipsum nec diam faucibus aliquet.
20+
</Text>
21+
<SubHeading>Use a Subheading for smaller sections</SubHeading>
22+
<Text>
23+
Curabitur a nunc ac nisl efficitur efficitur. Donec eget ligula sed enim efficitur convallis. Donec
24+
convallis, enim in efficitur efficitur, ipsum nisl efficitur nunc, nec efficitur nunc nisl nec nisi.
25+
Donec convallis, enim in efficitur efficitur, ipsum nisl efficitur nunc, nec efficitur nunc nisl nec nisi.
26+
</Text>
27+
</div>
28+
);
29+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { Heading, SubHeading, Text, List } from "@/components/docs_elements";
2+
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
3+
import { Button } from "@/components/ui/button";
4+
import { CodeXml, Hammer, BookOpenText } from "lucide-react";
5+
import { Separator } from "@/components/ui/separator";
6+
7+
const suitePartsListContent = [
8+
{
9+
title: "Core Utilities Library",
10+
description: "A wrapper for the entire FTC SDK built with the goal of reducing boilerplate and making it easier to learn for new programmers while still giving you access to all the power of the native SDK and more.",
11+
icon: CodeXml
12+
},
13+
{
14+
title: "General FTC Utilities",
15+
description: "A collection of utilties for FTC (not just programming related) that are hosted on our website. It includes pulley calculators, arm/flywheel simulators, and much more!",
16+
icon: Hammer
17+
},
18+
{
19+
title: "Learning Resources",
20+
description: "This documentation that you're reading right now isn't just for JavaBee Utilities, but also for everything FTC related! Don't want to use JavaBee? No problem! We have options for learning things using the FTC SDK directly as well.",
21+
icon: BookOpenText
22+
}
23+
];
24+
25+
export default function GettingStarted() {
26+
return (
27+
<div>
28+
<Text>
29+
JavaBee Utilities is an open source wrapper library dedicated to making FTC programming easier.
30+
When it was nothing but a spark in our minds, we looked up to libraries like Pedro Pathing and NextFTC,
31+
open source libraries that make the hardest parts of FTC understandable. We saw a large gap in the market for a
32+
library that doesn't just focus on one specific task, but provides a comprehensive suite of tools with
33+
integration for other libraries that was fast to learn for rookies and veterans alike. The JavaBee suite has 3
34+
main parts:
35+
</Text>
36+
37+
<Card className="grid grid-cols-1 md:grid-cols-3 gap-6 my-6 shadow-lg">
38+
{suitePartsListContent.map((entry) => (
39+
<div key={entry.title} className="text-center px-3">
40+
<entry.icon className="block w-1/4 h-auto mx-auto" />
41+
<h1 className="text-lg font-bold mt-4">{entry.title}</h1>
42+
<p className="text-sm text-muted-foreground mt-1">{entry.description}</p>
43+
</div>
44+
))}
45+
</Card>
46+
47+
<Text>
48+
We were pollinated by students like you, and hope to grow larger as the years go on. We want to thank you
49+
personally for supporting this project, and remind you that sometimes all you need is something sweet to
50+
help your journey. After all, things can always bee simpler!
51+
</Text>
52+
53+
<SubHeading>Ready to get started?</SubHeading>
54+
<p className="text-sm text-muted-foreground mb-4">Download the latest release and add it directly into your FTC teamcode folder.</p>
55+
<div className="flex gap-4">
56+
<Button>Download Release</Button>
57+
<Button variant="outline">View Source Code</Button>
58+
</div>
59+
</div>
60+
);
61+
}

app/docs/docs.config.tsx

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
import React from "react";
2+
import GettingStarted from "@/app/docs/content/about/getting-started";
3+
import DocsPageExample from "@/app/docs/content/about/docs-page-example";
4+
5+
// The fallback component for unimplemented pages
6+
const Placeholder = ({ title }: { title: string }) => (
7+
<p>This page is under construction!</p>
8+
);
9+
10+
export type DocGroup = {
11+
title: string;
12+
items: DocItem[];
13+
};
14+
15+
export type DocItem = {
16+
id: string;
17+
title: string;
18+
description?: string;
19+
component: React.FC;
20+
items?: DocItem[];
21+
};
22+
23+
/**
24+
* This dictionary defines the documentation structure, content, and metadata.
25+
* Each item corresponds to a page in the documentation, with its own React component for the content.
26+
*
27+
* DocGroup (section):
28+
* - title: displayed as a section header in the sidebar
29+
* - items: array of pages or sub-groups within this section
30+
*
31+
* DocItem (page):
32+
* - id: unique identifier used for routing and state management
33+
* - title: displayed in the sidebar and page header
34+
* - description: optional text shown below the title on the page
35+
* - component: the React component that renders the content of the page
36+
* - items: optional array of sub-items for nested documentation pages
37+
*/
38+
export const docsConfig: DocGroup[] = [
39+
{
40+
title: "About",
41+
items: [
42+
{
43+
id: "what-is-javabee",
44+
title: "What is JavaBee?",
45+
description: "JavaBee Utilities is a powerful library designed to simplify and enhance the programming experience for FTC teams.",
46+
component: GettingStarted,
47+
},
48+
{
49+
id: "resources",
50+
title: "Resources",
51+
description: "Important links, videos, and documentation for learning JavaBee.",
52+
component: () => <Placeholder title="Resources" />,
53+
},
54+
{
55+
id: "branding",
56+
title: "Branding",
57+
description: "Logos, colors, and typography for JavaBee.",
58+
component: () => <Placeholder title="Branding" />,
59+
},
60+
{
61+
id: "docs-page-example",
62+
title: "Docs Page Example",
63+
description: "An example documentation page to demonstrate the layout and components.",
64+
component: DocsPageExample,
65+
}
66+
],
67+
},
68+
{
69+
title: "Programming",
70+
items: [
71+
{
72+
id: "robot",
73+
title: "Robot",
74+
component: () => <Placeholder title="Robot" />,
75+
},
76+
{
77+
id: "hardware",
78+
title: "Hardware",
79+
description: "Learn how to wrap your hardware devices.",
80+
component: () => <Placeholder title="Hardware" />,
81+
items: [
82+
{
83+
id: "motor",
84+
title: "Motor",
85+
component: () => <Placeholder title="Motor" />,
86+
},
87+
{
88+
id: "servo",
89+
title: "Servo",
90+
component: () => <Placeholder title="Servo" />,
91+
},
92+
],
93+
},
94+
],
95+
},
96+
{
97+
title: "Examples",
98+
items: [
99+
{
100+
id: "example-pedro",
101+
title: "Example Pedro Autonomous",
102+
component: () => <Placeholder title="Example Pedro Autonomous" />,
103+
},
104+
{
105+
id: "example-teleop",
106+
title: "Example Teleop",
107+
component: () => <Placeholder title="Example Teleop" />,
108+
},
109+
],
110+
},
111+
];
112+
113+
export function getDocInfo(id: string): { component: React.FC; title: string; description?: string; breadcrumbs: string[] } | null {
114+
for (const group of docsConfig) { // Loop through each group in the documentation configuration
115+
for (const item of group.items) { // Loop through each item in the current group (could be an item or a sub-group)
116+
if (item.id === id) { // Is an item that matches the requested ID
117+
return {
118+
component: item.component, title: item.title, description: item.description, breadcrumbs: [group.title, item.title]
119+
};
120+
}
121+
122+
if (item.items) {
123+
for (const sub of item.items) { // Loop through sub-items if they exist (for nested documentation pages)
124+
if (sub.id === id) { // Found a matching sub-item
125+
return {
126+
component: sub.component, title: sub.title, description: sub.description, breadcrumbs: [group.title, item.title, sub.title]
127+
};
128+
}
129+
}
130+
}
131+
}
132+
}
133+
return null;
134+
}

0 commit comments

Comments
 (0)