You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short codes are error-prone to write, with a huge number of matching delimiters.
Short codes are very hard to read, due to their verbose syntax, arbitrary ordering and lack of support on Github and in IDEs. e.g. {rust_type(type="struct" crate="bevy" mod = "ecs/system" name="EntityCommands" no_mod = "true")}}.
Short codes are a strange DSL that new contributors to the book must memorize.
Short codes force authors to look up the fully qualified path each type.
Short codes require authors to explicitly state whether a given import is a struct, enum, trait or so on.
Type elision: {{bevy::ecs::system::EntityCommands}}
Explicit imports: list use bevy::ecs::system::EntityCommands at the top of the file, which is processed out, allowing the author to write struct{{EntityCommands}}.
Possible strategies
Fork Zola to add support for this.
Probably more immediately elegant.
Significantly more maintenance burden unless merged upstream.
Should only involve writing our own tera functions.
Best we can do is likely {{rs(name="App"}} due to tera limitations :(
Difficulties integrating with our CI.
Add a Rust preprocessor which modifies the .md files provided.
These are stored in the build directory and are not commited.
Begin with simple instructions to run the preprocessor before zola serve.
Eventually, wrap this in its own minimal CLI to support hot reloading and one-command builds.
Problem definition
{rust_type(type="struct" crate="bevy" mod = "ecs/system" name="EntityCommands" no_mod = "true")}}.struct,enum,traitor so on.Requirements
struct{{bevy::ecs::system::EntityCommands}}Bonus points
struct{{EntityCommands}}{{bevy::ecs::system::EntityCommands}}use bevy::ecs::system::EntityCommandsat the top of the file, which is processed out, allowing the author to writestruct{{EntityCommands}}.Possible strategies
{{rs(name="App"}}due to tera limitations :(.mdfiles provided.builddirectory and are not commited.zola serve.latestor doing a find-and-replace each Bevy version.