Coder Social home page Coder Social logo

Comments (7)

fkling avatar fkling commented on May 18, 2024 1

Current idea/plan: Create a script that can be loaded and which exposes an API that lets you render astexplorer into a given element. Something like:

<link href="path/to/astexplorer.css" />
<script src="path/to/astexplorer_embed.js"></script>
<script>
  astexplorer.render({
    parser: 'acorn',
    parserSettings: {
      // ...
    },
    code: '...',
   // transform: ...
   // etc.
  }, someElement);
</script>

That would make it easy to configure examples. For that I still have to do

  • Namespace CSS rules
  • Create embeddable entry script
  • Create API
  • Make parser settings settable from the outside (not only inside each parser).

from astexplorer.

olafurpg avatar olafurpg commented on May 18, 2024 1

I would love to be able to embed AST explorer on our website https://scalameta.org/docs/trees/scalafiddle.html We already embed a "ScalaFiddle playground" through an iframe to interact with our public APIs and it would be great if we could do something similar with AST explorer.

BTW thank you for AST explorer. It's been very helpful in educating our users how to implement refactorings for Scala source code.

from astexplorer.

ai avatar ai commented on May 18, 2024

Here is my talk about CSS isolation if you will think about React component: http://ai.github.io/postcss-isolation

Selectors isolation from Inline Styles is not enough.

from astexplorer.

RReverser avatar RReverser commented on May 18, 2024

IMO iframe is the best (time-proven + framework-agnostic) way to resolve this, but need to work out the details - how it will look like, what can be customized etc.

from astexplorer.

hzoo avatar hzoo commented on May 18, 2024

Would be great to get the babel repl to use it (although we want to be able to specify external presets/plugins and options)

from astexplorer.

LunaticMuch avatar LunaticMuch commented on May 18, 2024

This issue is quite old. Any progress done?

from astexplorer.

0xdevalias avatar 0xdevalias commented on May 18, 2024

See Also:

from astexplorer.

Related Issues (20)

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.