Skip to content

Commit e4d6be3

Browse files
committed
Updates requirements.txt, moved java code examples into java files. (With Claude's help.)
1 parent a48fc28 commit e4d6be3

5 files changed

Lines changed: 85 additions & 59 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Snippet file: Robot.java integration code for the Telemetry subsystem.
2+
// These are not a standalone class — they show the relevant lines to add to Robot.java.
3+
4+
// --8<-- [start:field-declaration]
5+
public static Telemetry m_telemetry;
6+
// --8<-- [end:field-declaration]
7+
8+
// --8<-- [start:robot-init]
9+
m_telemetry = new Telemetry(); //This must be initialized after all other robot subsystems
10+
// --8<-- [end:robot-init]
11+
12+
// --8<-- [start:periodic-update]
13+
Robot.m_telemetry.update();
14+
// --8<-- [end:periodic-update]

docs/code_examples/Telemetry.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package frc.robot.subsystems;
2+
3+
import edu.wpi.first.wpilibj.command.Subsystem;
4+
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
5+
import frc.robot.Robot;
6+
import frc.robot.commands.*;
7+
8+
/**
9+
* Add your docs here.
10+
*/
11+
// --8<-- [start:full-class]
12+
public class Telemetry extends Subsystem {
13+
// Put methods for controlling this subsystem
14+
// here. Call these from Commands.
15+
16+
public Telemetry() {
17+
// --8<-- [start:constructor-drivetrain]
18+
// Drivetrain
19+
SmartDashboard.putData("Reset Drive Encoder", new DriveResetEncoder());
20+
// --8<-- [end:constructor-drivetrain]
21+
22+
// --8<-- [start:constructor-shooter]
23+
// Shooter
24+
SmartDashboard.putData("Shooter Up", new ShooterUp());
25+
SmartDashboard.putData("Shooter Down", new ShooterDown());
26+
SmartDashboard.putData("Shooter Up Auto", new ShooterUpAuto());
27+
// --8<-- [end:constructor-shooter]
28+
}
29+
30+
public void update() {
31+
// --8<-- [start:update-drivetrain]
32+
// Drivetrain
33+
SmartDashboard.putNumber("Drive Encoder Count", Robot.m_drivetrain.getDriveEncoderCount());
34+
// --8<-- [end:update-drivetrain]
35+
36+
// --8<-- [start:update-shooter]
37+
// Shooter
38+
SmartDashboard.putBoolean("Shooter Switch", Robot.m_shooter.isShooterSwitchClosed());
39+
// --8<-- [end:update-shooter]
40+
}
41+
42+
@Override
43+
public void initDefaultCommand() {
44+
// Set the default command for a subsystem here.
45+
// setDefaultCommand(new MySpecialCommand());
46+
}
47+
}
48+
// --8<-- [end:full-class]

docs/programming/Elastic.md

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ In this section we will be going over
4040
!!! abstract ""
4141
**3)** Inside type:
4242

43-
```java
44-
SmartDashboard.putData("Reset Drive Encoder", new DriveResetEncoder());
43+
```java title="Telemetry.java"
44+
--8<-- "docs/code_examples/Telemetry.java:constructor-drivetrain"
4545
```
4646

4747
!!! abstract ""
@@ -52,8 +52,8 @@ In this section we will be going over
5252
!!! abstract ""
5353
**5)** Inside type:
5454

55-
```java
56-
SmartDashboard.putNumber("Drivetrain Encoder Count", Robot.m_drivetrain.getDriveEncoderCount());
55+
```java title="Telemetry.java"
56+
--8<-- "docs/code_examples/Telemetry.java:update-drivetrain"
5757
```
5858

5959
!!! abstract ""
@@ -66,45 +66,8 @@ In this section we will be going over
6666

6767
Your full **Telemetry.java** should look like this
6868

