parameters: ()
docstring: Render HTML templates and compile assets.
docstring_summary: Render HTML templates and compile assets.
docstring_tokens: Render HTML templates and compile assets .
function: def render():
      """
      Render HTML templates and compile assets.
      """
      from flask import g
  
      update_copy()
      less()
      jst()
  
      app_config_js()
      copy_js()
  
      compiled_includes = []
  
      for rule in app.app.url_map.iter_rules():
          rule_string = rule.rule
          name = rule.endpoint
  
          if name == 'static' or name.startswith('_'):
              print 'Skipping %s' % name
              continue
  
          if rule_string.endswith('/'):
              filename = 'www' + rule_string + 'index.html'
          elif rule_string.endswith('.html'):
              filename = 'www' + rule_string
          else:
              print 'Skipping %s' % name
              continue
  
          dirname = os.path.dirname(filename)
  
          if not (os.path.exists(dirname)):
              os.makedirs(dirname)
  
          print 'Rendering %s' % (filename)
  
          with app.app.test_request_context(path=rule_string):
              g.compile_includes = True
              g.compiled_includes = compiled_includes
  
              view = app.__dict__[name]
              content = view()
  
              compiled_includes = g.compiled_includes
  
          with open(filename, 'w') as f:
              f.write(content.encode('utf-8'))
function_tokens: def render ( ) : from flask import g update_copy ( ) less ( ) jst ( ) app_config_js ( ) copy_js ( ) compiled_includes = [ ] for rule in app . app . url_map . iter_rules ( ) : rule_string = rule . rule name = rule . endpoint if name == 'static' or name . startswith ( '_' ) : print 'Skipping %s' % name continue if rule_string . endswith ( '/' ) : filename = 'www' + rule_string + 'index.html' elif rule_string . endswith ( '.html' ) : filename = 'www' + rule_string else : print 'Skipping %s' % name continue dirname = os . path . dirname ( filename ) if not ( os . path . exists ( dirname ) ) : os . makedirs ( dirname ) print 'Rendering %s' % ( filename ) with app . app . test_request_context ( path = rule_string ) : g . compile_includes = True g . compiled_includes = compiled_includes view = app . __dict__ [ name ] content = view ( ) compiled_includes = g . compiled_includes with open ( filename , 'w' ) as f : f . write ( content . encode ( 'utf-8' ) )