From 7f8370b67ead906d6cb629c1e8f59628827d09fa Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Tue, 21 Apr 2020 20:57:25 -0500 Subject: [PATCH] fix code display --- static/main.css | 22 +++++++++++++++++++++- templates/repo_blob.html | 19 ++++++++++--------- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/static/main.css b/static/main.css index 453278b..7ec2516 100644 --- a/static/main.css +++ b/static/main.css @@ -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 { diff --git a/templates/repo_blob.html b/templates/repo_blob.html index 8c4e295..14a36c0 100644 --- a/templates/repo_blob.html +++ b/templates/repo_blob.html @@ -6,17 +6,18 @@ {% if blob.lines %}
- {% for _ in blob.lines %} - - {{ loop.index }} -
- {% endfor %} +
- {% for line in blob.lines %} -
{{ line }}
-
- {% endfor %} +
{% for line in blob.lines %}{{ line }}
+{% endfor %}
{% else %}