69-
```java
70-
package frc.robot.subsystems;
71-
72-
import edu.wpi.first.wpilibj.command.Subsystem;
73-
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
74-
import frc.robot.Robot;
75-
import frc.robot.commands.*;
76-
77-
/**
78-
* Add your docs here.
79-
*/
80-
public class Telemetry extends Subsystem {
81-
// Put methods for controlling this subsystem
82-
// here. Call these from Commands.
83-
84-
public Telemetry() {
85-
// Drivetrain
86-
SmartDashboard.putData("Reset Drive Encoder", new DriveResetEncoder());
87-
88-
// Shooter
89-
SmartDashboard.putData("Shooter Up", new ShooterUp());
90-
SmartDashboard.putData("Shooter Down", new ShooterDown());
91-
SmartDashboard.putData("Shooter Up Auto", new ShooterUpAuto());
92-
}
93-
94-
public void update() {
95-
// Drivetrain
96-
SmartDashboard.putNumber("Drive Encoder Count", Robot.m_drivetrain.getDriveEncoderCount());
97-
98-
// Shooter
99-
SmartDashboard.putBoolean("Shooter Switch", Robot.m_shooter.isShooterSwitchClosed());
100-
}
101-
102-
@Override
103-
public void initDefaultCommand() {
104-
// Set the default command for a subsystem here.
105-
// setDefaultCommand(new MySpecialCommand());
106-
}
107-
}
69+
```java title="Telemetry.java"
70+
--8<-- "docs/code_examples/Telemetry.java:full-class"
10871
```
10972

11073
## Adding The Telemetry Subsystem to Robot.java
@@ -126,20 +89,20 @@ In this section we will be going over
12689

12790
The code you typed before **robotInit** should be this
12891

129-
```java
130-
public static Telemetry m_telemetry;
92+
```java title="Robot.java"
93+
--8<-- "docs/code_examples/RobotTelemetry.java:field-declaration"
13194
```
13295

13396
The code you typed in **robotInit** should be this
13497

135-
```java
136-
m_telemetry = new Telemetry(); //This must be initialized after all other robot subsystems
98+
```java title="Robot.java"
99+
--8<-- "docs/code_examples/RobotTelemetry.java:robot-init"
137100
```
138101

139102
The code you typed in **disabledPeriodic, autonomousPeriodic**, and **teleopPeriodic** should be this
140103

141-
```java
142-
Robot.m_telemetry.update();
104+
```java title="Robot.java"
105+
--8<-- "docs/code_examples/RobotTelemetry.java:periodic-update"
143106
```
144107

145108
## Opening Elastic

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Install requirements:
22
# pip install -r requirements.txt
33
mkdocs
4+
mkdocs-material
45
pymdown-extensions
56
mkdocs-minify-plugin

tutorial-platform-analysis.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,15 @@ JavaScript runtime Markdown renderer (MIT). No build step — Markdown is fetche
177177

178178
---
179179

180-
### 8. mdBook
180+
### 8. [mdBook](https://rust-lang.github.io/mdBook/)
181181

182182
Rust-based static site generator (Apache 2.0 / MIT) maintained by the Rust language team. Used for official Rust documentation.
183183

