Comments (9)
Any particular format you are looking for? Right now there isn't a way to go to/from browsers. You could always grab them as a zip here: https://github.com/bgrins/devtools-snippets/archive/master.zip.
from devtools-snippets.
I have been looking around to see if there exists a snippets format, but it seems like most applications use their own.
Visual Studio was the only one that I found til now that have some documentation for their format,
http://msdn.microsoft.com/en-us/library/ms165394.aspx
Maybe there should be a snippets XML format? I think it would benefit the project
Edit: My personal motivation is that I want to import snippets to an firebug snippet manager extension I am trying to create.
Right now snippets are automatically imported from a local file on first run/init.
The format that is used is just something that is cooked up for personal use and is manually created
The format is simple but works for personal use
<snippets>
<snippet name="TEXT">
<code>
<![CDATA[
// var b = 3>1;
]]>
</code>
I could create a script for that generated the XML, but it would be nice if it belonged to this project
What do you think?
XML is used as it is relatively easy to transform and the CDATA type makes it easy to transport formatted code
from devtools-snippets.
Screenshot of the extension (work in progress)
from devtools-snippets.
That looks interesting, definitely let me know as you get the Firebug extension released so we can add it to the list of instructions. I think it may be worth trying to come up with a format to import / export snippets together. As I mention here: http://www.briangrinstead.com/blog/devtools-snippets in "Future Functionality", I think import/export from a list of URLs could be an easy and cross-browser way to move them to and from different devtools. So, you could paste in:
https://raw.github.com/bgrins/devtools-snippets/master/snippets/performance.js
https://raw.github.com/bgrins/devtools-snippets/master/snippets/log.js
https://raw.github.com/bgrins/devtools-snippets/master/snippets/base64.js
and each devtools would import all three snippets. Alternatively, if there was some sort for snippets import format, you could just paste in:
https://raw.github.com/bgrins/devtools-snippets/master/all_snippets.[xml|json]
and it would pull all of them down automatically.
from devtools-snippets.
A simple list of URLs where different devtools can just pull them down one by one and create a snippet with the last portion of the URL as the name has the added bonus of not needing to specify a format that all the different tools agree upon. The downside is that it would be harder to export them.
An alternative would be to create a simple transfer format, or just allow upload of a zip file that contains all the snippets you want in the root folder. Either of these would make export easier.
I'm interested if @paulirish knows of any plans or has any ideas about how snippets could be easily imported / exported. I will discuss with Firefox DevTools folks as well to see if there is any kind of consensus.
from devtools-snippets.
An alternative would be to create a simple transfer format, or just allow upload of a zip file that contains all the snippets you want in the root folder. Either of these would make export easier.
How about
https://github.com/anaran/devtools-snippets/tree/master/snippets/devtools_import_export#step-9
for a straight-forward transfer format?
It's a backup of all of devtool's localStorage at the same time.
from devtools-snippets.
@thomasandersen Have you considered JSON in context of #32 (comment) at all?
JSON.stringify
and JSON.parse
make this format so much more accessible in the context of JavaScript.
from devtools-snippets.
@thomasandersen How is the Firebug extension coming? Also, if you'd like to take a look at the import/export proposed in Issue #35 and join the discussion, please do.
from devtools-snippets.
Would like to move this discussion into Issue #35, so closing this one.
from devtools-snippets.
Related Issues (18)
- Add prominent link to repository and improve styling on http://bgrins.github.io/devtools-snippets/ HOT 1
- jquerify - Bump jquery CDN link to 2.0.3 HOT 2
- Mention Firefox Scratchpad as well HOT 5
- Is that possible to store snippets in files and load into Chrome? HOT 12
- Some suggestions HOT 8
- Reorganize project layout HOT 2
- Update README to reflect that snippets are now in stable releases HOT 1
- Automate run of snippet HOT 2
- Update 'all on one page' snippets HOT 6
- Keyboard Shortcuts? HOT 5
- Enhanced formcontrols.js HOT 2
- console.save in android HOT 1
- Export/import window not popping up upon running the snippet HOT 2
- After console.save, the HTML element disappears from the console
- Code is under Copyright - license information missing
- Code Snippets Sync
- List all undefined CSS classes
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 devtools-snippets.