Glavin001 / atom-preview

:construction: (NO LONGER MAINTAINED) :construction: - :eyeglasses: Ultimate previewer of source code in Atom.
https://atom.io/packages/preview
MIT License
51 stars 23 forks source link

Allow dummy data to generate Jade previews #101

Closed daniloborges closed 9 years ago

daniloborges commented 9 years ago

My templates have some local variables checks that are breaking the preview. It would be cool if I could use some dummy data, so the preview will work and I'll have a better idea of the future HTML. Example:

    unless env.production
      script(src="//localhost:3001/livereload.js")

Gets: TypeError: Cannot read property 'production' of undefined on line ...

It could be a .json file with the same name of .jade in the same folder. It'll be something like:

{
   "env": {
      "production": false   
   }
}

After, maybe, we could do something more advanced like a global index.json that will be merged with this file.json; some comment in .jade like: //-dummydata: file.json and/or //-dummy: env.production = false

Glavin001 commented 9 years ago

Definitely want to be able to do this. #36 already exists and will take care of that. However I do not have much time to implement it.

I'd recommend discussing your ideas on #36 and what kind of needs you may have. For instance, needing each file to have dummy data or have one dummy data global for each project?