25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

127 lines
5.8 KiB

  1. {{define "Analytics"}}{{with gaAccount}}<script type="text/javascript">
  2. var _gaq = _gaq || [];
  3. _gaq.push(['_setAccount', '{{.}}']);
  4. _gaq.push(['_trackPageview']);
  5. (function() {
  6. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  7. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  8. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  9. })();
  10. </script>{{end}}{{end}}
  11. {{define "SearchBox"}}
  12. <form>
  13. <div class="input-group">
  14. <input class="form-control" name="q" autofocus="autofocus" value="{{.}}" placeholder="Search for package by import path or keyword." type="text">
  15. <span class="input-group-btn">
  16. <button class="btn btn-default" type="submit">Go!</button>
  17. </span>
  18. </div>
  19. </form>
  20. {{end}}
  21. {{define "ProjectNav"}}{{template "FlashMessages" .flashMessages}}<div class="clearfix" id="x-projnav">
  22. {{if .pdoc.ProjectRoot}}{{if .pdoc.ProjectURL}}<a href="{{.pdoc.ProjectURL}}"><strong>{{.pdoc.ProjectName}}:</strong></a>{{else}}<strong>{{.pdoc.ProjectName}}:</strong>{{end}}{{else}}<a href="/-/go">Go:</a>{{end}}
  23. {{.pdoc.Breadcrumbs templateName}}
  24. {{if and .pdoc.Name (or templateName "pkg.html" templateName "cmd.html")}}
  25. <span class="pull-right">
  26. {{if not .pdoc.IsCmd}}
  27. <a href="#pkg-index">Index</a>
  28. {{if .pdoc.AllExamples}}<span class="text-muted">|</span> <a href="#pkg-examples">Examples</a>{{end}}
  29. <span class="text-muted">|</span>
  30. {{end}}
  31. <a href="#pkg-files">Files</a>
  32. {{if .pkgs}}<span class="text-muted">|</span> <a href="#pkg-subdirectories">Directories</a>{{end}}
  33. </span>
  34. {{end}}
  35. </div>{{end}}
  36. {{define "Pkgs"}}
  37. <table class="table table-condensed">
  38. <thead><tr><th>Path</th><th>Synopsis</th></tr></thead>
  39. <tbody>{{range .}}<tr><td>{{if .Path|isValidImportPath}}<a href="/{{.Path}}">{{.Path|importPath}}</a>{{else}}{{.Path|importPath}}{{end}}</td><td>{{.Synopsis|importPath}}</td></tr>
  40. {{end}}</tbody>
  41. </table>
  42. {{end}}
  43. {{define "SearchPkgs"}}
  44. <table class="table table-condensed">
  45. <thead><tr><th>Path</th><th>Synopsis</th></tr></thead>
  46. <tbody>{{range .}}
  47. <tr><td>
  48. {{if .Path|isValidImportPath}}
  49. <a href="/{{.Path}}">{{.Path|importPath}}</a>
  50. <ul class="list-inline">
  51. <li class="additional-info">{{.ImportCount}} imports</li>
  52. {{if .Fork}}<li class="additional-info">· fork</li>{{end}}
  53. {{if .Stars}}<li class="additional-info">· {{.Stars}} stars</li>{{end}}
  54. </ul>
  55. {{else}}{{.Path|importPath}}</td>
  56. {{end}}
  57. <td class="synopsis">{{.Synopsis|importPath}}</td></tr>
  58. {{end}}</tbody>
  59. </table>
  60. {{end}}
  61. {{define "PkgCmdHeader"}}{{with .pdoc}}
  62. <title>{{.PageName}} - GoDoc</title>
  63. {{if .Synopsis}}
  64. <meta name="twitter:title" content="{{if .IsCmd}}Command{{else}}Package{{end}} {{.PageName}}">
  65. <meta property="og:title" content="{{if .IsCmd}}Command{{else}}Package{{end}} {{.PageName}}">
  66. <meta name="description" content="{{.Synopsis}}">
  67. <meta name="twitter:description" content="{{.Synopsis}}">
  68. <meta property="og:description" content="{{.Synopsis}}">
  69. <meta name="twitter:card" content="summary">
  70. <meta name="twitter:site" content="@golang">
  71. {{end}}
  72. {{if .Errors}}<meta name="robots" content="NOINDEX">{{end}}
  73. {{end}}{{end}}
  74. {{define "PkgFiles"}}{{with .pdoc}}
  75. <h4 id="pkg-files">
  76. {{with .BrowseURL}}<a href="{{.}}">Package Files</a>{{else}}Package Files{{end}}
  77. <a class="permalink" href="#pkg-files">&para;</a>
  78. </h4>
  79. <p>{{range .Files}}{{if .URL}}<a href="{{.URL}}">{{.Name}}</a>{{else}}{{.Name}}{{end}} {{end}}</p>
  80. {{end}}{{end}}
  81. {{define "PkgCmdFooter"}}
  82. <!-- Bugs -->
  83. {{with .pdoc}}{{with .Notes}}{{with .BUG}}
  84. <h3 id="pkg-note-bug">Bugs <a class="permalink" href="#pkg-note-bug">&para;</a></h3>{{range .}}<p>{{$.pdoc.SourceLink .Pos "☞" true}} {{.Body}}{{end}}
  85. {{end}}{{end}}{{end}}
  86. {{if $.pkgs}}<h3 id="pkg-subdirectories">Directories <a class="permalink" href="#pkg-subdirectories">&para;</a></h3>
  87. <table class="table table-condensed">
  88. <thead><tr><th>Path</th><th>Synopsis</th></tr></thead>
  89. <tbody>{{range $.pkgs}}<tr><td><a href="/{{.Path}}">{{relativePath .Path $.pdoc.ImportPath}}</a><td>{{.Synopsis}}</td></tr>{{end}}</tbody>
  90. </table>
  91. {{end}}
  92. <div id="x-pkginfo">
  93. {{with $.pdoc}}
  94. <form name="x-refresh" method="POST" action="/-/refresh"><input type="hidden" name="path" value="{{.ImportPath}}"></form>
  95. <p>{{if or .Imports $.importerCount}}Package {{.Name}} {{if .Imports}}imports <a href="?imports">{{.Imports|len}} packages</a> (<a href="?import-graph">graph</a>){{end}}{{if and .Imports $.importerCount}} and {{end}}{{if $.importerCount}}is imported by <a href="?importers">{{$.importerCount}} packages</a>{{end}}.{{end}}
  96. {{if not .Updated.IsZero}}Updated <span class="timeago" title="{{.Updated.Format "2006-01-02T15:04:05Z"}}">{{.Updated.Format "2006-01-02"}}</span>{{if or (equal .GOOS "windows") (equal .GOOS "darwin")}} with GOOS={{.GOOS}}{{end}}.{{end}}
  97. <a href="javascript:document.getElementsByName('x-refresh')[0].submit();" title="Refresh this page from the source.">Refresh now</a>.
  98. <a href="?tools">Tools</a> for package owners.
  99. {{.StatusDescription}}
  100. {{end}}
  101. {{with $.pdoc.Errors}}
  102. <p>The <a href="http://golang.org/cmd/go/#Download_and_install_packages_and_dependencies">go get</a>
  103. command cannot install this package because of the following issues:
  104. <ul>
  105. {{range .}}<li>{{.}}{{end}}
  106. </ul>
  107. {{end}}
  108. </div>
  109. {{end}}
  110. {{define "FlashMessages"}}{{range .}}
  111. {{if eq .ID "redir"}}{{if eq (len .Args) 1}}<div class="alert alert-warning">Redirected from {{index .Args 0}}.</div>{{end}}
  112. {{else if eq .ID "refresh"}}{{if eq (len .Args) 1}}<div class="alert alert-danger">Error refreshing package: {{index .Args 0}}</div>{{end}}
  113. {{end}}
  114. {{end}}{{end}}