Skip to contentSkip to conversation

gitweb: Add padding to project's README on "summary" page

PATCH New Jakub Narebski 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitweb: Add padding to project's README on "summary" page

Add padding to (optional) project's README on "summary" page (taken from README.html in project's GIT_DIR), to make it line out with the rest of the page.

It is done by adding a wrapper div element around README contents, with "readme" class, and CSS rule for div.readme; it fixes layout, but probably should be refactored during gitweb CSS cleanup.

---
 gitweb/gitweb.css  |    4 ++++
 gitweb/gitweb.perl |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
gitweb/gitweb.css +4 -0
index 5e40292..cbe8c11 100644
@@ -76,6 +76,10 @@ div.page_body {
 	font-family: monospace;
 }
 
+div.readme {
+	padding: 8px;
+}
+
 div.title, a.title {
 	display: block;
 	padding: 6px 8px;
gitweb/gitweb.perl +2 -0
index 3786955..4f34c29 100755
@@ -3063,7 +3063,9 @@ sub git_summary {
 	if (-s "$projectroot/$project/README.html") {
 		if (open my $fd, "$projectroot/$project/README.html") {
 			print "<div class=\"title\">readme</div>\n";
+			print "<div class=\"readme\">\n";
 			print $_ while (<$fd>);
+			print "</div>\n"; # class="readme"
 			close $fd;
 		}
 	}
Signature · 1 line
1.5.0.5