Skip to content

Commit ef36035

Browse files
committed
Docs(Preamble): added link to help readers understand crate
1 parent f31dc55 commit ef36035

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

docs/writing-reactors/preambles.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ The important takeaway here is with the package.json file and the compiled JavaS
442442

443443
For example, you can use the `preamble` to define macros and functions that are shared within the given reactor:
444444

445-
```lf-c
445+
```lf-rs
446446
target Rust;
447447
448448
main reactor {
@@ -476,7 +476,7 @@ This also can allow us to change the scope of items using the `use` statement.
476476

477477
For example, the follow reactor brings the constant `PI` into scope and print out the first 15 digits of pi:
478478

479-
```lf-c
479+
```lf-rs
480480
target Rust;
481481
482482
main reactor {
@@ -502,7 +502,7 @@ This would be an example of accessing a user created module named `foo` that is
502502

503503
File: example.lf
504504

505-
```lf-c
505+
```lf-rs
506506
target Rust {
507507
rust-include: ["foo.rs"]
508508
}
@@ -530,12 +530,8 @@ This will print:
530530
Hello, world!
531531
```
532532

533-
It is important to note that besides Crates specified in the rust target declaration's _cargo-dependencies_ and user modules in _rust-include_, all user code is added to a module called `reactors` during compilation time.
533+
It is important to note that besides [crates](https://doc.rust-lang.org/book/ch07-01-packages-and-crates.html) specified in the rust target declaration's _cargo-dependencies_ and user modules in _rust-include_, all user code is added to a module called `reactors` during compilation time.
534534
This means that crate level attributes like `#![no_std]` will not work if added to the preamble.
535535

536-
:::danger
537-
FIXME: Add `preamble` example.
538-
:::
539-
540536
</ShowIf>
541537
</ShowIfs>

0 commit comments

Comments
 (0)