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

[PATCH 2/2] gitweb: Put project README in div.readme, fix its padding

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 19, 2007, 13:16 UTC
Message-ID
<1195478172-17226-3-git-send-email-jnareb@gmail.com>
In-Reply-To
<1195478172-17226-1-git-send-email-jnareb@gmail.com>

Put (optional) projects README on "summary" page in <div> element using "readme" class. This allow to style it using CSS.

Add padding to project's README to make it line out with the rest of the page.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.css  |    4 ++++
 gitweb/gitweb.perl |    4 +++-
 2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 17c60e4..446a1c3 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -85,6 +85,10 @@ div.title, a.title {
 	color: #000000;
 }
 
+div.readme {
+	padding: 8px;
+}
+
 a.title:hover {
 	background-color: #d9d8d1;
 }
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3d532dc..491a3f4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3912,8 +3912,10 @@ 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=\"title\">readme</div>\n" .
+			      "<div class=\"readme\">\n";
 			print $_ while (<$fd>);
+			print "\n</div>\n"; # class="readme"
 			close $fd;
 		}
 	}
-- 
1.5.3.5
Previous: Jakub Narebski
Message 5 of 5 in “gitweb: CSS cleanup, part 1”
  1. 0/2 gitweb: CSS cleanup, part 1Jakub Narebski, Nov 19, 2007
  2. 1/2 gitweb: Style all tables using CSSJakub Narebski, Nov 19, 2007
  3. Bernt HansenNov 19, 2007
  4. Jakub NarebskiNov 19, 2007
  5. 2/2 gitweb: Put project README in div.readme, fix its paddingJakub Narebski, Nov 19, 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.