示例#1
0
 def buildCss(self, site):
     u"""Build the site to CSS."""
     doIndent = self.getDoIndent() # Boolean flag if indenting should be in output.
     builder = CssBuilder(e=site.e, doIndent=doIndent)
     filePath = builder.getFilePath(site)
     result = self.resolveByFile(site, filePath)
     #if site.e.form[self.C.PARAM_DOCUMENTATION]: # /documentation
     #    site.buildDocumentation(builder) # Build the live documentation page from the site
     #    #builder.save(site, path=filePath) # Compile resulting Sass to Css
     #    #builder.save(site, path=filePath.replace('.css', '_doc.css')) # Compile resulting Sass to Css
     #    result = builder.css #getResult()
     if site.e.form[self.C.PARAM_FORCE] or site.e.form[self.C.PARAM_DOCUMENTATION] or result is None:
         # Forced or no cached CSS or building documentation,
         # so try to build is and save it in the cache.
         site.build(builder) # Build from entire site theme, not just from template. Result is stream in builder.
         builder.save(site, path=filePath) # Compile resulting Sass to Css
         result = builder.getResult() # Get the resulting Sass.
     return result, self.C.MIMETYPE_CSS