Giter Site home page Giter Site logo

Comments (9)

nalgeon avatar nalgeon commented on May 18, 2024

Anton, thanks for your interest! Do you want me to prepare a dedicated Expr sandbox so you can use it in the Getting Started guide and other parts of the documentation?

As for go.dev/play, I don't think it supports installing modules. Quoting the docs:

The playground can use most of the standard library, with some exceptions. The only communication a playground program has to the outside world is by writing to standard output and standard error.

Installing arbitrary modules in the sandbox would be too slow (and insecure).

from codapi.

antonmedv avatar antonmedv commented on May 18, 2024

Here is an example of playground: https://go.dev/play/p/XCoNXEjm3TS
It installs github.com/expr-lang/expr inside it.

If you could add support for Expr it will be super cool =). I can use it in https://expr-lang.org/docs/language-definition

from codapi.

nalgeon avatar nalgeon commented on May 18, 2024

It installs github.com/expr-lang/expr inside it.

Ouch, I was not aware of this feature! Still, I'd rather not allow arbitrary modules (yet).

I'd love to add Expr support, though! In fact, I have already done so (the name of the sandbox is expr-lang).

I think you can use this sandbox both for full-blown Go examples (on the Expr Home and Getting Started pages) and for expression evaluation (Language Definition page).

I've prepared some examples:

I'd send you a PR, but it seems you're using Docusaurus, and I couldn't find the documentation build config or tasks in the Expr repo to check everything locally (integration with Docusaurus can be tricky sometimes).

from codapi.

antonmedv avatar antonmedv commented on May 18, 2024

Oh! Awesome! Yes, docusaurus site is in private repo right now. Will try to integrate those today.

from codapi.

nalgeon avatar nalgeon commented on May 18, 2024

Awesome! Let me know if you have any questions in the process.

As you probably know, Docusaurus' "markdown" is not really markdown (it is handled as a React component).

So it does not play well with web components (which the Codapi widget is) or templates.

Please see this guide for using Codapi with Docusaurus.

If you're testing on localhost, port 3000 is allowed to access Codapi.

from codapi.

nalgeon avatar nalgeon commented on May 18, 2024

@antonmedv Any luck integrating Codapi? I'm happy to help if you have any questions.

from codapi.

antonmedv avatar antonmedv commented on May 18, 2024

I was able to integrate it, but I need to figure out a better editor for expr.

from codapi.

nalgeon avatar nalgeon commented on May 18, 2024

Codejar maybe? It's a perfect fit for interactive examples, IMHO. I use it on the codapi website.

from codapi.

nalgeon avatar nalgeon commented on May 18, 2024

Okay then. Let me know if you have any questions.

from codapi.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.