git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 27, 2007, 23:20 UTC
Message-ID
<11750376272105-git-send-email-jnareb@gmail.com>

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.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.css  |    4 ++++
 gitweb/gitweb.perl |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 5e40292..cbe8c11 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -76,6 +76,10 @@ div.page_body {
 	font-family: monospace;
 }
 
+div.readme {
+	padding: 8px;
+}
+
 div.title, a.title {
 	display: block;
 	padding: 6px 8px;
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3786955..4f34c29 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -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;
 		}
 	}
-- 
1.5.0.5
Message 1 of 1 in “gitweb: Add padding to project's README on "summary" page”
  1. gitweb: Add padding to project's README on "summary" pageJakub Narebski, Mar 27, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.