There is no reference for the binding #12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
hate-no-d.luais the whole public API, but the only documentation is LuaCATS comments that aneditor shows one symbol at a time. There is no browsable page, so finding a function means
grepping the 11 000-line file or reading raylib's C docs and then guessing how the wrapper
remapped the arguments.
The generator already holds every function, struct, enum and define with its description. It
writes them into Lua and throws the model away. A second renderer over the same model can emit
one self-contained
hate-no-d.htmlat no extra parsing cost.Current behavior
gen-hate-no-d.luatakes a single output,--out. It buildsFUNCS(928 entries),STRUCTS(45),ALIASES(7),CALLBACKS(6), 32 enums with 421 values, and defines beforeemitting anything.
Coverage in the rlparser tables:
Parameter prose does not exist:
raylib.hcarries one comment per function and nothing perargument. The page documents parameter names and types and no more.
Two facts shape the design. First, the useful signature is the Lua one, not the C one: wrapper
signatures come from
out_params(),ann_param(),ann_return()andconversion_for().GetMousePosition()returns aVector2;LoadImage(fileName)returnsImage; callbacks andstring/table arguments are already normalised. Second, rlparser drops grouping, so the tablesalone produce a flat 928-line list.
Total text is ~85 KB. With inline CSS and JS the file lands at 250–400 KB, small enough to
commit and serve as-is.
Proposal
1. Add
--html=PATHOff by default, so
--outstays byte-identical andmake check-bindingskeeps passingunchanged.
gen-hate-no-d.lua --html=docs/hate-no-d.htmlwrites both files from one run.2. Reuse the model, not the output
Render from the same tables the Lua emitter uses, and call the existing annotation helpers for
signatures. Do not parse
hate-no-d.luaback: the model has module tags, struct field notes andenum value notes that the annotations flatten.
3. Recover categories from the headers
Group by section heading, using the pinned headers the build already reads:
raylib.h:// Window-related functions,// Image loading functions,// Text drawing functions, and module banners such as// Basic Shapes Drawing Functions (Module: shapes)rlgl.h/raymath.h:// Functions Declaration - Matrix operations,// Module Functions Definition - Vector3 math, ...Scan the header in order, remember the last heading, attach it to each
RLAPI/RMAPIdeclaration, and fall back to the module name when no heading precedes a function. This is a
heuristic, but it reads the exact headers the binding was generated from, so a raylib bump
cannot desynchronise it.
4. Shape of the page
#InitWindow,#struct-Vector2,#enum-ConfigFlags.file://.5. Escape in one place
Only 3 descriptions contain
&,<,>or", but every description, signature and field namemust go through a single
html_escape()helper. Reuseclean_description()for whitespace.6. Wire it into the build
check-docsmirrorscheck-bindingsand runs in CI next to it, so the page cannot fall behindthe binding.
What stays the same
hate-no-d.luaoutput, its ordering and its byte-for-byte check.make bindingsandmake all: no HTML unless--htmlis passed.io.Acceptance criteria
make docswritesdocs/hate-no-d.htmlfrom a clean tree with no network access.hate-no-d.luais listed exactly once.GetMousePosition()returnsVector2,ImageDrawPixeltakes plain numbers,LoadImagereturns an optionalImage.make check-docsfails when the page is stale and passes after regeneration.make check-bindingsstill passes, andgit diffaftermake docsis empty.Notes
RAYLIB_VERSION(currently6.5-dev). A dated footer would breakcheck-docs.not do. Leave them out rather than inventing text.
functions), so long header comments are already truncated at the source.
docs/, or a CIjob uploads
docs/hate-no-d.html. That choice belongs to the site, not to this issue.Makefile target, one CI step.