Git Product home page Git Product logo

Comments (9)

bgrins avatar bgrins commented on August 20, 2024

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.

thomasandersen avatar thomasandersen commented on August 20, 2024

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.

thomasandersen avatar thomasandersen commented on August 20, 2024

Screenshot of the extension (work in progress)
screen shot 2013-09-21 at 9 47 01 am

from devtools-snippets.

bgrins avatar bgrins commented on August 20, 2024

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.

bgrins avatar bgrins commented on August 20, 2024

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.

anaran avatar anaran commented on August 20, 2024

@bgrins @thomasandersen

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.

anaran avatar anaran commented on August 20, 2024

@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.

bgrins avatar bgrins commented on August 20, 2024

@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.

bgrins avatar bgrins commented on August 20, 2024

Would like to move this discussion into Issue #35, so closing this one.

from devtools-snippets.

Related Issues (18)

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.