-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add method to GetClassID #275
Conversation
If you want to extend a built-in class you need it's class ID and there is no robust way to get that without this accessor. Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
Isn't 0 a valid class ID? |
No class IDs start at 1 (well actually higher) AFAIK |
https://github.com/quickjs-ng/quickjs/blob/master/quickjs.c#L118 Class IDs explicitly start at 1 |
If it helps, I am happy to define a constant for INVALID_CLASS_ID Honestly this whole project could use a lot more documentation (I would be happy to add more comments to header for stuff if that's desirable) |
I like this idea!
Yes indeed. I started working in it but I need to get back to it. The idea is to get some scaffolding going so we can then gradually add more. |
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
Whoot! Done 😄
Are you talking about Doxygen? Honestly just comments in the header would be fine for me, but I understand other may prefer a web browser for docs. |
I'm leaning towards Docusaurus indeed. |
Looks good indeed from the comments and it would be nice to use quickjs instead of node to run it and construct the website, but given the number of module dependencies, this seems impossible :) |
You would have to use doxygen to output XML then convert that into markdown or whatever format docusarus likes |
https://github.com/sourcey/moxygen looks like a interesting project |
You need Node indeed. The idea is not to auto-generate docs, but to write comprehensive documentation. The header file could indeed have a concise version. |
Not that I have really any weight in the matter, but I recommend checking out https://diataxis.fr/ if you're not familiar. There are 4 main use cases for technical documentation. Tutorials, How tos, conceptual, and reference. I think conceptual isn't needed because there is plenty of good existing documentation on how javascript works conceptually. I think a tutorial and some how-tos on how to embed quickjs would be awesome (also personally what I've been trying to figure out). That's all great content for Docusaurus. There is a way to just do this all in Github, not that I'm advocating for that. For example, the examples today don't show how to embed quickjs - it'd be nice to have some simple tutorial/how to for that. There is still a need for reference documentation, which for C is best (IMO) put in the header (you can also generate it, but I am not sure that's worth it). As I've needed and been learning about quickjs I'll send small patches for better documentation in quickjs.h - I hope that's OK. But certainly they all are useful. |
If you want to extend a built-in class you need it's class ID and there
is no robust way to get that without this accessor.