Unibeautify / website

Webpage for Unibeautifier
https://unibeautify.com/
MIT License
10 stars 28 forks source link

Individual pages for options #64

Closed stevenzeck closed 6 years ago

stevenzeck commented 6 years ago

The individual pages for options is getting to be quite large, even with expand/collapse sections. A few thoughts:

Glavin001 commented 6 years ago

Consider having just a single example for an option, rather than one for all languages.

Definitely agree! I am looking to use something like https://github.com/facebook/Docusaurus/issues/103 so we can have a single code block and multiple languages to select from.

Consolidate all the languages that don't have an example into a comma separated list

This is a very good idea which does not require https://github.com/facebook/Docusaurus/issues/103 or similar to be implemented. Pull Requests welcome! 😃

stevenzeck commented 6 years ago

Or just a dropdown. Wrap the language example in a <div> that is hidden until the dropdown is changed to it. I don't know if that's possible with the Docusarus structure, but would probably be the best looking. Too many languages for a simple toggle like their parse docs page.

<div id="c-sharp-example" class="hidden">
### C#
<a class="edit-page-link button" href="https://github.com/unibeautify/website/new/master/docs/../examples/C%23/new?filename=multiline_ternary.txt&value=Type%20Example%20Here" target="_blank">Add C# Example</a>
</div>
stevenzeck commented 6 years ago

Best way to implement this? I have POC https://github.com/szeck87/website/tree/options-page-examples that is quite messy. I think ideally it would be it's own React component, with a <select> list that controls the content of a <div> or any other HTML block, similar to the playground https://github.com/Unibeautify/playground/blob/master/src/Playground.tsx.

Glavin001 commented 6 years ago

I don't see a way to call React components from Markdown: https://docusaurus.io/docs/en/doc-markdown.html May need to build a custom page like https://github.com/Unibeautify/website/blob/master/website/pages/en/index.js however I would prefer to keep this as simple as possible.

stevenzeck commented 6 years ago

OK, should I just PR what I have here? Not sure what else to do except maybe some style changes to the dropdown.

Glavin001 commented 6 years ago

Sure, then I can use Netlify preview to test it out. 👍

stevenzeck commented 6 years ago

When React components are available to use in markdown, https://github.com/facebook/Docusaurus/issues/489

Glavin001 commented 6 years ago

This would be awesome! 🎉

stevenzeck commented 6 years ago

Closed by #66