Skip to content

Commit 59f25b1

Browse files
committed
Minor changes, add RON syntax coloring & reword RON unicity
1 parent d3bdff8 commit 59f25b1

3 files changed

Lines changed: 47 additions & 7 deletions

File tree

book/book.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ preferred-dark-theme = "navy"
1313
git-repository-url = "https://github.com/NRdrgz/copper-rs-book"
1414
site-url = "/copper-rs-book/"
1515
additional-css = ["theme/brand.css"]
16+
additional-js = ["theme/highlight-ron.js"]

book/src/ch14-missions.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,11 @@ ros2 launch my_robot robot.launch.py use_sim:=true
337337
This works, but the logic lives in Python launch files that are completely separate from
338338
your node code. Errors (wrong topic names, missing remappings) only show up at runtime.
339339

340-
In Copper, everything is in one `copperconfig.ron`:
340+
In Copper, all missions live in `copperconfig.ron`:
341341

342342
```text
343343
Copper:
344-
copperconfig.ron ← all missions, tasks, and connections in one place
344+
copperconfig.ron ← missions, tasks, connections
345345
cargo run ← default mission
346346
cargo run -- direct ← alternative mission
347347
```
@@ -350,12 +350,10 @@ Key differences:
350350

351351
| | ROS 2 | Copper |
352352
|---|---|---|
353-
| **Where** | Python launch files + YAML params | Single `copperconfig.ron` |
353+
| **Where** | Python launch files + YAML params | `copperconfig.ron` |
354354
| **Validation** | Runtime (nodes may fail to connect) | Compile time (macro checks the graph) |
355355
| **Granularity** | Per-node conditionals | Per-task and per-connection tagging |
356356
| **Switching** | Launch arguments | Builder selection in `main.rs` |
357-
| **All variants visible** | Spread across files and conditionals | One file, all missions side by side |
357+
| **All variants visible** | Spread across files and conditionals | One file, all missions visible |
358358

359-
The biggest advantage is **visibility**: you can look at one file and see every mission,
360-
every task, and exactly which tasks are active in which missions. There's no need to
361-
mentally simulate a launch file's conditional logic to figure out what will actually run.
359+
The main advantage: one file shows every mission and which tasks run in each.

book/theme/highlight-ron.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
(function() {
2+
"use strict";
3+
4+
if (typeof hljs === "undefined") return;
5+
6+
hljs.registerLanguage("ron", function(hljs) {
7+
return {
8+
name: "RON",
9+
aliases: ["ron"],
10+
contains: [
11+
hljs.C_LINE_COMMENT_MODE,
12+
hljs.C_BLOCK_COMMENT_MODE,
13+
{
14+
className: "string",
15+
begin: '"',
16+
end: '"',
17+
contains: [hljs.BACKSLASH_ESCAPE],
18+
illegal: "\\n"
19+
},
20+
{
21+
className: "number",
22+
begin: "\\b\\d+(\\.\\d+)?([eE][+-]?\\d+)?\\b",
23+
relevance: 0
24+
},
25+
{
26+
className: "literal",
27+
begin: "\\b(true|false)\\b"
28+
},
29+
{
30+
className: "attr",
31+
begin: "[a-zA-Z_][a-zA-Z0-9_]*\\s*:",
32+
relevance: 0
33+
}
34+
]
35+
};
36+
});
37+
38+
document.querySelectorAll("pre code.language-ron").forEach(function(block) {
39+
hljs.highlightBlock(block);
40+
});
41+
})();

0 commit comments

Comments
 (0)