>From Russ Allbery's TODO of a month ago:

> * Introduce a new interior sequence for footnotes.  (Tom Christiansen is
>   currently using [FOOTNOTE: ...], but I think an interior sequence would
>   be better; F<> is already taken, though.)  This is lower priority,
>   since it's unclear how to do a footnote in text or *roff output anyway,
>   but it's useful in other contexts.

Marek Rouchal suggested N<>[1], which I like.  The way I've seen
footnotes done in text[2], is with brackets.  I imagine the *roff
output should be similar, the LaTeX is trivial and HTML could be links
to anchors at the bottom of the page.  A patch for Pod::Text follows.

Jon
___ 
    1
    http://archive.develooper.com/pod-people%40perl.org/msg00309.html

    2
    Usenet, mail, README.txt, etc.


--- /src/podlators-1.08/lib/Pod/Text.pm Sat Feb 10 06:50:23 2001
+++ /src/podlators/lib/Pod/Text.pm      Fri Mar  9 01:28:21 2001
@@ -330,6 +330,7 @@
     elsif ($command eq 'F') { return $self->seq_f ($_) }
     elsif ($command eq 'I') { return $self->seq_i ($_) }
     elsif ($command eq 'L') { return $self->seq_l ($_) }
+    elsif ($command eq 'N') { return $self->seq_n ($_) }
     else { carp "Unknown sequence $command<$_>" }
 }
 
@@ -526,6 +527,27 @@
     $text;
 }
 
+sub seq_n {
+    my $self = shift;
+    push @{$self->{NOTES}}, shift;
+    return '[' . @{$self->{NOTES}} . ']';
+}
+
+sub notes {
+    my $self = shift;
+    if (defined $self->{NOTES}){
+       $self->output('_' x 3 . "\n"); # "___\n" doesn't work
+       for my $note (0..$#{$self->{NOTES}}) {
+           $$self{ITEM} = $note + 1;
+           $self->item("$self->{NOTES}[$note]\n");
+       }
+       undef $self->{NOTES};
+    }
+};
+
+sub end_input {
+    $_[0]->notes;
+}
 
 ############################################################################
 # List handling

Reply via email to