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

Feature Request: CLI tool to generate a static website given a schema #74

Open
AbdulRahmanAlHamali opened this issue May 31, 2019 · 9 comments

Comments

@AbdulRahmanAlHamali
Copy link

Hello,

Thank you for the tool. It produces the best schema docs out there!

But I have a problem: I don't want my doc website to accept a schema as a parameter and then generate its doc dynamically. Instead, I want to have some CLI tool (nodejs tool maybe?) that accepts the schema, and generates a static website out of it. Would there be a way to refactor your code to make it do just that? I don't think it is too much of a hassle, what do you guys think?

one other option that does not require refactoring is to have a (docker image maybe?) that hosts the app on some server, and then communicates with it using Selenium (web browser simulator) and provides it with the Schema, then stores the generated page as a static website.

The reason why I am interested in a static page is that I have a humongous schema, and the tool takes about 5 seconds to generate it each time a user opens the docs. But if it were static, it would have been much faster.

@yanick
Copy link
Collaborator

yanick commented May 31, 2019

I'll have a look after the week-end. I would also think that there should be a way to do that via run-the-app-and-grab-output-via-Selenium/Puppeteer, but I'll have to verify that hypothesis. :-)

@AbdulRahmanAlHamali
Copy link
Author

alright thank you Yanick, have a good weekend!

@jcbedard
Copy link

jcbedard commented Jun 4, 2019

any news on this? This would be the most useful thing. Currently, it takes upwards of 10 seconds just to load the schema docs page. To be able to generate it and have a static version for people to look at would be fantastic.

@yanick
Copy link
Collaborator

yanick commented Jun 4, 2019

I kind of mulling over porting the core of docson to either Vue or React. If I do that, it'd become pretty easy to produce pre-generated versions of the schema via nuxt / next.

Hmm... I'll try to cut a next branch today, and poke around to see how much work that'd be.

@kaflake
Copy link

kaflake commented Jun 5, 2020

Is there anything new about this request? I am also interested in this feature.

@yanick
Copy link
Collaborator

yanick commented Jun 5, 2020

There is! ... after a fashion.

There is a very early, not working yet new project https://github.com/yanick/jsonschematic that is meant to be inspired by docson, but written in Svelte. If that project gets off the ground, that will make things like offline rendering much easier.

@AbdulRahmanAlHamali
Copy link
Author

There is also another library:
https://github.com/coveooss/json-schema-for-humans

Which we use at work, and it is working great so far :)

@yanick
Copy link
Collaborator

yanick commented Jun 13, 2020

Oooh. Thanks for pointing json-schema-for-humans! I've added a SIMILAR TOOLS sections to the README, and seeded the section with that link.

@kaflake
Copy link

kaflake commented Jun 18, 2020

Thank you for the answers. json-schema-for-humans work perfect for me.

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

4 participants