Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- bin/refs-autogen:

  - Finally added support for "bidirectional" linking. That is:
	  If symbol A refers to B and C in the See Also section, then A and C
    will be pushed to B's See Also, and A and B to C's See Also.

    Duplicates (and self-references) are of course eliminated.
    Also, this only works for Interchange symbols; if a symbol refers to say,
    the top(1) command and one other Interchange symbol, the top(1) entry
    won't be "autolinked" because chances are it's specific to an item.

- refs/*/control:
  - removed some of the links to see autolinking at work
  • Loading branch information...
commit fc7eb7d9d16b3bf7d96be6cd9c6e2c5497b2225f 1 parent 478babf
Davor Ocelic docelic authored
20 bin/refs-autogen
View
@@ -168,8 +168,27 @@ ENDD
while ( my($k,$v) = each %autogenerated ) {
my %ag = %$v;
+ # Do temporary-only modifications to %ag
+
+ # Double check
$ag{name} ||= $ag{id} || $k;
+ # See Also "bidirectional" linking
+ if ( $ag{'see also'} ) {
+ ( my $list = $ag{'see also'} ) =~ s/,/ /g;
+ my @list = split /\s+/, $list;
+ @list = grep {$autogenerated{$_} and $_ ne $ag{name}} @list;
+
+ for my $sym ( @list ) {
+ ( my $list2 = $autogenerated{$sym}{'see also'} || "") =~ s/,/ /g;
+ my @list2 = split /\s+/, $list2;
+ push @list2, @list, $k;
+ { my %h; @list2 = grep {!$h{$_}++ and $sym ne $_} @list2 }
+ $autogenerated{$sym}{'see also'} = join ", ", @list2;
+ }
+ }
+
+ # Finally, set default values if they weren't overriden by real information
for my $field (@page_order) {
if ( ! $ag{$field} ) {
if ( grep {/$field/} @mandatory) {
@@ -180,7 +199,6 @@ while ( my($k,$v) = each %autogenerated ) {
}
}
- # Do temporary-only modifications to %ag
$ag{latest} = $hash{version};
# Expand template
2  refs/init_page/control
View
@@ -11,5 +11,5 @@ purpose: custom subroutine to run before page Variable processing
author:
# leave empty; GPL is the default
copyright:
-see also: init_page, pre_page, post_page
+see also:
default: none
2  refs/pre_page/control
View
@@ -11,5 +11,5 @@ purpose: custom subroutine to run after Variable substitution, before interpolat
author:
# leave empty; GPL is the default
copyright:
-see also: init_page, pre_page, post_page
+see also: init_page, post_page
default: none
Please sign in to comment.
Something went wrong with that request. Please try again.