nxg / bibhtml (http://purl.org/nxg/dist/bibhtml)

Bibhtml consists of a set of BibTeX style files, which allow you to use BibTeX to produce bibliographies in HTML. These are modelled closely on the standard BibTeX style files. To accompany them, this package includes a pair of XSLT scripts which illustrate how you might integrate these generated bibliographies into an XML/HTML workflow.

Clone this repository (size: 179.8 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/nxg/bibhtml/
commit 48: 55efa7e65636
parent 47: 7527f0a3a756
branch: default
Remove redundant/confusing hrefform
Norman Gray / nxg
7 months ago

Changed (Δ4.4 KB):

raw changeset »

abbrvhtml.bst (7 lines added, 49 lines removed)

alphahtml.bst (7 lines added, 49 lines removed)

plainhtml.bst (7 lines added, 49 lines removed)

unsrthtml.bst (7 lines added, 49 lines removed)

Up to file-list abbrvhtml.bst:

@@ -62,7 +62,7 @@ ENTRY
62
62
INTEGERS { output.state before.all mid.sentence after.sentence after.block }
63
63
64
64
STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst...
65
INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
65
INTEGERS { inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
66
66
% Following constants may be adjusted by hand, if desired
67
67
FUNCTION {init.urlbst.variables}
68
68
{
@@ -76,7 +76,6 @@ FUNCTION {init.urlbst.variables}
76
76
  #1 'addeprints :=         % 0=no eprints; 1=include eprints
77
77
  #1 'adddoiresolver :=     % 0=no DOI resolver; 1=include it
78
78
  #1 'addpubmedresolver :=     % 0=no PUBMED resolver; 1=include it
79
  #2 'hrefform :=           % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
80
79
  #1 'inlinelinks :=        % 0=URLs explicit; 1=URLs attached to titles
81
80
  % the following are internal state variables, not config constants
82
81
  #0 'makeinlinelink :=     % state variable managed by possibly.setup.inlinelink
@@ -146,20 +145,9 @@ FUNCTION {output.nonnull.original}
146
145
% closeinlinelink to be non-empty.
147
146
FUNCTION {possibly.setup.inlinelink}
148
147
{ makeinlinelink
149
    { hrefform #1 = % hypertex
150
        { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink :=
151
          "\special {html:</a>}" 'closeinlinelink :=
152
          }
153
        { hrefform #2 = % hyperref
154
            { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
155
              "</a>" 'closeinlinelink := }
156
            'skip$
157
          if$ % hrefform #2 =
158
        }
159
      if$ % hrefform #1 =
160
      #0 'makeinlinelink :=
161
    }
162
    'skip$
148
   { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
149
     "</a>" 'closeinlinelink := }
150
   'skip$
163
151
 if$ % makeinlinelink
164
152
}
165
153
FUNCTION {add.inlinelink}
@@ -693,47 +681,17 @@ FUNCTION {format.incoll.inproc.crossref}
693
681
694
682
% urlbst...
695
683
% Functions for making hypertext links.
696
% In all cases, the stack has (link-text href-url)
697
%
698
% make 'null' specials
699
FUNCTION {make.href.null}
700
{
701
  pop$
702
}
703
% make hypertex specials
704
FUNCTION {make.href.hypertex}
705
{ 
706
  "\special {html:<a href=" quote$ *
707
  swap$ * quote$ * "> }" * swap$ *
708
  "\special {html:</a>}" *
709
}
710
% make hyperref specials
711
FUNCTION {make.href.hyperref}
684
FUNCTION {make.href}
712
685
{ 
713
686
  "<a href='" swap$ * "'><code>" * swap$ * "</code></a>" *
714
687
}
715
FUNCTION {make.href}
716
{ hrefform #2 =
717
    'make.href.hyperref      % hrefform = 2
718
    { hrefform #1 =
719
        'make.href.hypertex  % hrefform = 1
720
        'make.href.null      % hrefform = 0 (or anything else)
721
      if$
722
    }
723
  if$
724
}
725
688
726
689
% If inlinelinks is true, then format.url should be a no-op, since it's
727
690
% (a) redundant, and (b) could end up as a link-within-a-link.
728
691
FUNCTION {format.url}
729
692
{ inlinelinks #1 = url empty$ or
730
   { "" }
731
   { hrefform #1 =
732
       { % special case -- add HyperTeX specials
733
         urlintro "<code>" url * "</code>" * url make.href.hypertex * }
734
       { urlintro "<code>" * url * "</code>" * }
735
     if$
736
   }
693
    { "" }
694
    { urlintro "<code>" * url * "</code>" * }
737
695
  if$
738
696
}
739
697

Up to file-list alphahtml.bst:

@@ -62,7 +62,7 @@ ENTRY
62
62
INTEGERS { output.state before.all mid.sentence after.sentence after.block }
63
63
64
64
STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst...
65
INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
65
INTEGERS { inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
66
66
% Following constants may be adjusted by hand, if desired
67
67
FUNCTION {init.urlbst.variables}
68
68
{
@@ -76,7 +76,6 @@ FUNCTION {init.urlbst.variables}
76
76
  #1 'addeprints :=         % 0=no eprints; 1=include eprints
77
77
  #1 'adddoiresolver :=     % 0=no DOI resolver; 1=include it
78
78
  #1 'addpubmedresolver :=     % 0=no PUBMED resolver; 1=include it
79
  #2 'hrefform :=           % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
80
79
  #1 'inlinelinks :=        % 0=URLs explicit; 1=URLs attached to titles
81
80
  % the following are internal state variables, not config constants
82
81
  #0 'makeinlinelink :=     % state variable managed by possibly.setup.inlinelink
@@ -146,20 +145,9 @@ FUNCTION {output.nonnull.original}
146
145
% closeinlinelink to be non-empty.
147
146
FUNCTION {possibly.setup.inlinelink}
148
147
{ makeinlinelink
149
    { hrefform #1 = % hypertex
150
        { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink :=
151
          "\special {html:</a>}" 'closeinlinelink :=
152
          }
153
        { hrefform #2 = % hyperref
154
            { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
155
              "</a>" 'closeinlinelink := }
156
            'skip$
157
          if$ % hrefform #2 =
158
        }
159
      if$ % hrefform #1 =
160
      #0 'makeinlinelink :=
161
    }
162
    'skip$
148
   { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
149
     "</a>" 'closeinlinelink := }
150
   'skip$
163
151
 if$ % makeinlinelink
164
152
}
165
153
FUNCTION {add.inlinelink}
@@ -693,47 +681,17 @@ FUNCTION {format.incoll.inproc.crossref}
693
681
694
682
% urlbst...
695
683
% Functions for making hypertext links.
696
% In all cases, the stack has (link-text href-url)
697
%
698
% make 'null' specials
699
FUNCTION {make.href.null}
700
{
701
  pop$
702
}
703
% make hypertex specials
704
FUNCTION {make.href.hypertex}
705
{ 
706
  "\special {html:<a href=" quote$ *
707
  swap$ * quote$ * "> }" * swap$ *
708
  "\special {html:</a>}" *
709
}
710
% make hyperref specials
711
FUNCTION {make.href.hyperref}
684
FUNCTION {make.href}
712
685
{ 
713
686
  "<a href='" swap$ * "'><code>" * swap$ * "</code></a>" *
714
687
}
715
FUNCTION {make.href}
716
{ hrefform #2 =
717
    'make.href.hyperref      % hrefform = 2
718
    { hrefform #1 =
719
        'make.href.hypertex  % hrefform = 1
720
        'make.href.null      % hrefform = 0 (or anything else)
721
      if$
722
    }
723
  if$
724
}
725
688
726
689
% If inlinelinks is true, then format.url should be a no-op, since it's
727
690
% (a) redundant, and (b) could end up as a link-within-a-link.
728
691
FUNCTION {format.url}
729
692
{ inlinelinks #1 = url empty$ or
730
   { "" }
731
   { hrefform #1 =
732
       { % special case -- add HyperTeX specials
733
         urlintro "\url{" url * "}" * url make.href.hypertex * }
734
       { urlintro "<code>" * url * "</code>" * }
735
     if$
736
   }
693
    { "" }
694
    { urlintro "<code>" * url * "</code>" * }
737
695
  if$
738
696
}
739
697

Up to file-list plainhtml.bst:

@@ -62,7 +62,7 @@ ENTRY
62
62
INTEGERS { output.state before.all mid.sentence after.sentence after.block }
63
63
64
64
STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst...
65
INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
65
INTEGERS { inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
66
66
% Following constants may be adjusted by hand, if desired
67
67
FUNCTION {init.urlbst.variables}
68
68
{
@@ -76,7 +76,6 @@ FUNCTION {init.urlbst.variables}
76
76
  #1 'addeprints :=         % 0=no eprints; 1=include eprints
77
77
  #1 'adddoiresolver :=     % 0=no DOI resolver; 1=include it
78
78
  #1 'addpubmedresolver :=     % 0=no PUBMED resolver; 1=include it
79
  #2 'hrefform :=           % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
80
79
  #1 'inlinelinks :=        % 0=URLs explicit; 1=URLs attached to titles
81
80
  % the following are internal state variables, not config constants
82
81
  #0 'makeinlinelink :=     % state variable managed by possibly.setup.inlinelink
@@ -147,20 +146,9 @@ FUNCTION {output.nonnull.original}
147
146
% closeinlinelink to be non-empty.
148
147
FUNCTION {possibly.setup.inlinelink}
149
148
{ makeinlinelink
150
    { hrefform #1 = % hypertex
151
        { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink :=
152
          "\special {html:</a>}" 'closeinlinelink :=
153
          }
154
        { hrefform #2 = % hyperref
155
            { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
156
              "</a>" 'closeinlinelink := }
157
            'skip$
158
          if$ % hrefform #2 =
159
        }
160
      if$ % hrefform #1 =
161
      #0 'makeinlinelink :=
162
    }
163
    'skip$
149
   { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
150
     "</a>" 'closeinlinelink := }
151
   'skip$
164
152
 if$ % makeinlinelink
165
153
}
166
154
FUNCTION {add.inlinelink}
@@ -694,47 +682,17 @@ FUNCTION {format.incoll.inproc.crossref}
694
682
695
683
% urlbst...
696
684
% Functions for making hypertext links.
697
% In all cases, the stack has (link-text href-url)
698
%
699
% make 'null' specials
700
FUNCTION {make.href.null}
701
{
702
  pop$
703
}
704
% make hypertex specials
705
FUNCTION {make.href.hypertex}
706
{ 
707
  "\special {html:<a href=" quote$ *
708
  swap$ * quote$ * "> }" * swap$ *
709
  "\special {html:</a>}" *
710
}
711
% make hyperref specials
712
FUNCTION {make.href.hyperref}
685
FUNCTION {make.href}
713
686
{ 
714
687
  "<a href='" swap$ * "'><code>" * swap$ * "</code></a>" *
715
688
}
716
FUNCTION {make.href}
717
{ hrefform #2 =
718
    'make.href.hyperref      % hrefform = 2
719
    { hrefform #1 =
720
        'make.href.hypertex  % hrefform = 1
721
        'make.href.null      % hrefform = 0 (or anything else)
722
      if$
723
    }
724
  if$
725
}
726
689
727
690
% If inlinelinks is true, then format.url should be a no-op, since it's
728
691
% (a) redundant, and (b) could end up as a link-within-a-link.
729
692
FUNCTION {format.url}
730
693
{ inlinelinks #1 = url empty$ or
731
   { "" }
732
   { hrefform #1 =
733
       { % special case -- add HyperTeX specials
734
         urlintro "\url{" url * "}" * url make.href.hypertex * }
735
       { urlintro "<code>" * url * "</code>" * }
736
     if$
737
   }
694
    { "" }
695
    { urlintro "<code>" * url * "</code>" * }
738
696
  if$
739
697
}
740
698

Up to file-list unsrthtml.bst:

@@ -62,7 +62,7 @@ ENTRY
62
62
INTEGERS { output.state before.all mid.sentence after.sentence after.block }
63
63
64
64
STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst...
65
INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
65
INTEGERS { inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
66
66
% Following constants may be adjusted by hand, if desired
67
67
FUNCTION {init.urlbst.variables}
68
68
{
@@ -76,7 +76,6 @@ FUNCTION {init.urlbst.variables}
76
76
  #1 'addeprints :=         % 0=no eprints; 1=include eprints
77
77
  #1 'adddoiresolver :=     % 0=no DOI resolver; 1=include it
78
78
  #1 'addpubmedresolver :=     % 0=no PUBMED resolver; 1=include it
79
  #2 'hrefform :=           % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
80
79
  #1 'inlinelinks :=        % 0=URLs explicit; 1=URLs attached to titles
81
80
  % the following are internal state variables, not config constants
82
81
  #0 'makeinlinelink :=     % state variable managed by possibly.setup.inlinelink
@@ -146,20 +145,9 @@ FUNCTION {output.nonnull.original}
146
145
% closeinlinelink to be non-empty.
147
146
FUNCTION {possibly.setup.inlinelink}
148
147
{ makeinlinelink
149
    { hrefform #1 = % hypertex
150
        { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink :=
151
          "\special {html:</a>}" 'closeinlinelink :=
152
          }
153
        { hrefform #2 = % hyperref
154
            { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
155
              "</a>" 'closeinlinelink := }
156
            'skip$
157
          if$ % hrefform #2 =
158
        }
159
      if$ % hrefform #1 =
160
      #0 'makeinlinelink :=
161
    }
162
    'skip$
148
   { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
149
     "</a>" 'closeinlinelink := }
150
   'skip$
163
151
 if$ % makeinlinelink
164
152
}
165
153
FUNCTION {add.inlinelink}
@@ -692,47 +680,17 @@ FUNCTION {format.incoll.inproc.crossref}
692
680
693
681
% urlbst...
694
682
% Functions for making hypertext links.
695
% In all cases, the stack has (link-text href-url)
696
%
697
% make 'null' specials
698
FUNCTION {make.href.null}
699
{
700
  pop$
701
}
702
% make hypertex specials
703
FUNCTION {make.href.hypertex}
704
{ 
705
  "\special {html:<a href=" quote$ *
706
  swap$ * quote$ * "> }" * swap$ *
707
  "\special {html:</a>}" *
708
}
709
% make hyperref specials
710
FUNCTION {make.href.hyperref}
683
FUNCTION {make.href}
711
684
{ 
712
685
  "<a href='" swap$ * "'><code>" * swap$ * "</code></a>" *
713
686
}
714
FUNCTION {make.href}
715
{ hrefform #2 =
716
    'make.href.hyperref      % hrefform = 2
717
    { hrefform #1 =
718
        'make.href.hypertex  % hrefform = 1
719
        'make.href.null      % hrefform = 0 (or anything else)
720
      if$
721
    }
722
  if$
723
}
724
687
725
688
% If inlinelinks is true, then format.url should be a no-op, since it's
726
689
% (a) redundant, and (b) could end up as a link-within-a-link.
727
690
FUNCTION {format.url}
728
691
{ inlinelinks #1 = url empty$ or
729
   { "" }
730
   { hrefform #1 =
731
       { % special case -- add HyperTeX specials
732
         urlintro "\url{" url * "}" * url make.href.hypertex * }
733
       { urlintro "<code>" * url * "</code>" * }
734
     if$
735
   }
692
    { "" }
693
    { urlintro "<code>" * url * "</code>" * }
736
694
  if$
737
695
}
738
696