184-
**Markdown Support:** CommonMark + some GFM extensions. Custom preprocessors (Rust or any subprocess). MathJax and Mermaid via preprocessors.
184+
**Markdown Support:** CommonMark + some GFM extensions. Custom preprocessors (Rust or any subprocess). [MathJax](https://www.mathjax.org/) and [Mermaid](https://mermaid.js.org/) via preprocessors.
185185

186186
**Quiz Support:**
187187
- [`mdbook-quiz`](https://crates.io/crates/mdbook-quiz) (Apache 2.0 + MIT, v0.4.0, 148 GitHub stars): dedicated quiz preprocessor with questions authored in TOML files. Question types: ShortAnswer, MultipleChoice, and Tracing (predict Rust code output — Rust-specific). Used by Will Crichton's Rust learning materials at Brown University.
188-
- `mdbook-exercises` (December 2025): interactive exercise blocks with hints, solutions, Rust Playground integration, difficulty levels, time estimates.
188+
- [`mdbook-exercises`](https://github.com/rust-lang/mdBook/wiki/Third-party-plugins) (December 2025): interactive exercise blocks with hints, solutions, [Rust Playground](https://play.rust-lang.org/) integration, difficulty levels, time estimates.
189189
- `cache-answers = true` stores user answers in localStorage.
190190

191191
**Progress Tracking:** `mdbook-quiz` with `cache-answers` persists quiz answers. No cross-book progress dashboard.
@@ -200,7 +200,7 @@ Rust-based static site generator (Apache 2.0 / MIT) maintained by the Rust langu
200200

201201
---
202202

203-
### 9. LiaScript *(Purpose-Built)*
203+
### 9. [LiaScript](https://liascript.github.io/) *(Purpose-Built)*
204204

205205
Open-source browser-based Markdown interpreter (MIT) extended with interactive learning primitives. Developed at TU Bergakademie Freiberg for Open Educational Resources. No server or build step required.
206206

@@ -210,7 +210,7 @@ Open-source browser-based Markdown interpreter (MIT) extended with interactive l
210210

211211
**Progress Tracking:** Built-in. LiaScript is a Progressive Web App (PWA) and stores course progress locally. Works offline after first load.
212212

213-
**LMS Export:** SCORM 1.2 and SCORM 2004 export via `LiaScript-Exporter` CLI. Also exports to IMS, PDF, standalone web project, and Android APK. Most LMS-compatible platform reviewed — supports Moodle, ILIAS, OpenOlat, Canvas, Blackboard.
213+
**LMS Export:** SCORM 1.2 and SCORM 2004 export via [`LiaScript-Exporter`](https://github.com/LiaScript/LiaScript-Exporter) CLI. Also exports to IMS, PDF, standalone web project, and Android APK. Most LMS-compatible platform reviewed — supports [Moodle](https://moodle.org/), [ILIAS](https://www.ilias.de/), [OpenOlat](https://www.openolat.com/), [Canvas](https://www.instructure.com/canvas), [Blackboard](https://www.anthology.com/products/teaching-and-learning/blackboard-learn).
214214

215215
**Hosting:** Content can be served from GitHub, GitLab, Nextcloud, Dropbox, IPFS, and more. The LiaScript interpreter loads from a CDN and processes a Markdown URL — content and renderer are completely decoupled.
216216

@@ -246,7 +246,7 @@ Open-source browser-based Markdown interpreter (MIT) extended with interactive l
246246

247247
### Recommendation 1 — Minimal effort, maximum immediate capability
248248

249-
**Stay on MkDocs + Material and add `mkdocs-quiz` and `mkdocs-material-mark-as-read`.**
249+
**Stay on [MkDocs](https://www.mkdocs.org/) + [Material](https://squidfunk.github.io/mkdocs-material/) and add [`mkdocs-quiz`](https://ewels.github.io/mkdocs-quiz/) and [`mkdocs-material-mark-as-read`](https://github.com/berk-karaal/mkdocs-material-mark-as-read).**
250250

251251
```bash
252252
pip install mkdocs-quiz mkdocs-material-mark-as-read
@@ -268,23 +268,23 @@ This delivers:
268268
269269
No framework migration. No new toolchain. Existing content unchanged. Working quizzes within an hour of setup.
270270
271-
The Material maintenance-mode concern is real but not urgent — existing functionality is stable. Monitor **Zensical** (the MIT-licensed successor by the same maintainer) as the natural long-term migration target with minimal content changes.
271+
The Material maintenance-mode concern is real but not urgent — existing functionality is stable. Monitor **[Zensical](https://github.com/zensical/zensical)** (the MIT-licensed successor by the same maintainer) as the natural long-term migration target with minimal content changes.
272272
273273
---
274274
275275
### Recommendation 2 — Migration path with maximum extensibility
276276
277-
**Migrate to Docusaurus** if React expertise exists and the project needs quiz UI beyond multiple-choice (e.g., embedded code exercises, interactive robot simulators, code-grading sandboxes).
277+
**Migrate to [Docusaurus](https://docusaurus.io/)** if React expertise exists and the project needs quiz UI beyond multiple-choice (e.g., embedded code exercises, interactive robot simulators, code-grading sandboxes).
278278
279-
MDX allows any React component in any page. The `@sp-days-framework/docusaurus-plugin-interactive-tasks` provides structured task completion with sidebar badges immediately. Custom quiz components can be built incrementally. Docusaurus has no maintenance concerns and the largest ecosystem.
279+
[MDX](https://mdxjs.com/) allows any React component in any page. The [`@sp-days-framework/docusaurus-plugin-interactive-tasks`](https://www.npmjs.com/package/@sp-days-framework/docusaurus-plugin-interactive-tasks) provides structured task completion with sidebar badges immediately. Custom quiz components can be built incrementally. Docusaurus has no maintenance concerns and the largest ecosystem.
280280

281281
Migration cost: several days — `mkdocs.yml` nav → `docusaurus.config.js`, PyMdown admonition syntax → Docusaurus admonition syntax, custom overrides rebuild.
282282

283283
---
284284

285285
### Recommendation 3 — LMS integration requirement
286286

287-
**Evaluate LiaScript** alongside the existing MkDocs reference site if FRC tutorial content needs to integrate with school LMS platforms (Moodle, Canvas) for grading or credit.
287+
**Evaluate [LiaScript](https://liascript.github.io/)** alongside the existing MkDocs reference site if FRC tutorial content needs to integrate with school LMS platforms ([Moodle](https://moodle.org/), [Canvas](https://www.instructure.com/canvas)) for grading or credit.
288288

289289
LiaScript Markdown files can live in the same GitHub repository. SCORM export is a one-command CLI operation. The course content (Markdown) is shared; only the rendering layer differs between the MkDocs documentation site and the LiaScript course export.
290290

0 commit comments

Comments
 (0)