show: make highlight legible
[debiancodesearch.git] / cmd / dcs-web / templates / show.html
bloba905939bbd1bdb4c1acf8de505b67aa7a0ea0d88
1 <!--
2 vim:ts=4:sw=4:expandtab
3 --><!DOCTYPE html>
4 <html lang="en">
5 <head>
6 <title>Debian Code Search: {{.filename}}</title>
7 <link rel="stylesheet" href="debcodesearch.min.css">
8 <style type="text/css">
9 pre, code {
10 /* We need to make sure that the line numbers and the code itself have
11 no padding/margin so the positions match. The !important is to
12 overwrite the style set by highlight.js’s stylesheet. */
13 margin: 0 !important;
14 padding: 0 !important;
17 .lnr {
18 color: #999;
19 text-align: right;
20 padding-right: 1em;
21 padding-top: 0;
22 float: left;
23 width: {{.lnrwidth}}em;
25 </style>
26 <link rel="stylesheet" href="/highlightjs-default.min.css">
27 <script src="/highlightjs.min.js"></script>
28 </head>
29 <body>
31 <div id="header">
32 <div id="upperheader">
33 <div id="logo">
34 <a href="./" title="Debian Home"><img src="/Pics/openlogo-50.svg" alt="Debian" width="50" height="61"></a>
35 </div> <!-- end logo -->
36 <p class="section"><a href="/">Code Search</a></p>
37 </div> <!-- end upperheader -->
38 <!--UdmComment-->
39 <div id="navbar">
40 <p class="hidecss"><a href="#content">Skip Quicknav</a></p>
41 <ul>
42 <li><a href="./">Search</a></li>
43 <li><a href="./about">About Code Search</a></li>
44 <li><a href="./faq">FAQ</a></li>
45 </ul>
46 </div> <!-- end navbar -->
47 <p id="breadcrumbs">&nbsp; show source</p>
48 </div> <!-- end header -->
49 <!--/UdmComment-->
50 <div id="content">
52 <h2>Source of {{.filename}}</h2>
54 <!-- Line numbers on the left of the source code -->
55 <div class="lnr"><pre>{{range $idx, $line := .numbers}}{{ if eq $line $.line }}<span style="font-weight: bold; background-color: #333; color: #fff">{{ end }}<a id="L{{$line}}"><span id="L{{$line}}"></a>{{$line}}</span>{{ if eq $line $.line }}</span>{{ end }}
56 {{end}}
57 </pre></div>
58 <!-- The source code itself -->
59 <pre><code>{{range $idx, $line := .lines}}{{$line}}
60 {{end}}
61 </code></pre>
63 <script>hljs.initHighlightingOnLoad();</script>
64 {{ template "footer.html" . }}