Skip to content

Instantly share code, notes, and snippets.

@tlack
Last active December 11, 2015 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlack/4576631 to your computer and use it in GitHub Desktop.
Save tlack/4576631 to your computer and use it in GitHub Desktop.
Idea for CodePen plugins
Idea for CodePen plugins (by @tlack)
Step 1: Establish simple plugin architecture/API
```javascript
CP.Plugins.add({
context: CP.Html,
re: /fun ([a-z_][a-z0-9_]+)/,
callback: function(cpPluginContext, match) {
var str = "function "+match.$1+"() {\n// Comment\n\n}\n";
cpPluginContext.replace(str);
}
});
```
Step 2: Allow users to load their own plugin URLs for each pen
Allow users to specify a list of a couple Javascript URLs to load
for each pen. They'll be created as <script> tags.
Step 3: Allow the community to build the plugin ecosystem
Feature best plugins or at least encourage their creation.
Step 4: Expand API
Allow Intellisense-like plugins, on-save callbacks, etc etc..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment