extra style for line numbers

Fri, 24 May 2013 13:53:52 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 24 May 2013 13:53:52 +0200
changeset 2
3bced1fe9193
parent 1
12c482ea4fc4
child 3
b7a6d546bd1d

extra style for line numbers

src/c2html.c file | annotate | diff | comparison | revisions
test/header.htm file | annotate | diff | comparison | revisions
--- a/src/c2html.c	Fri May 24 13:35:06 2013 +0200
+++ b/src/c2html.c	Fri May 24 13:53:52 2013 +0200
@@ -133,8 +133,8 @@
     if (inputfile) {
       printf("<pre>\n");
       for (int i = 0 ; i < inputfile->count ; i++) {
-        printf("%*d: %s\n", lnw(inputfile->count),
-            i, inputfile->lines[i]);
+        printf("<span class=\"c2html-lineno\">%*d:</span> %s\n",
+            lnw(inputfile->count), i, inputfile->lines[i]);
       }
       printf("</pre>\n");
       freeinputfilebuffer(inputfile);
--- a/test/header.htm	Fri May 24 13:35:06 2013 +0200
+++ b/test/header.htm	Fri May 24 13:53:52 2013 +0200
@@ -2,6 +2,12 @@
 <html>
   <head>
     <title>c2html</title>
+    <style type="text/css">
+      span.c2html-lineno {
+        font-style: italic;
+        color: grey;
+      }
+    </style>
   </head>
   <body>
 

mercurial