bevyengine / bevy-website

The source files for the official Bevy website
https://bevyengine.org
MIT License
193 stars 330 forks source link

Show example shader code in a separate code block #456

Closed IceSentry closed 2 months ago

IceSentry commented 2 years ago

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.

BD103 commented 7 months ago

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"]
IceSentry commented 7 months ago

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

mockersf commented 7 months ago

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