blob: da475c6c7cc536a6cc989fe41305fb43e57e5bd5 [file] [log] [blame]
Shawn Pearce374f1842015-02-10 15:36:54 -08001// Copyright 2015 Google Inc. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14{namespace gitiles autoescape="strict"}
15
16/**
17 * Documentation page rendered from markdown.
18 *
Shawn Pearce99cdbce2015-02-10 12:05:45 -080019 * @param? siteTitle h1 title from navbar.md.
20 * @param pageTitle h1 title from specific page.
21 * @param? logoUrl url of image logo.
22 * @param? homeUrl url to jump to top of site.
Shawn Pearcebc381a42015-06-22 12:17:43 -070023 * @param? analyticsId Google Analytics Property ID.
Shawn Pearce374f1842015-02-10 15:36:54 -080024 * @param sourceUrl url for source view of the page.
25 * @param logUrl url for log history of page.
26 * @param blameUrl url for blame of page source.
27 * @param? navbarHtml markdown ast node to convert.
28 * @param bodyHtml safe html to embed into the body of the page.
29 */
30{template .markdownDoc}
31<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Shawn Pearcea3e0e282015-02-12 13:57:54 -080032<html class="doc-page">
Shawn Pearce374f1842015-02-10 15:36:54 -080033<head>
Shawn Pearce99cdbce2015-02-10 12:05:45 -080034 <title>
35 {if $siteTitle}{$siteTitle} -{sp}{/if}
36 {$pageTitle}
37 </title>
Shawn Pearce374f1842015-02-10 15:36:54 -080038 <link rel="stylesheet" type="text/css" href="{gitiles.DOC_CSS_URL}" />
39</head>
40<body>
Shawn Pearce99cdbce2015-02-10 12:05:45 -080041 {if $siteTitle}
42 <div class="banner" role="banner">
43 <div class="nav-aux">
44 <h1>
45 {if $homeUrl}<a href="{$homeUrl}">{/if}
46 {if $logoUrl}<img src="{$logoUrl}" alt="project logo" />{/if}
47 {$siteTitle}
48 {if $homeUrl}</a>{/if}
49 </h1>
50 <h2>{$pageTitle}</h2>
51 </div>
52 </div>
53 {/if}
Shawn Pearce374f1842015-02-10 15:36:54 -080054 {if $navbarHtml}
55 <div class="nav" role="navigation">
56 <div class="nav-aux">
57 {$navbarHtml}
58 </div>
59 </div>
60 {/if}
Shawn Pearcea3e0e282015-02-12 13:57:54 -080061 <div class="doc">
Shawn Pearce374f1842015-02-10 15:36:54 -080062 {$bodyHtml}
63 </div>
64 <div class="footer-break"></div>
65 <div class="footer-line">
66 <div class="nav-aux">
67 <ul>
Shawn Pearce68311c72015-06-09 17:01:34 -070068 {if $sourceUrl}<li><a href="{$sourceUrl}">{msg desc="text for the source link"}source{/msg}</a></li>{/if}
69 {if $logUrl}<li><a href="{$logUrl}">{msg desc="text for the log link"}log{/msg}</a></li>{/if}
70 {if $blameUrl}<li><a href="{$blameUrl}">{msg desc="text for the blame link"}blame{/msg}</a></li>{/if}
Shawn Pearce374f1842015-02-10 15:36:54 -080071 </ul>
72 <div class="gitiles-att">
73 Powered by <a href="https://code.google.com/p/gitiles/">Gitiles</a>
74 </div>
75 </div>
76 </div>
Shawn Pearcebc381a42015-06-22 12:17:43 -070077 {if $analyticsId}
78 /* From https://developers.google.com/analytics/devguides/collection/analyticsjs/ */
79 <script>
80 (function(i,s,o,g,r,a,m){lb}i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){lb}
81 (i[r].q=i[r].q||[]).push(arguments){rb},i[r].l=1*new Date();a=s.createElement(o),
82 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
83 {rb})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
84
85 ga('create', '{$analyticsId}', 'auto');
86 ga('send', 'pageview', {lb}title: '{$pageTitle}'{rb});
87 </script>
88 {/if}
Shawn Pearce374f1842015-02-10 15:36:54 -080089</body>
90</html>
91{/template}