ai2html icon indicating copy to clipboard operation
ai2html copied to clipboard

Script/CSS to external files

Open brianjacobs-natgeo opened this issue 3 years ago • 2 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.

brianjacobs-natgeo avatar Oct 15 '20 14:10 brianjacobs-natgeo

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';

martgnz avatar Oct 15 '20 15:10 martgnz

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

brianjacobs-natgeo avatar Oct 15 '20 18:10 brianjacobs-natgeo