Skip to content

Commit

Permalink
Trying to be clearer about attribute usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ambiguousname authored Sep 29, 2024
1 parent 5da71e4 commit f4e1c0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/demo_gen/custom_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Let's say you want to add your own custom demonstration functions for a given struct, without demo_gen automagically creating the content of JS functions for you.

This is done with the `#[diplomat::demo(custom_func="filename.mjs")]` attribute. demo_gen will search for files relative to `lib.rs`, and add the contents of `filename.mjs` to its output.
This is done with the `#[diplomat::demo(custom_func="filename.mjs")]` attribute, which can be added above any `struct` definition. demo_gen will search for files relative to `lib.rs`, and add the contents of `filename.mjs` to its output.

Then demo_gen will import the default export of `filename.mjs`, and append it to the list of [RenderInfo](https://github.com/rust-diplomat/diplomat/blob/main/docs/demo_gen.md#step-two-constructing-renderinfo) termini.

Expand Down

0 comments on commit f4e1c0a

Please sign in to comment.