Change the behavior of the -links option. Instead of actually

creating a symbolic link from foo.html (from <label name="foo">) to
the numbered file, a shell script is built that can be used to make
the links at a later time (read: after installation in the target
directory).
This commit is contained in:
jfieber 1996-09-29 17:34:05 +00:00
parent 6c4f6381bf
commit dbb19185a7
2 changed files with 13 additions and 16 deletions

View File

@ -103,10 +103,12 @@ option will be to cause the marked section not to be ignored.
.It Fl links
When used with the
.Fl f Ar html
option, for each
option, this option generates a shell script named
.Pa file.ln .
For each
.Li <label id="foo">
in the document source
.Nm
in the document source,
.Pa file.ln
generates a symbolic link
.Pa foo.html
pointing to the numbered

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
# $Id: sgmlfmt.pl,v 1.11 1996/09/08 20:40:52 jfieber Exp $
# $Id: sgmlfmt.pl,v 1.12 1996/09/09 14:15:28 jfieber Exp $
# Copyright (C) 1996
# John R. Fieber. All rights reserved.
@ -597,7 +597,8 @@ sub navbar {
# extlink
#
# creates a symbolic link from the name in a reference to the numbered
# Build a shell script to create symbolic links from the name in
# a reference to the numbered
# html file. Since the file number that any given section has is
# subject to change as the document goes through revisions, this allows
# for a fixed target that separate documents can hook into.
@ -613,18 +614,12 @@ sub extlink {
$file = "$ref.html";
if (-e $file) {
if (-l $file) {
unlink($file);
symlink($fn, $file);
}
else {
print "Warning: $file exists and is not a symbolic link\n";
}
}
else {
symlink($fn, $file);
if (!fileno(LINKFILE)) {
print "Opening $fileroot.ln\n";
open(LINKFILE, ">${fileroot}.ln");
}
print LINKFILE "ln -fs $fn $file\n";
}
# Now, read the command line and take appropriate action