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

codemeta generation tool #14

Open
cboettig opened this issue Oct 18, 2018 · 2 comments
Open

codemeta generation tool #14

cboettig opened this issue Oct 18, 2018 · 2 comments

Comments

@cboettig
Copy link
Member

Hey @amoeba,

Thanks for the pointers on javascript and React-JS. I've adapted your minimal example into an prototype for users to generate codemeta.json files (and integrated it into the Hugo styling of the site):

https://codemeta.github.io/create/

Main source file is added in as a shortcode, (though should probably go directly into content/create.html) . Reads a very incomplete json-schema file from static/schema.json since I thought it made sense to separate that out (technically still a js file and not a json file, guess i should fix that too).

The layout of the form does take up a lot of space, so not sure if it will ever make sense to support all possible codemeta fields. The styling is a bit subtle at the moment -- the box color bar will go from purple (the theme color) to red if you type a non-URI into url or codeRepository.

I hacked in the method to download a codemeta.json file by myself (thanks stackoverflow really, but still my first time writing javascript 🐱, so it may very well be terrible...

Also, I didn't see a way to have fields like @type and @context elements be automatically pre-populated in the output JSON but not visible in the form part. Currently it doesn't use any custom uiSchema styling, maybe there's a "hide" option?

Anyway, let me know what you think!

If I can polish this up a bit and add enough fields to actually be somewhat useful (e.g. author / contributor roles) I think this could make a nice easy entrypoint for getting started with codemeta.

thanks again for getting me rolling on this!

@amoeba
Copy link

amoeba commented Oct 18, 2018

That looks great, glad it ended up working out for you.

Currently it doesn't use any custom uiSchema styling, maybe there's a "hide" option?

I wonder. I haven't looked at that but I see why you'd want it. I can think of three or four different ways you could do this. I'll take a look some time in the next couple of weeks.

@cboettig
Copy link
Member Author

@amoeba Thanks! I did find a hidden option in the uiSchema , turned out to be super simple after all. (The FAQ confused me by mentioning that show/hide is not implemented; but apparently that's referring to toggling show/hide for fields, which might also be useful at some stage...)

I probably need to delve into how to customize the HTML look of the elements more at some stage, that looks more intimidating.

Looks like we could easily pre-populate things like programmingLanguage and License fields if necessary, though not sure how helpful that would be...

Also @mbjones isn't a fan of the purple so I may need to swap in a new bootstrap color palette...

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