-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Option for the doc command to generate JSON. #2772
Comments
Hi there, so the idea is to generate JSON as an option so tools can consume it. What I would love to see is a JSON dump of every code object (class, module, method, constant, etc.) that was identified. For each of these code objects it would be great to see things like name, type, comment, possibly parameters etc. If there is anything else I could do to help, just let me know! 👍 |
That's exactly the idea :-) We should define the output format. Ideally it should provide all the information that the current If anyone wants to do this, let me know. The code for @fernandes Maybe you are interested in doing this? :-) |
Should the JSON be printed to STDOUT when using |
Most tools I have encountered handled it this way. I think, unless there are arguments against it, it offers great flexibility as you can pipe that output whereever you want. But I have to admit I don't know if there are downsides to this on e.g. Windows? edit: english is hard. |
I wouldn't worry about Windows right now, I think Crystal is still aways away before it'll run on Windows. |
@asterite I'm in! 😎👍 |
@fernandes please read issue history carefully, see #2777 |
@jhass 👍 |
@fernandes Sorry, I didn't think a PR was going to be made after just a few hours of opening this issue. @keplersj Awesome work! |
So there are two outdated PR's in this context: #2777 which adds an additional output type
I am not sure if these should better be addressed in three focused PR's where the first one is obviously a pre-condition for the other two (who are independent of each other). It is however debatable if the JSON serialization for both use-cases should actually be the same or needs an entirely different implementation. If the index file should only provide search for identifiers (types, constants, method signatures) it only requires a small subset of all available documentation data and would be relatively small in size. If it should also provide full text search, the actual documentation texts need to be present as well, but it is still focused on searchability and needs not be as detailed as for the json output type. /cc @rosylilly @keplersj |
#4746 has been merged with JSON output. It puts the JSON output alongside the HTML. |
A bit hasty on the close button there... |
@straight-shoota implemented on PR #6982 |
Refs rrrene/inch#38.
/cc @rrrene
The text was updated successfully, but these errors were encountered: