Skip to content

Commit

Permalink
Rustdoc: Scrape examples (#9154)
Browse files Browse the repository at this point in the history
# Objective

Provide more usage examples in API docs so that people can see methods
being used in context.

## Solution

Enable experimental rustdoc feature "scrape examples". See
<https://doc.rust-lang.org/nightly/rustdoc/scraped-examples.html> for
official docs.

## Example screenshots of examples :)

<img width="1013" alt="image"
src="https://github.com/bevyengine/bevy/assets/20063/7abc8baa-3149-476f-b2f2-ce7693758bee">

<img width="1033" alt="image"
src="https://github.com/bevyengine/bevy/assets/20063/163e7e22-c55e-46ab-8f3d-75fb97c3ad7a">

<img width="1009" alt="image"
src="https://github.com/bevyengine/bevy/assets/20063/a50b1147-e252-43f3-9adb-81960b8aa6c3">


## Limitations

- Only methods seem to show examples so far
- It may be confusing to have curated examples from doc comments
followed by snippets from `examples/`

---------

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
  • Loading branch information
killercup and cart authored Aug 10, 2023
1 parent 77824b9 commit 2cc1068
Showing 1 changed file with 184 additions and 0 deletions.
Loading

0 comments on commit 2cc1068

Please sign in to comment.