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

Provide some kind of render callback API #31

Open
tdauth opened this issue Mar 21, 2023 · 0 comments
Open

Provide some kind of render callback API #31

tdauth opened this issue Mar 21, 2023 · 0 comments

Comments

@tdauth
Copy link

tdauth commented Mar 21, 2023

Hi,
I am using a heavily modified version of this since I render stuff different depending on the context of the JSON.
Somtimes I want to change values to customized URLs.
Sometimes I want to fold stuff by default.

Maybe support a generic render API like:

function customRenderer(json, options) {
return {
    rendered: json2html(json, options),
    collapsed: json instanceof Array,
};
}

where o is the currently traversed json key and value.
By default you do not have to register this renderer but you can do it by passing it to the options or something.

This would reduce the number of forked repositories since users can heavily modify this viewer without changing the actualy code.

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

1 participant