Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified documentation Frontend + Backend #109

Open
makspll opened this issue Apr 5, 2024 · 0 comments
Open

Unified documentation Frontend + Backend #109

makspll opened this issue Apr 5, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@makspll
Copy link
Owner

makspll commented Apr 5, 2024

Ideally we could have a unified documentation data definition language, which would describe the provided API for a provider.

We could then have different frontends which interpret that data for a target language.

As an example:

  • Lua provider exports global "world" which is of the kind "Wrapper" around the type "bevy::ecs::World"
  • It provides a method called "get_type_name" which accepts a String argument
  • It generates a definition for it:
{
 "id": "1"
 "kind": "global",
 "type_kind": "Wrapper",
 "type": "bevy::ecs::World",
 "functions": [
   {
     "name": "get_type_name"
     "args": [
       {
        "type_kind": "Primitive",
        "type": "String"
       } 
     ]
   }
 ]
}
  • this definition is then interpreted by a LuaHTMLFrontend
  • Knowing how wrappers and primitives are handled in the Lua case, the generator produces html docs including a page for the world item
  • If the provider cannot express a certain type, it can fall back on some sort of plain default description (but this shouldn't happen, for compatibile backends and frontends)
  • This can be done at compile time thanks to bevy_api_gen, we can search the codebase for either custom attributes to generate the doc definitions, and they can also be produced manually for hand-written types
@makspll makspll added this to the 2024 Goals milestone Apr 5, 2024
@makspll makspll added the enhancement New feature or request label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant