[interchange-docs] xmldocs - docelic modified bin/refs-autogen
docs at icdevgroup.org
docs at icdevgroup.org
Sun Jul 9 10:08:20 EDT 2006
User: docelic
Date: 2006-07-09 14:08:20 GMT
Modified: bin refs-autogen
Log:
* String "__FNAME__" in a refs/* file will now expand to file name being
read.
In other words, since file names match the name of item we're documenting,
it makes sense to have a replacement like this. In many examples, example
title is "Setting <name>", and requires change on each copy/paste or anything
you do with it.
Now, you can simply say "Setting __FNAME__", and it'll expand properly in
all files.
Another good use are some section openers, like "The <name> directive ...".
Again, this way you can just say "The __FNAME__ directive ..." and copy/paste
it around.
Revision Changes Path
1.110 +9 -0 xmldocs/bin/refs-autogen
rev 1.110, prev_rev 1.109
Index: refs-autogen
===================================================================
RCS file: /var/cvs/xmldocs/bin/refs-autogen,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- refs-autogen 18 Apr 2006 13:39:53 -0000 1.109
+++ refs-autogen 9 Jul 2006 14:08:19 -0000 1.110
@@ -1088,6 +1088,15 @@
my ( $section, $title, $pre_content, $content, $post_content );
# XXX check if it's empty, then don't update
for my $line (@c) {
+
+ # GLOBAL REPLACE. To ease writing reference pages, __FNAME__
+ # will expand to name of file. So, if file is refs/CommonAdjust,
+ # __FNAME__ will expand to CommonAdjust. XXX this only works
+ # in one-file method. Not multi-file method, but as said a few
+ # times above, multi-file is not to be used any more.
+ ( my $_fname = $refpath ) =~ s#.*/##;
+ $line =~ s/__FNAME__/$_fname/;
+
# Here we support format of this kind:
# __NAME__ section name: section title
# The 'title' part will be automatically wrapped in a
More information about the docs
mailing list