github.com/jgarto/itcv@v0.0.0-20180826224514-4eea09c1aa0d/_vendor/src/golang.org/x/tools/godoc/dl/tmpl.go (about)

     1  // Copyright 2015 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by the Apache 2.0
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build appengine
     6  
     7  package dl
     8  
     9  // TODO(adg): refactor this to use the tools/godoc/static template.
    10  
    11  const templateHTML = `
    12  {{define "root"}}
    13  <!DOCTYPE html>
    14  <html>
    15  <head>
    16          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    17          <title>Downloads - The Go Programming Language</title>
    18          <link type="text/css" rel="stylesheet" href="/lib/godoc/style.css">
    19          <script type="text/javascript">window.initFuncs = [];</script>
    20  	<style>
    21  		table.codetable {
    22  			margin-left: 20px; margin-right: 20px;
    23  			border-collapse: collapse;
    24  		}
    25  		table.codetable tr {
    26  			background-color: #f0f0f0;
    27  		}
    28  		table.codetable tr:nth-child(2n), table.codetable tr.first {
    29  			background-color: white;
    30  		}
    31  		table.codetable td, table.codetable th {
    32  			white-space: nowrap;
    33  			padding: 6px 10px;
    34  		}
    35  		table.codetable tt {
    36  			font-size: xx-small;
    37  		}
    38  		table.codetable tr.highlight td {
    39  			font-weight: bold;
    40  		}
    41  		a.downloadBox {
    42  			display: block;
    43  			color: #222;
    44  			border: 1px solid #375EAB;
    45  			border-radius: 5px;
    46  			background: #E0EBF5;
    47  			width: 280px;
    48  			float: left;
    49  			margin-left: 10px;
    50  			margin-bottom: 10px;
    51  			padding: 10px;
    52  		}
    53  		a.downloadBox:hover {
    54  			text-decoration: none;
    55  		}
    56  		.downloadBox .platform {
    57  			font-size: large;
    58  		}
    59  		.downloadBox .filename {
    60  			color: #375EAB;
    61  			font-weight: bold;
    62  			line-height: 1.5em;
    63  		}
    64  		a.downloadBox:hover .filename {
    65  			text-decoration: underline;
    66  		}
    67  		.downloadBox .size {
    68  			font-size: small;
    69  			font-weight: normal;
    70  		}
    71  		.downloadBox .reqs {
    72  			font-size: small;
    73  			font-style: italic;
    74  		}
    75  		.downloadBox .checksum {
    76  			font-size: 5pt;
    77  		}
    78  	</style>
    79  </head>
    80  <body>
    81  
    82  <div id="topbar"><div class="container">
    83  
    84  <div class="top-heading"><a href="/">The Go Programming Language</a></div>
    85  <form method="GET" action="/search">
    86  <div id="menu">
    87  <a href="/doc/">Documents</a>
    88  <a href="/pkg/">Packages</a>
    89  <a href="/project/">The Project</a>
    90  <a href="/help/">Help</a>
    91  <a href="/blog/">Blog</a>
    92  <span class="search-box"><input type="search" id="search" name="q" placeholder="Search" aria-label="Search" required><button type="submit"><span><!-- magnifying glass: --><svg width="24" height="24" viewBox="0 0 24 24"><title>submit search</title><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg></span></button></span>
    93  </div>
    94  </form>
    95  
    96  </div></div>
    97  
    98  <div id="page">
    99  <div class="container">
   100  
   101  <h1>Downloads</h1>
   102  
   103  <p>
   104  After downloading a binary release suitable for your system,
   105  please follow the <a href="/doc/install">installation instructions</a>.
   106  </p>
   107  
   108  <p>
   109  If you are building from source,
   110  follow the <a href="/doc/install/source">source installation instructions</a>.
   111  </p>
   112  
   113  <p>
   114  See the <a href="/doc/devel/release.html">release history</a> for more
   115  information about Go releases.
   116  </p>
   117  
   118  {{with .Featured}}
   119  <h3 id="featured">Featured downloads</h3>
   120  {{range .}}
   121  {{template "download" .}}
   122  {{end}}
   123  {{end}}
   124  
   125  <div style="clear: both;"></div>
   126  
   127  {{with .Stable}}
   128  <h3 id="stable">Stable versions</h3>
   129  {{template "releases" .}}
   130  {{end}}
   131  
   132  {{with .Unstable}}
   133  <h3 id="unstable">Unstable version</h3>
   134  {{template "releases" .}}
   135  {{end}}
   136  
   137  {{with .Archive}}
   138  <div class="toggle" id="archive">
   139    <div class="collapsed">
   140      <h3 class="toggleButton" title="Click to show versions">Archived versions▹</h3>
   141    </div>
   142    <div class="expanded">
   143      <h3 class="toggleButton" title="Click to hide versions">Archived versions▾</h3>
   144      {{template "releases" .}}
   145    </div>
   146  </div>
   147  {{end}}
   148  
   149  <div id="footer">
   150          <p>
   151          Except as
   152          <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
   153          the content of this page is licensed under the Creative Commons
   154          Attribution 3.0 License,<br>
   155          and code is licensed under a <a href="http://golang.org/LICENSE">BSD license</a>.<br>
   156          <a href="http://golang.org/doc/tos.html">Terms of Service</a> |
   157          <a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
   158          </p>
   159  </div><!-- #footer -->
   160  
   161  </div><!-- .container -->
   162  </div><!-- #page -->
   163  <script>
   164    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
   165    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
   166    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
   167    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
   168  
   169    ga('create', 'UA-11222381-2', 'auto');
   170    ga('send', 'pageview');
   171  
   172  </script>
   173  </body>
   174  <script src="/lib/godoc/jquery.js"></script>
   175  <script src="/lib/godoc/godocs.js"></script>
   176  <script>
   177  $(document).ready(function() {
   178    $('a.download').click(function(e) {
   179      // Try using the link text as the file name,
   180      // unless there's a child element of class 'filename'.
   181      var filename = $(this).text();
   182      var child = $(this).find('.filename');
   183      if (child.length > 0) {
   184        filename = child.text();
   185      }
   186  
   187      // This must be kept in sync with the filenameRE in godocs.js.
   188      var filenameRE = /^go1\.\d+(\.\d+)?([a-z0-9]+)?\.([a-z0-9]+)(-[a-z0-9]+)?(-osx10\.[68])?\.([a-z.]+)$/;
   189      var m = filenameRE.exec(filename);
   190      if (!m) {
   191        // Don't redirect to the download page if it won't recognize this file.
   192        // (Should not happen.)
   193        return;
   194      }
   195  
   196      var dest = "/doc/install";
   197      if (filename.indexOf(".src.") != -1) {
   198        dest += "/source";
   199      }
   200      dest += "?download=" + filename;
   201  
   202      e.preventDefault();
   203      e.stopPropagation();
   204      window.location = dest;
   205    });
   206  });
   207  </script>
   208  </html>
   209  {{end}}
   210  
   211  {{define "releases"}}
   212  {{range .}}
   213  <div class="toggle{{if .Visible}}Visible{{end}}" id="{{.Version}}">
   214  	<div class="collapsed">
   215  		<h2 class="toggleButton" title="Click to show downloads for this version">{{.Version}} ▹</h2>
   216  	</div>
   217  	<div class="expanded">
   218  		<h2 class="toggleButton" title="Click to hide downloads for this version">{{.Version}} ▾</h2>
   219  		{{if .Stable}}{{else}}
   220  			<p>This is an <b>unstable</b> version of Go. Use with caution.</p>
   221  			<p>If you already have Go installed, you can install this version by running:</p>
   222  <pre>
   223  go get golang.org/x/build/version/{{.Version}}
   224  </pre>
   225  			<p>Then, use the <code>{{.Version}}</code> command instead of the <code>go</code> command to use {{.Version}}.</p>
   226  		{{end}}
   227  		{{template "files" .}}
   228  	</div>
   229  </div>
   230  {{end}}
   231  {{end}}
   232  
   233  {{define "files"}}
   234  <table class="codetable">
   235  <thead>
   236  <tr class="first">
   237    <th>File name</th>
   238    <th>Kind</th>
   239    <th>OS</th>
   240    <th>Arch</th>
   241    <th>Size</th>
   242    {{/* Use the checksum type of the first file for the column heading. */}}
   243    <th>{{(index .Files 0).ChecksumType}} Checksum</th>
   244  </tr>
   245  </thead>
   246  {{if .SplitPortTable}}
   247    {{range .Files}}{{if .PrimaryPort}}{{template "file" .}}{{end}}{{end}}
   248  
   249    {{/* TODO(cbro): add a link to an explanatory doc page */}}
   250    <tr class="first"><th colspan="6" class="first">Other Ports</th></tr>
   251    {{range .Files}}{{if not .PrimaryPort}}{{template "file" .}}{{end}}{{end}}
   252  {{else}}
   253    {{range .Files}}{{template "file" .}}{{end}}
   254  {{end}}
   255  </table>
   256  {{end}}
   257  
   258  {{define "file"}}
   259  <tr{{if .Highlight}} class="highlight"{{end}}>
   260    <td class="filename"><a class="download" href="{{.URL}}">{{.Filename}}</a></td>
   261    <td>{{pretty .Kind}}</td>
   262    <td>{{.PrettyOS}}</td>
   263    <td>{{pretty .Arch}}</td>
   264    <td>{{.PrettySize}}</td>
   265    <td><tt>{{.PrettyChecksum}}</tt></td>
   266  </tr>
   267  {{end}}
   268  
   269  {{define "download"}}
   270  <a class="download downloadBox" href="{{.URL}}">
   271  <div class="platform">{{.Platform}}</div>
   272  {{with .Requirements}}<div class="reqs">{{.}}</div>{{end}}
   273  <div>
   274    <span class="filename">{{.Filename}}</span>
   275    {{if .Size}}<span class="size">({{.PrettySize}})</span>{{end}}
   276  </div>
   277  </a>
   278  {{end}}
   279  `