Fork me on GitHub

source: git/doc/root_tree_html.sh@ 9ad08ca

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 9ad08ca was 0f8390e, checked in by Pavel Demin <pavel.demin@…>, 10 years ago

fix bottom padding

  • Property mode set to 100755
File size: 2.4 KB
Line 
1#! /bin/sh
2
3if [ $# -ne 1 ]
4then
5 echo " Usage: $0 output_file"
6 echo " output_file - output file in HTML format."
7 exit
8fi
9
10awk '
11 BEGIN {
12 print "<!doctype html>"
13 print "<html>"
14
15 print "<head>"
16 print " <meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">"
17 print " <meta NAME=\"keywords\" CONTENT=\"root, tree, ntuple, format, description\">"
18 print " <title>root tree description</title>"
19 print " <style>"
20 print " body { font-family: sans-serif; max-width: 800px; line-height: 1.4; margin-left: auto; margin-right: auto; padding: 0em 1em 3em 1em; }"
21 print " h1 { font-weight: normal; }"
22 print " td, th { border: 1px solid #d3d3d3; padding: 0.1em 0.3em; }"
23 print " th { text-align: left; background-color: #f5f5f5; }"
24 print " tr.even td { background-color: #f5f5f5; }"
25 print " tr.class td { font-weight: bold; padding-top: 1em; }"
26 print " </style>"
27 print "</head>"
28
29 print "<body>"
30
31 print "<h1>ROOT Tree Description</h1>"
32 print "<p>Description of all classes used to store output data.</p>"
33
34 print "<table>"
35 print "<tr><th>Parameter</th>"
36 print "<th>Definition</th>"
37 print "<th>How it was calculated</th></tr>"
38 }
39
40 function print_line(name, comment, even, end) {
41 if(name != ""){
42 if(even) print "<tr class=\"even\">"
43 else print "<tr class=\"odd\">"
44 print " <td>"name"</td>"
45 split(comment, a, "|");
46 print " <td>"a[1]"</td>"
47 print " <td>"a[2]"</td>"
48 print "</tr>"
49 }
50 }
51
52 /^ *class /{
53 print_line(name, comment, even, 1);
54 even = 0;
55 name = "";
56 comment = "";
57 split($2, a, ":");
58 if(a[1] == "Candidate" || a[1] == "DelphesFactory;") next;
59 print "<tr class=\"class\"><td colspan=\"3\" id=\""a[1]"\">class "a[1]"</td></tr>"
60 }
61
62 /: public /{
63 if($4 == "TObject" || $4 == "SortableObject") next;
64 name = sprintf("<a href=\"#%s\">%s</a>", $4, $4);
65 split($2, a, ":");
66 comment = sprintf("%s inherits all %s parameters", a[1], $4);
67 }
68
69 /^ *[A-Za-z_]* [A-Za-z].*; \/\/ / {
70 print_line(name, comment, even, 0);
71 split($2, a, ";");
72 name = a[1];
73 split($0, a, "// ");
74 comment = a[2];
75 even = !even;
76 }
77
78 /^ +\/\/ /{split($0, a, "// "); comment = comment" "a[2]}
79 END {
80 print_line(name, comment, even, 1);
81 print "</table>"
82 print "</body></html>"
83 }' `dirname $0`/../classes/DelphesClasses.h > $1
Note: See TracBrowser for help on using the repository browser.