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

Machine-readable format #114

Open
viperML opened this issue Feb 29, 2024 · 4 comments
Open

Machine-readable format #114

viperML opened this issue Feb 29, 2024 · 4 comments

Comments

@viperML
Copy link

viperML commented Feb 29, 2024

Hello!

I am one of the moderators of the nixos discord (https://discord.gg/RbvHtGa), and we thought it would be nice to integrate noogle into a bot, so people can /search <function_name>

From what I get from the readme, noogle is build as a static webpage, so could it be possible to get a machine-readadable format (e.g. json) that we can embed into the bot?

Maybe this already exists, or could be possible to implement?

@hsjobeki
Copy link
Collaborator

Hey 👍
noogle's data roughly exists as a json file. There is a little more data, as other files, but maybe you can start with integrating the major dataset if you are interested:

nix build .#data-json

I'll look if i can provide a more unified output of all the data until then.

@viperML
Copy link
Author

viperML commented Mar 10, 2024

Is the detected type available in data-json ?

@hsjobeki
Copy link
Collaborator

hsjobeki commented Mar 10, 2024

Yes it is for most functions.

This is the internal data-structure behind entries in data-json
https://github.com/nix-community/noogle/blob/d364719ef1e9a402c934564fa824ee9792edadd5/pesto/src/main.rs#L166C1-L184C2

I have some pre-defined types for the builtins in a separate file as well: https://github.com/nix-community/noogle/blob/main/salt/src/builtins.types.json

If you want to work on providing a unified output of all the information, I am happy to help.

@viperML
Copy link
Author

viperML commented Mar 10, 2024

Ah yes, my bad. I skimmed the resulting json, and only read the functions for which signature was null.

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

No branches or pull requests

2 participants