parameters: (self)
return_statement: return self.html
docstring: function to generate html code.
docstring_summary: function to generate html code.
docstring_tokens: function to generate html code .
function: def generate(self):
          """
          function to generate html code.
          """
          doc, tag, text, line = Doc().ttl()
          doc.asis('<!DOCTYPE html>')
          api_url = 'http://maps.google.com/maps/api/js?sensor=' \
                    'false&callback=initMap'
          with tag('html'):
              with tag('head'):
                  with tag('title'):
                      text('Gmap Viewer')
                  doc.asis('<meta name="viewport" content="initial-scale=1.0">')
                  doc.asis('<meta charset="utf-8">')
                  with tag('style'):
                      doc.asis('#map { height: 100%; }')
                      doc.asis(
                          'html, body { height: 100%; margin: 0; padding: 0; }')
              with tag('body'):
                  with tag('div', id='map'):
                      pass
                  with tag('script'):
                      doc.asis('\nvar map;\n')
                      doc.asis("\nvar colors = ['#e6194b', '#3cb44b', '#ffe119', "
                               "'#0082c8', '#f58231', '#911eb4', '#46f0f0', "
                               "'#f032e6', '#d2f53c', '#fabebe', '#008080', "
                               "'#e6beff', '#aa6e28', '#fffac8', '#800000', "
                               "'#aaffc3', '#808000', '#ffd8b1', '#000080', "
                               "'#808080', '#000000']\n")
                      doc.asis('function initMap() {\n')
                      doc.asis("map = new google.maps.Map("
                               "document.getElementById('map'), {\n")
                      doc.asis('center: {lat: ' + str(self.center_lat) +
                               ', lng: ' + str(self.center_lon) + '},\n')
                      doc.asis('zoom: 16\n')
                      doc.asis('});\n')
                      doc.asis('var navi_lines = ' +
                               json.dumps(self.navigation_lines) + ';\n')
                      doc.asis("""
                          for (var i = 0; i < navi_lines.length; i++) {
                              var boundary = new google.maps.Polyline({
                                  path: navi_lines[i],
                                  geodesic: true,
                                  strokeColor: colors[i % colors.length],
                                  strokeOpacity: 1.0,
                                  strokeWeight: 3
                              });
                              boundary.setMap(map);
                          }
                      """)
                      doc.asis('}\n')
                  doc.asis('<script src="' + api_url + '"></script>')
          self.html = doc.getvalue()
          return self.html
function_tokens: def generate ( self ) : doc , tag , text , line = Doc ( ) . ttl ( ) doc . asis ( '<!DOCTYPE html>' ) api_url = 'http://maps.google.com/maps/api/js?sensor=' 'false&callback=initMap' with tag ( 'html' ) : with tag ( 'head' ) : with tag ( 'title' ) : text ( 'Gmap Viewer' ) doc . asis ( '<meta name="viewport" content="initial-scale=1.0">' ) doc . asis ( '<meta charset="utf-8">' ) with tag ( 'style' ) : doc . asis ( '#map { height: 100%; }' ) doc . asis ( 'html, body { height: 100%; margin: 0; padding: 0; }' ) with tag ( 'body' ) : with tag ( 'div' , id = 'map' ) : pass with tag ( 'script' ) : doc . asis ( '\nvar map;\n' ) doc . asis ( "\nvar colors = ['#e6194b', '#3cb44b', '#ffe119', " "'#0082c8', '#f58231', '#911eb4', '#46f0f0', " "'#f032e6', '#d2f53c', '#fabebe', '#008080', " "'#e6beff', '#aa6e28', '#fffac8', '#800000', " "'#aaffc3', '#808000', '#ffd8b1', '#000080', " "'#808080', '#000000']\n" ) doc . asis ( 'function initMap() {\n' ) doc . asis ( "map = new google.maps.Map(" "document.getElementById('map'), {\n" ) doc . asis ( 'center: {lat: ' + str ( self . center_lat ) + ', lng: ' + str ( self . center_lon ) + '},\n' ) doc . asis ( 'zoom: 16\n' ) doc . asis ( '});\n' ) doc . asis ( 'var navi_lines = ' + json . dumps ( self . navigation_lines ) + ';\n' ) doc . asis ( """
                          for (var i = 0; i < navi_lines.length; i++) {
                              var boundary = new google.maps.Polyline({
                                  path: navi_lines[i],
                                  geodesic: true,
                                  strokeColor: colors[i % colors.length],
                                  strokeOpacity: 1.0,
                                  strokeWeight: 3
                              });
                              boundary.setMap(map);
                          }
                      """ ) doc . asis ( '}\n' ) doc . asis ( '<script src="' + api_url + '"></script>' ) self . html = doc . getvalue ( ) return self . html