[interchange-docs] xmldocs - docelic modified 7 files
docs at icdevgroup.org
docs at icdevgroup.org
Wed Nov 14 17:42:39 EST 2007
User: docelic
Date: 2007-11-14 22:42:39 GMT
Modified: . Makefile TODO
Modified: bin mkreport stattree
Modified: docbook xmldocs.css
Modified: guides iccattut.xml
Added: guides stats-template.xml
Log:
* Do some work with 'mkreport' which should report some statistics
about ic source tree
* Adjustment to visual table properties in CSS
* Minor updates here and there
Revision Changes Path
1.94 +5 -0 xmldocs/Makefile
rev 1.94, prev_rev 1.93
Index: Makefile
===================================================================
RCS file: /var/cvs/xmldocs/Makefile,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- Makefile 12 Nov 2007 02:30:05 -0000 1.93
+++ Makefile 14 Nov 2007 22:42:39 -0000 1.94
@@ -280,6 +280,11 @@
files/infobot/interchange.fact facts: refxmls bin/infobot.facts
bin/infobot.facts
+#############################################################
+# IC source tree stats
+guides/stats.xml: guides/stats-template.xml
+ bin/mkreport
+
## Helper target, only used by docelic
#colt-preview:
# tar jcf OUTPUT.tar.bz2 OUTPUT
1.113 +0 -5 xmldocs/TODO
rev 1.113, prev_rev 1.112
Index: TODO
===================================================================
RCS file: /var/cvs/xmldocs/TODO,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- TODO 14 Nov 2007 20:25:02 -0000 1.112
+++ TODO 14 Nov 2007 22:42:39 -0000 1.113
@@ -2,7 +2,6 @@
- work on bin/mkreport
- search doc se nevidi jer je search neki actionmap
- provide static files for download, describe keys like alt+n
-- u CVS listi, da je fajl nejm link na CVS
- documentation for bounce and restrict is ignored
- some small error in glossary/pragma at the bottom, [tag pragma]0[/tag]
- see if the files we parse in bin/stattree in block (like parseVendConfig, parseVendInterpolate) allow some stuff to go unaccounted for mkreport
@@ -21,10 +20,6 @@
- remove NEW from <meta>
- In tags, make XSLT code print position number besides "Yes" word in
positional parameters for tags
-- add search box to guides/index.xml
-- make See Also only go two or three levels recursively. Currently we do it
- until the "chain" ends, which results in having many unrelated options
- listed under See Also.
- in search.xml replace mv_ listitems with sections so they're listed in TOC
- note in configuration glossentry to use '' to skip values
- Check ConfigDatabase and DirectiveDatabase. Is description correct? One seems to be wrong
1.6 +18 -171 xmldocs/bin/mkreport
rev 1.6, prev_rev 1.5
Index: mkreport
===================================================================
RCS file: /var/cvs/xmldocs/bin/mkreport,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- mkreport 21 Jul 2004 20:13:30 -0000 1.5
+++ mkreport 14 Nov 2007 22:42:39 -0000 1.6
@@ -1,7 +1,6 @@
#!/usr/bin/perl
-# Loads csche dump from stattree and generates statistics
-# TODO needs serious work (on producing report.txt file)
+# Loads cache dump from stattree and generates statistics
use warnings;
use strict;
@@ -32,162 +31,40 @@
"verbose|v!" => \$verbose,
)) { die "Error parsing options\n" }
- at ARGV == 1 or die "Usage: $0 path[/]\n";
+ at ARGV == 1 or warn "No arguments, assuming sources/cvs-head\n";
my $path = shift;
+$path ||= "sources/cvs-head";
( my $dumppath = $path ) =~ s#.+?/##;
( $i{ver} = $dumppath ) =~ s/\/$//;
my $dumpdir = $dumppath;
$dumppath .= "/.cache.bin";
+my $sf = 'guides/stats-template.xml';
+my $so = 'guides/stats.xml';
+my @sf;
# Load DB
loaddb( "$cachedir/$dumppath" );
-# First dump leafnodes-to-files
-# Hashvalue -> file conversion
-my @stack = ();
-while (my($k,$v) = each %hash) {
- procitem(\@stack, $k,$v);
-}
+open IN, "< $sf" or die "Can't rdopen '$sf' ($!)\n";
+ at sf = <IN>;
+close IN or die "Can't rdclose '$sf' ($!)\n";
-# TODO this needs work
-open(OUT, "> $reportdir/$i{ver}/treestats.txt") or
- die "Cant write/open report file: $!\n";
-select OUT;
-O("
-== Interchange version $i{ver}
-
- =FILES= ===%=== ===BYTES=== ===%===
-
- Overall:${\( gs() )}
-
-+ Perl code:${\( gs('extensions', [qw/pm pl/], 1) )}
-
- C code:${\( gs('extensions', [qw/c/], 0) )}
- HTML pages:${\( gs('extensions', [qw/html/], 0) )}
-
-+ ITL Tags:${\( gs('extensions', [qw/coretag tag/], 1) )}
-
-+ Images:${\( gs('extensions', [qw/png gif jpg/], 1) )}
-
- Text:${\( gs('extensions', [qw/txt/], 0) )}
-
- =KLOCS= ===%===
-
-+ KLOCS:${\( gs('klocs', [qw/code html coretag tag pod comment/],1) )}
-
-");
-close (OUT);
-select STDOUT;
-
-for my $p (qw/pragma globvar/) {
- my $tfile = '';
- open(OUT, "> $reportdir/$i{ver}/total.symbols.$p") or
- die "Can't write symbols.$p ($!)\n";
- print OUT scalar keys %{ $hash{symbols}{$p} };
- close OUT;
- while (my ($k,$v) = each %{ $hash{symbols}{$p} } ) {
- $tfile .= "$k\n";
- for my $fe ( @$v ) {
- local $" = ":";
- $tfile .= "\t@$fe[0,1] $$fe[2]\n";
- local $" = "\t\t";
- $tfile .= "\t\t@{@$fe[3]}\n";
- }
- }
- open(OUT, "> $reportdir/$i{ver}/symbols.$p") or
- die "Can't write symbols.$p ($!)\n";
- print OUT $tfile;
- close OUT;
+for (@sf) {
+ s/(\$hash\{.+\})\s$/$1/gee;
}
-exit 0;
-
-#################################################################
-# Helpers below
-
-sub gs {
-# my $stype = shift;
-# my @exts = @{(shift)};
- my @stat = (0,0,0,0); # important to initialize, we use $#stat below
-# my $extended = shift;
- my %estats;
-#
- $^A = "";
-#
-# # BY EXTENSION
-# if ( $stype eq 'extensions' ) { # By extension
-# if ( @exts ) {
-# for my $ext ( @exts ) {
-# $estats{$ext}[0] += $h{$stype}{$ext}{files};
-# $estats{$ext}[2] += $h{$stype}{$ext}{size};
-# $estats{$ext}[1] = sprintf("%.2f", $estats{$ext}[0] /
-# $h{total}{files} * 100);
-# $estats{$ext}[3] = sprintf("%.2f", $estats{$ext}[2] /
-# $h{total}{size} * 100);
-#
-# $stat[$_] += $estats{$ext}[$_] for (0..$#stat);
-# # Fill empty fields with ""
-# push @{$estats{$ext}}, "", "", "", "";
-# }
-#
-# } else { # Total statistics
- unless ( @_ ) {
- @stat = ( $hash{total}{files}, "100.00",
- $hash{total}{size}, "100.00",
- $hash{total}{lines}, "100.00" );
- }
-#
-# } elsif ( $stype eq 'klocs' ) { # By contents
-# @stat = (0, 0);
-# if ( @exts ) {
-# for my $styp ( @exts ) {
-# $estats{$styp}[0] += $h{$stype}{$styp}{lines};
-# $estats{$styp}[1] = sprintf("%.2f", $estats{$styp}[0] /
-# $h{total}{klocs} * 100);
-# $estats{$styp}[0] = sprintf("%.2f", $estats{$styp}[0] / 1000);
-#
-# # Fill empty fields with ""
-# push @{$estats{$styp}}, "", "", "", "";
-#
-# for my $f (0..$#stat) { $stat[$f] += $estats{$styp}[$f] }
-# }
-# } else {
-# @stat = ( $h{total}{klocs}, "100.00" );
-# }
-# }
-#
-# unless ( $stype eq 'klocs' ) {
- for (my $i = 0; $i <= $#stat; $i+=2 ) {
- ( $stat[$i] = reverse $stat[$i] ) =~ s/(.{3})(?!$)/$1,/g;
- $stat[$i] = reverse $stat[$i];
- }
- for my $key ( keys %estats ) {
- ( $estats{$key}[0] = reverse $estats{$key}[0] ) =~ s/(.{3})(?!$)/$1,/g;
- ( $estats{$key}[2] = reverse $estats{$key}[2] ) =~ s/(.{3})(?!$)/$1./g;
- $estats{$key}[0] = reverse $estats{$key}[0];
- $estats{$key}[2] = reverse $estats{$key}[2];
- }
-# }
+open OUT, "> $so" or die "Can't wropen '$so' ($!)\n";
+print OUT @sf;
+close OUT or die "Can't wrclose '$so' ($!)\n";
- # Fill empty fields with ""
- push @stat, "", "", "", "";
- formline <<'ENDD', @stat;
-@>>>>>>> @>>>>>> @>>>>>>>>>> @>>>>>>
-ENDD
-
-# if ( $extended ) {
-# for my $ext ( @exts ) {
-# formline <<'ENDD', $desc{$ext} || $ext, @{$estats{$ext}};
-#`@>>>>>>>>>>>:@>>>>>>> @>>>>>> @>>>>>>>>>> @>>>>>>
-#ENDD
-# }
-# }
- chomp($^A); $^A
-}
+exit 0;
+############################################################################
+# Helper functions
+#
sub loaddb {
my $dbpath = shift;
@@ -209,34 +86,4 @@
}
}
-# Recursive procedure to find leaf nodes in a hash
-# (For hashvalue -> file conversion)
-sub procitem {
- my ($stack, $key, $val) = @_;
-
- # Ignores:
- return if "$key" eq "tree";
- return if "$key" eq "symbols";
- return if "@$stack" eq "total" and $key eq "matches";
-
- unless (ref $val eq 'HASH') {
- $val = join("\n", @$val) if ( ref $val eq 'ARRAY' );
- local $" = ".";
- # Handle cases like $hash{version}, where it's a toplevel element
- # without anything on @$stack.
- ( my $fout = "@$stack.$key" ) =~ s/^\.//;
- open OUT, "> $cachedir/$dumpdir/$fout" or
- die "Can't dump $dumpdir/@$stack.$key ($!)\n";
- print OUT $val;
- close OUT;
- } else {
- push @$stack, $key;
- while (my($k,$v) = each %$val) {
- procitem($stack, $k, $v);
- }
- pop @$stack;
- }
-}
-
-sub O { print "@_\n"; print STDOUT "@_\n" if $verbose }
1.60 +0 -2 xmldocs/bin/stattree
rev 1.60, prev_rev 1.59
Index: stattree
===================================================================
RCS file: /var/cvs/xmldocs/bin/stattree,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- stattree 13 Nov 2007 02:44:18 -0000 1.59
+++ stattree 14 Nov 2007 22:42:39 -0000 1.60
@@ -946,8 +946,6 @@
$hash{total}{perl_functions}++;
@{ $$c{gfunc} } = ( $1, $$c{lnum} );
}
-
- $hash{total}{functions}++;
}
# Parse Config.pm and take out some great stuff ;-)
1.31 +2 -2 xmldocs/docbook/xmldocs.css
rev 1.31, prev_rev 1.30
Index: xmldocs.css
===================================================================
RCS file: /var/cvs/xmldocs/docbook/xmldocs.css,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- xmldocs.css 14 Nov 2007 18:50:30 -0000 1.30
+++ xmldocs.css 14 Nov 2007 22:42:39 -0000 1.31
@@ -327,8 +327,8 @@
.informaltable td {
border: 0.5pt solid black;
- padding: 2px;
- margin: 0
+ padding: 0px;
+ margin: 0px;
}
/*
1.42 +2 -6 xmldocs/guides/iccattut.xml
rev 1.42, prev_rev 1.41
Index: iccattut.xml
===================================================================
RCS file: /var/cvs/xmldocs/guides/iccattut.xml,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- iccattut.xml 20 Aug 2007 18:37:38 -0000 1.41
+++ iccattut.xml 14 Nov 2007 22:42:39 -0000 1.42
@@ -87,14 +87,10 @@
<abstract>
<para>
- The purpose of this document is to guide you through constructing a simple &IC; catalog <emphasis role='bold'>from scratch</emphasis>. The standard catalogs that ship with Interchange are quite complex since they are ready to be used for business and highlight many of the capabilities that Interchange offers. Those catalogs can be too intimidating<footnote><para>Intimidate: to make timid or fearful; to frighten into submission.</para></footnote> places to start the journey if you're interested in learning the basic Interchange building blocks.
+ The purpose of this document is to guide you through constructing a simple &IC; catalog <emphasis role='bold'>from scratch</emphasis>. The standard catalogs that ship with Interchange are quite complex since they are ready to be used for business and highlight many of the capabilities that Interchange offers. Those catalogs may not be the right places to start the journey if you're interested in learning the basic Interchange building blocks.
</para> <para>
Although this tutorial provides ready-to-use examples, please <emphasis role='bold'>think</emphasis>
- about them (and ideally, retype them instead of copy-pasting to your test catalog). From personal
- experience, I can tell you <emphasis role='bold'>re-implementing the catalog manually on your system
- is the only proper way to read this tutorial</emphasis>. All the examples serve only to quickly
- clarify all your doubts and save the time you'd spend wondering about which style is right
- and officially encouraged.
+ about them (and ideally, retype them instead of copy-pasting to your test catalog).
</para>
</abstract>
1.1 xmldocs/guides/stats-template.xml
rev 1.1, prev_rev 1.0
Index: stats-template.xml
===================================================================
<?xml version="1.0" standalone="no"?>
<!DOCTYPE stats PUBLIC "-//OASIS//DTD DocBook-Interchange XML V4.2//EN"
"../docbook/docbookxi.dtd">
<article id='stats'>
<articleinfo>
<title>Interchange: Source Code Statistics</title>
<titleabbrev>stats</titleabbrev>
</articleinfo>
<para role='stats'>
<informaltable pgwide='1' frame='none' role='stats'>
<tgroup cols='4' align='left'>
<colspec colname=''/>
<colspec colname=''/>
<colspec colname=''/>
<colspec colname=''/>
<tbody>
<row>
<entry>Total size
</entry>
<entry>$hash{total}{size}
KB
</entry>
<entry>Config directives
</entry>
<entry>$hash{total}{confs}
</entry>
</row>
<row>
<entry>Total files
</entry>
<entry>$hash{total}{files}
</entry>
<entry>Global
</entry>
<entry>$hash{total}{globconfs}
</entry>
</row>
<row>
<entry>Total directories
</entry>
<entry>$hash{total}{directories}
</entry>
<entry>Catalog
</entry>
<entry>$hash{total}{catconfs}
</entry>
</row>
<row>
<entry>ASCII files
</entry>
<entry>$hash{total}{ascii}
</entry>
<entry>Tags
</entry>
<entry>$hash{total}{tags}
</entry>
</row>
<row>
<entry>C program files
</entry>
<entry>$hash{total}{c}
</entry>
<entry>System
</entry>
<entry>$hash{total}{systemtags}
</entry>
</row>
<row>
<entry>Interchange config files
</entry>
<entry>$hash{total}{config}
</entry>
<entry>User
</entry>
<entry>$hash{total}{usertags}
</entry>
</row>
<row>
<entry>Interchange database files
</entry>
<entry>$hash{total}{database}
</entry>
<entry>UI
</entry>
<entry>$hash{total}{uitags}
</entry>
</row>
<row>
<entry>HTML/ITL pages
</entry>
<entry>$hash{total}{html}
</entry>
<entry>
</entry>
<entry>
</entry>
</row>
<row>
<entry>Perl program files
</entry>
<entry>$hash{total}{perl}
</entry>
<entry>Widgets
</entry>
<entry>$hash{total}{widgets}
</entry>
</row>
<row>
<entry>Total lines
</entry>
<entry>$hash{total}{lines}
</entry>
<entry>
</entry>
<entry>
</entry>
</row>
<row>
<entry>
</entry>
<entry>
</entry>
<entry>Filters
</entry>
<entry>$hash{total}{filters}
</entry>
</row>
<row>
<entry>Binary files
</entry>
<entry>$hash{total}{binary_files}
</entry>
<entry>
</entry>
<entry>
</entry>
</row>
<row>
<entry>Images
</entry>
<entry>$hash{total}{images}
</entry>
<entry>Order checks
</entry>
<entry>$hash{total}{orderchecks}
</entry>
</row>
<row>
<entry>Perl
</entry>
<entry>
</entry>
<entry>Pragmas
</entry>
<entry>$hash{total}{pragmas}
</entry>
</row>
<row>
<entry>Lines of code
</entry>
<entry>$hash{total}{perl_code}
</entry>
<entry>
</entry>
<entry>
</entry>
</row>
<row>
<entry>Functions
</entry>
<entry>$hash{total}{perl_functions}
</entry>
<entry>Variables
</entry>
<entry>$hash{total}{vars}
</entry>
</row>
<row>
<entry>Comments
</entry>
<entry>$hash{total}{perl_comments}
</entry>
<entry>Global
</entry>
<entry>$hash{total}{globvars}
</entry>
</row>
<row>
<entry>Inline comments
</entry>
<entry>$hash{total}{perl_gray}
</entry>
<entry>Catalog
</entry>
<entry>$hash{total}{catvars}
</entry>
</row>
<row>
<entry>Empty lines
</entry>
<entry>$hash{total}{perl_empty}
</entry>
<entry>
</entry>
<entry>
</entry>
</row>
<row>
<entry>Lines of POD documentation
</entry>
<entry>$hash{total}{perl_pod}
</entry>
<entry>
</entry>
<entry>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</article>
More information about the docs
mailing list