json-ld / json-ld.org

JSON for Linked Data's documentation and playground site
https://json-ld.org/
Other
853 stars 152 forks source link

specify JsonLdOptions in playground #767

Closed James2516 closed 2 years ago

James2516 commented 2 years ago

How do I specify JsonLdOptions on https://json-ld.org/playground/? Eg. I want to set compactArrays to true.

davidlehn commented 2 years ago

I just added the feature. Click on the checkbox in the "Options" tab.

Note that compactArrays already defaults to true. Did you mean you wanted to set it to false? Or was it maybe some other issue?

gkellogg commented 2 years ago

A couple of other options the Distiller has are extractAllScripts (probably not appropriate for the playground), useNativeTypes, lowercaseLanguage, rdfDirection, omitDefault, requireAll, and explicit.

davidlehn commented 2 years ago

A couple of other options the Distiller has are extractAllScripts (probably not appropriate for the playground), useNativeTypes, lowercaseLanguage, rdfDirection, omitDefault, requireAll, and explicit.

PRs welcome. ;-)

A whole new version is needed, just trying to hack in easy features here.

@gkellogg As I was adding that feature I couldn't figure out how the Distiller compactArrays checkbox worked. It's not checked by default, but I assume true by default? And checked or not, the result of compaction seems to look the same. Maybe I missed something.

gkellogg commented 2 years ago

It probably doesn't work very well. I don't quite remember how defaults are used in the UI. In the CLI, which it is based on, it would be --no-compactArrays, but how it was translated I don't recall.