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

Should supply a more clear API doc #44

Closed
navigator117 opened this issue May 25, 2017 · 9 comments
Closed

Should supply a more clear API doc #44

navigator117 opened this issue May 25, 2017 · 9 comments

Comments

@navigator117
Copy link

navigator117 commented May 25, 2017

Should supply a more clear API doc

@navigator117 navigator117 changed the title Should supply a more clear api docs Should supply a more clear api doc May 25, 2017
@navigator117 navigator117 changed the title Should supply a more clear api doc Should supply a more clear API doc May 25, 2017
@mikkelfj
Copy link
Contributor

mikkelfj commented May 27, 2017

could be better, but it is not a priority - if someone wants to contribute I'd be happe to set something up with http://www.mkdocs.org or similar. At the very least you need to specify which parts of the API you are concerend with. The untyped builder API in flatcc.h is documented only in the header file, and I believe this is an adequate level.

For the generated code, there is room for improvement with lots of examples etc. but it is also a signficant amount of work. The primary monster_test.c file is intended to provide working examples.

@navigator117
Copy link
Author

navigator117 commented Jun 6, 2017

As it's too many macros in flatbuffer_common_builder.h and flatbuffer_common_reader.h, It's hard know which function I can use for what type defined in schema file. doc/builder.md can help but not more.

@mikkelfj
Copy link
Contributor

mikkelfj commented Jun 6, 2017

Yes, it can be a bit confusing. How do you propose to improve on this?

@navigator117
Copy link
Author

How about use gcc -E -P like feature to expand the macro, or, add comments to functions in generated builder.h/reader.h files, and propose the best practice functions set in these comments?

@mikkelfj
Copy link
Contributor

mikkelfj commented Jun 6, 2017

gcc macro expansion would expose a huge number of internal macros that would not be helpful.

builder.md does document some or most generated macros, such as flatbuffer_string_vec_len but does not explicitly name them all. There are many very similar methods. builder.md also does not discuss reader only macros but they are hinted at in the README. This could be more consistent.

Also note that it isn't really macros. The macros are used to generate type safe inline functions similar to how C++ templates work.

I think the solution is the make README smaller and have documention like builder.md cover both read and write, and add more examples and list more supported functions as a reference section. But again, this is a fair amount of work.

If you, or someone else, is willing to compile a reference.md file of functions, I'd be happy to fill in the gaps and advice on how to extract information.

@mikkelfj
Copy link
Contributor

mikkelfj commented Jun 6, 2017

Apart from offloading work, it would be good if someone else wrote some documentation because things that are clear to me may not be clear to others.

@mikkelfj
Copy link
Contributor

mikkelfj commented Jul 1, 2017

At least there is now a table of contents in the README and in doc/builder.md and benchmarks have been moved to a separate file.

@mikkelfj
Copy link
Contributor

mikkelfj commented Jun 12, 2018

@mikkelfj
Copy link
Contributor

Closing this as the provided script works pretty well, although not perfect.

Note that string operations like flatbuffers_string_ can also be extracted with the tool.

You still have to manually specify what you need documentation on, but it also allows you to drill down to very specific operations like vector push etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants