bevy-website icon indicating copy to clipboard operation
bevy-website copied to clipboard

Show example shader code in a separate code block

Open IceSentry opened this issue 3 years ago • 3 comments
trafficstars

Objective

The shader examples are missing the actual shader code which is a pretty important part of those examples. We should have a way to also copy the code from those files and show them in a code block below the current code block.

IceSentry avatar Aug 31 '22 15:08 IceSentry

What if in the example metadata, you could specify a list of important related files that should also be shown on the website?

[package.metadata.example.shader_material]
name = "Shader Material"
# ...
related = ["assets/shaders/custom_material.wgsl"]

BD103 avatar Feb 18 '24 04:02 BD103

Yeah, that makes sense. It would be ideal if it was completely automated but I don't think that's possible

IceSentry avatar Feb 18 '24 20:02 IceSentry

you could imagine going through every call in an example to the asset server and looking at the files loaded, but I think that's way too complex for what it's worth. metadata are probably the way to go, but adding them now to the Bevy repo means they will be available starting with the next release

mockersf avatar Feb 19 '24 13:02 mockersf