Comments (7)
With the spellchecker being removed idyll-lang/idyll-compiler#32, it would be a cool first test case for this to re-implement it as a plugin
from idyll.
One other realization: plugins would need to be async-capable. Use-cases abound.
- reading/inlining data files
- browserifying input js
- inlining image previews as low-res blurred data uri
- fetching remote data (e.g. fetching + inlining static tweet text, then hydrating with the twitter api on load, which seems to be the standard way people do it.)
- tons of others. basically any processing that can't be done synchronously in the SSR rendering of a react component
from idyll.
Or just thinking out loud, you there could be a visitor
interface where you're write:
visitors: {
'h1': function sectionVisitor (node) {
var name = node[2];
var anchor = parameterize(name);
node[1].push(['id', anchor])
this.sections.push({name, anchor});
}
}
Don't want to make it too elaborate, but seems like with a bit of glue code could enable a lot.
from idyll.
I like this a lot, it seems like it could be pretty powerful. What I haven't quite figured out is where this code would live, and how the user would interact with it. Take the example of a table of contents plugin - the plugin code itself presumably exists as a module that users can install, does that module also include a component that users then include in the markup?
Counterpoint - you could probably get a lot of this functionality by making smarter components, e.g. a References
component that knows every time a Cite
component is invoked
from idyll.
I like this project a lot and a support for plugins would be needed for my particular use case.
Will share some thoughts out loud too. I imagine the plugins would be able to hook into the build pipeline. There could be hooks for different stages like pre-parse, AST traversal, post-output, etc. User could include and configure plugins maybe via markdown front matter config.
Besides extending the pipeline I think it would be cool to be able to extend syntax rules. Good example is remarkable parser where rules can be extended. There are three kinds of rules: document-level (core), block-level, and inline-level. Plus there are render plugins to transform newly introduced AST types to markup.
For example I want to have special component for definitions. A component might look like this:
[Definition name:"Newton (unit)"]
One newton is the force needed to accelerate one kilogram of mass at the rate of one metre per second squared in direction of the applied force.
[/Definition]
But it gets quite chatty after a while. So more concise and pretty widely accepted extension of markdown for definitions looks like this:
Newton (unit)
: One newton is the force needed to accelerate one kilogram of mass at the rate of one metre per second squared in direction of the applied force.
I think syntax extensions would be killer. I think success of markdown is because it is a DSL for markup that does not get into ones way as the underlying markup does. So being able to extend the vocabulary for a particular domain seems like a great feature for me.
And now for my particular use case. I am working on a project kmdoc which is a system for writing down knowledge and presenting it in a interactive way. It also uses markdown with some extensions. However, it is quite old from the pre-React era, so I am thinking about revamping it. Building it on top of Idyll seems like a good fit. It would benefit from the toolchain and also better support of interactive widgets.
from idyll.
Thanks @dundalek, kmdoc looks like a cool project. I agree with the thoughts above that transformation plugins could enable a lot of cool things and we should probably add them.
Syntax extensions would probably require a bit of restructuring of the compiler, and I'm a little hesitant to add a sort of fragmentation issue to an already new syntax. I think in the short term its probably more likely that we would include something like definitions which are already well defined in some flavors of markdown directly in the compiler.
from idyll.
Added in #280.
from idyll.
Related Issues (20)
- Publish fails when project name has special characters HOT 5
- Graphic Annoations HOT 4
- Idyll crashes with JavaScript heap out of memory HOT 2
- Update react-table dependency in idyll-components to latest HOT 2
- Upgrade to React 17 HOT 1
- Incorrect link to editor in getting started docs HOT 1
- Insert em-dashes when there are three hyphens HOT 2
- Idyll does not build (Node 16 issue?) HOT 4
- Upgrade D3 dependency HOT 4
- Docs website error with JS enabled HOT 2
- Automatic reload running idyll in WSL: it seems not work HOT 4
- SSR option doesn't work if specified in `package.json`
- Babel/d3-array incompatibility issue in new Windows installs HOT 5
- Add support for Typescript based React components HOT 4
- Update the component dependencies and re test? HOT 2
- Error while building post in multipage setup
- Support for google analytics 4 HOT 3
- Idyll runs component code in Node, causing crashes HOT 1
- Scroller not working
- Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: on a fresh Windows 10 install HOT 1
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 idyll.