Comments (7)
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.
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.
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.
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.
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.
This issue is quite old. Any progress done?
from astexplorer.
See Also:
from astexplorer.
Related Issues (20)
- App crashes when data in localStorage references unexisting parser
- Feature request: jscodeshift output from arbitrary input
- Add support for semantic / tree-sitter HOT 1
- The Solidity parsers are outdated. There's a maintained alternative that should be used
- error when typescript with TSAsExpression HOT 1
- Update espree parser HOT 1
- [Feature request] Upgrade Hermes parser HOT 1
- Update Go parser with generics support
- Is Groovy Supported by astexplorer ?
- CodeMirror editor displays error on JavaScript class private fields HOT 1
- Update TypeScript version
- Unable to create snippet error
- Website freezes if Java Parser is selected with JSON view tab HOT 1
- [BUG] SWC spans are broken with multi-byte offsets and accumulating offsets
- python - "Unexpected token" error on ellipsis HOT 1
- [PROJECT BUG] When executing `npm install` in the `website` directory, an error is thrown HOT 3
- [PROJECT BUG] Module not found: Error: Can't resolve '@swc/wasm-web/wasm.js' in...
- Add a parseFragment option for parse5
- [Need] Is there any way to copy the specific property in the right board HOT 1
- Switch from Tree to JSON -> "An error was caught while rendering the AST. This usually is an issue with astexplorer itself." HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astexplorer.