title: How do I use Google Apps Script to change a CSS page to one with inline styles?
body: <p>Background...</p>
  
  <p>I am trying to write a Google Apps Script to get the content of a Google Doc as HTML and use that HTML to create or update a web page in Google Sites.   I already know how to do this but the result is a web page that is stripped of almost all of its formatting.  After looking at the html from the Google Doc, I see that it is not using inline styles and I believe that Google Sites requires inline styling.   </p>
  
  <p>Anyone have a Google Apps Script that I can use to convert the CSS to inline styles before using it to create a Google Sites page?  Also, a library that I could use within the Google Apps Script environment that would give me the same functionality would be just as good. It just needs to be a library that I could add within the Google Apps Scripting environment (i.e., through the "resources" - "manage libraries" menu).  Thanks.</p>
  
  <p>By the way...</p>
  
  <p>I have tried getting the html from a Google Doc in two ways.  Both ways give me the same CSS non-inline-style that gets stripped out when I use it to create a Google Sites Page.</p>
  
  <p>1) I have used Romain Vialard's DocsListExtened Google Script Library at the following link...</p>
  
  <p><a href="https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/driveservice" rel="nofollow">https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/driveservice</a></p>
  
  <p>2) I have used code suggested by a few people including hgabreu@gmail.com, and others at...</p>
  
  <p><a href="https://code.google.com/p/google-apps-script-issues/issues/detail?can=2&amp;start=0&amp;num=100&amp;q=&amp;colspec=Stars%20Opened%20ID%20Type%20Status%20Summary%20Component%20Owner&amp;groupby=&amp;sort=&amp;id=585" rel="nofollow">https://code.google.com/p/google-apps-script-issues/issues/detail?can=2&amp;start=0&amp;num=100&amp;q=&amp;colspec=Stars%20Opened%20ID%20Type%20Status%20Summary%20Component%20Owner&amp;groupby=&amp;sort=&amp;id=585</a></p>
  
  <p>Note: the same problem affects html email messages sent to gmail users.</p>