accordproject / techdocs

Accord Project Documentation
Apache License 2.0
61 stars 134 forks source link

Move the Ergo online REPL to Docusaurus #168

Open jeromesimeon opened 5 years ago

jeromesimeon commented 5 years ago

The Ergo online REPL is currently available at: https://ergorepl.netlify.com

It might be more useful as a kind of "Fiddle" https://jsfiddle.net and linked to the technical documentation here: https://docs.accordproject.org

Since we are using Docusaurus, a possibly nice way to do it could be similar to the ReasonML web site: https://reasonml.github.io and its "try" button!

jeromesimeon commented 5 years ago

The Ergo REPL can now support generateText so it could form the basis for a kind of Try It! button in the documentation which would cover both Ergo logic and the new template syntax.

This could require a bit of design thinking (what would it look like? should it use Monaco for editing, reuse Cicero-UI components). Maybe the "Try It!" button could be added to Ergo code snippets:

Screenshot 2019-10-11 at 9 41 19 AM

Or to templates grammar examples:

Screenshot 2019-10-11 at 9 43 47 AM
jeromesimeon commented 5 years ago

Another example is the handlebars documentation with the Open in Interactive Playground! button

https://handlebars-draft.knappi.org/guide/expressions.html#basic-usage

jeromesimeon commented 5 years ago

This could be particularly nice with a notion of plugin. Vuepress supports that (that's what Handlebars uses), but it seems to also be coming to Docusaurus v2:

https://v2.docusaurus.io/docs/advanced-plugins

See also issue #160

jeromesimeon commented 5 years ago

Another example is the handlebars documentation with the Open in Interactive Playground! button

https://handlebars-draft.knappi.org/guide/expressions.html#basic-usage

That button keeps changing. It's now called "Template" or "Input" etc. with a "Click to try out" hover.