fix code display

This commit is contained in:
Michael Zhang 2020-04-21 20:57:25 -05:00
parent 68cf30b2d5
commit 7f8370b67e
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
2 changed files with 31 additions and 10 deletions

View file

@ -60,6 +60,7 @@ table.striped tr:nth-child(even) {
}
.blob-contents {
background-color: rgba(0, 0, 0, 0.1);
width: 100%;
overflow-x: auto;
font-family: var(--mono-font);
@ -67,8 +68,27 @@ table.striped tr:nth-child(even) {
}
.blob-contents .left {
margin-right: 12px;
margin-right: 8px;
text-align: right;
line-height: 20px;
background-color: rgba(0, 0, 0, 0.1);
}
.blob-contents .left ul {
display: block;
list-style-type: none;
margin-top: 0;
padding-left: 0;
}
.blob-contents .left ul .line {
padding: 0 4px;
display: block;
}
.blob-contents .right pre {
line-height: 20px;
margin-top: 0;
}
.readme {

View file

@ -6,17 +6,18 @@
{% if blob.lines %}
<div class="blob-contents">
<div class="left">
{% for _ in blob.lines %}
<a name="L{{ loop.index }}" />
<a href="#L{{ loop.index }}" title="permalink to line {{ loop.index }}">{{ loop.index }}</a>
<br />
{% endfor %}
<ul>
{% for _ in blob.lines %}
<a name="L{{ loop.index }}" />
<a href="#L{{ loop.index }}" title="permalink to line {{ loop.index }}">
<li class="line">{{ loop.index }}</li>
</a>
{% endfor %}
</ul>
</div>
<div class="right">
{% for line in blob.lines %}
<pre>{{ line }}</pre>
<br />
{% endfor %}
<pre>{% for line in blob.lines %}{{ line }}
{% endfor %}</pre>
</div>
</pre>
{% else %}