newsdev / ai2html

A script for Adobe Illustrator that converts your Illustrator artwork into an html page.

Home Page:http://ai2html.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Script/CSS to external files

brianjacobs-natgeo opened this issue · comments

Hi, I'm curious about this: have there been any efforts to write scripts/css to files rather than inlined? Seems pretty doable within generateOutputHtml but wondering if there's any obvious gotchas before going down this road.

Hi Brian, it is certainly possible and it would be nice to have the option upstream.

I have done something like this in generateOutputHtml:

saveTextFile(htmlFileDestinationFolder + 'style.css', css);

And then don't forget to add a comment block referencing your stylesheet:

commentBlock += '\t<link rel="stylesheet" href="style.css" />\r';

Thanks. Along those lines worked. I'm importing the css/js files elsewhere so I dont want to add the reference to the files directly in the comment block.

What was also important: removing <script> and <style> tags before saving the content into their own files