jkphl / grunt-iconizr

SVG + PNG icon kit generator — Grunt plugin wrapping around node-iconizr that creates a CSS icon kit from a bunch of SVG files, serving them as SVG / PNG sprites or embedded data URIs along with suitable CSS / Sass / LESS / Stylus etc. stylesheet resources and a JavaScript loader for easy integration into your HTML documents
http://iconizr.com
MIT License
104 stars 9 forks source link

Unable to get inline sprite building, or inline preview working #16

Open peteobrien opened 10 years ago

peteobrien commented 10 years ago

Probably something stupid I'm doing but what should the value of render option be to get inline svg? I can't seem to generate sprite.inline.svg Nor when specifying html:true am I getting any sprite.html. have tried a mixture of things but not getting it working yet

grunt.initConfig({
    iconizr: {
      your_target: {
        src: 'src/svg',
        dest: 'src/iconizr',
        options: {
          render: "inline",// tried 'html', 'inline', 'inline.svg'
          'inline.svg': true,// tried with and without this
          html: true,
          preview: "preview",
        },
      },
    },

In case it's related in the sprite-preview.html generated, the icons don't appear (but in the other preview files they do) screen shot 2014-09-26 at 7 53 22 pm .

jkphl commented 10 years ago

Hey @peterobrien,

I think you got some mess in your configuration ... just a few hints to get you going:

Good luck! Cheers, Joschi

peteobrien commented 10 years ago

Thanks for the hints Joschi. Unfortunately I still can't seem to get it to generate sprite.inline.svg nor the generated html example of using inline.

Are the defs added by the iconzr/svg-sprite generator? I assumed they get added by the generator but since no sign of them I've tried adding them to individual svgs but the ids get removed from the containiner g element anyway.

If you could highlight any error in the below configuration that'd be much appreciated (I have read the links you mentioned above but can't see the mistake)

iconizr: {
      your_target: {
        src: 'src/svg',
        dest: 'src/iconizr-output',
        options: {
          render: {
            'inline.svg': true,
            html: true
          },
        },
      },
    },

Thanks, Peter

peteobrien commented 10 years ago

I've uploaded a super simple test case to here https://github.com/peterobrien/InlineSvgViaGruntIconizrTestcase.git and added the grunt-iconizr generated assets. Is it something simple I'm missing?

jkphl commented 10 years ago

Hi @peterobrien,

due to MASSIVE workload I will not be able to respond at least until end of this week, sorry. Please hold on!

Cheers, Joschi

peteobrien commented 10 years ago

Thanks Joschi, hope the week's work goes well. Appreciate your efforts with this project.

peteobrien commented 10 years ago

Hi Joschi, not sure how your workload is but if you have a min to have a look at this would be grateful.

Thanks, Peter

Ramblurr commented 10 years ago

I'm experiencing this bug too.. I can't get the inline svgs working at all.

jkphl commented 10 years ago

Hi @peterobrien, hi @Ramblurr,

I'm sorry but my workload is still extreme. I'm organizing 2 events next week, including a 2-day conference, I'm hardly sleeping these days and this won't change for another 2 weeks I guess. I'm afraid I won't have time for working on any of my side projects until the end of this month.

On the other hand, this is also a contribution platform — maybe anyone else up for looking into this in the meantime?

Cheers, Joschi

peteobrien commented 10 years ago

Cheers Joschi. If I've the time will take a look myself although am short on it also (young children, work etc) and haven't written any node modules either so will require a bit of learning too.

That conference you're organizing looks very cool. Good luck with it!

jkphl commented 10 years ago

Thanks for your understanding, @peterobrien!

peteobrien commented 10 years ago

Of course @jkphl, this plugin is great. Maybe you should reopen the issue though.

jkphl commented 9 years ago

Hi @peterobrien & @Ramblurr,

just wanted to let you know that I'll start rewriting iconizr from scratch in the next couple of days. I released an all-new version of svg-sprite a couple of days ago, which is the base of iconizr and supports several inline sprite variants now. Please stay tuned, this might (and hopefully will) solve your problems.

Besides that, Happy New Year! :)

Cheers, Joschi