Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/groff/tmac Add .%U to mark up URLs in bibliographic...



details:   https://anonhg.NetBSD.org/src/rev/7da054e3de60
branches:  trunk
changeset: 748492:7da054e3de60
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Oct 25 18:33:36 2009 +0000

description:
Add .%U to mark up URLs in bibliographic entries of mdoc(7) pages.
Discussed with wiz, Kristaps Dzonsons and Ruslan Ermilov, proposed
(without reaction) on the groff mailing list.

diffstat:

 gnu/dist/groff/tmac/doc-common     |   3 +
 gnu/dist/groff/tmac/doc.tmac       |  64 +++++++++++++++++++++++++++++++++++++-
 gnu/dist/groff/tmac/groff_mdoc.man |   2 +
 3 files changed, 68 insertions(+), 1 deletions(-)

diffs (155 lines):

diff -r aeb7dae77871 -r 7da054e3de60 gnu/dist/groff/tmac/doc-common
--- a/gnu/dist/groff/tmac/doc-common    Sun Oct 25 17:09:34 2009 +0000
+++ b/gnu/dist/groff/tmac/doc-common    Sun Oct 25 18:33:36 2009 +0000
@@ -46,6 +46,7 @@
 .nr %Q 1
 .nr %R 1
 .nr %T 1
+.nr %U 1
 .nr %V 1
 .nr Ac 3
 .nr Ad 12n
@@ -1096,6 +1097,8 @@
 .  tm doc-reference-title-count == \n[doc-reference-title-count]
 .  tm doc-reference-title-name == `\*[doc-reference-title-name]'
 .  tm doc-reference-title-name-for-book == `\*[doc-reference-title-name-for-book]'
+.  tm doc-url-count == \n[doc-url-count]
+.  tm doc-url-name == `\*[doc-url-name]'
 .  tm doc-volume-count == \n[doc-volume-count]
 .  tm doc-volume-name == `\*[doc-volume-name]'
 .  tm doc-have-author == \n[doc-have-author]
diff -r aeb7dae77871 -r 7da054e3de60 gnu/dist/groff/tmac/doc.tmac
--- a/gnu/dist/groff/tmac/doc.tmac      Sun Oct 25 17:09:34 2009 +0000
+++ b/gnu/dist/groff/tmac/doc.tmac      Sun Oct 25 18:33:36 2009 +0000
@@ -3430,6 +3430,8 @@
 .  nr doc-reference-title-count-saved \n[doc-reference-title-count]
 .  ds doc-reference-title-name-saved "\*[doc-reference-title-name]
 .  ds doc-reference-title-name-for-book-saved "\*[doc-reference-title-name-for-book]
+.  nr doc-url-count-saved \n[doc-url-count]
+.  ds doc-url-name-saved "\*[doc-url-name]
 .  nr doc-volume-count-saved \n[doc-volume-count]
 .  ds doc-volume-name-saved "\*[doc-volume-name]
 .  nr doc-have-author-saved \n[doc-have-author]
@@ -3570,6 +3572,8 @@
 .  nr doc-reference-title-count \n[doc-reference-title-count-saved]
 .  ds doc-reference-title-name "\*[doc-reference-title-name-saved]
 .  ds doc-reference-title-name-for-book "\*[doc-reference-title-name-for-book-saved]
+.  nr doc-url-count \n[doc-url-count-saved]
+.  ds doc-url-name "\*[doc-url-name-saved]
 .  nr doc-volume-count \n[doc-volume-count-saved]
 .  ds doc-volume-name "\*[doc-volume-name-saved]
 .  nr doc-have-author \n[doc-have-author-saved]
@@ -5194,6 +5198,8 @@
 .\" NS   doc-reference-title-name-for-book
 .\" NS   doc-report-count
 .\" NS   doc-report-name
+.\" NS   doc-url-count
+.\" NS   doc-url-name
 .\" NS   doc-volume-count
 .\" NS   doc-volume-name
 .
@@ -5208,6 +5214,7 @@
 .  nr doc-corporate-count 0
 .  nr doc-report-count 0
 .  nr doc-reference-title-count 0
+.  nr doc-url-count 0
 .  nr doc-volume-count 0
 .  nr doc-date-count 0
 .  nr doc-page-number-count 0
@@ -5316,6 +5323,13 @@
 .    doc-finish-reference \n[doc-volume-count]
 .  \}
 .
+.  if \n[doc-url-count] \{\
+.    unformat doc-url-name
+.    chop doc-url-name
+.    nop \*[doc-url-name]\c
+.    doc-finish-reference \n[doc-url-count]
+.  \}
+.
 .  if \n[doc-page-number-count] \{\
 .    unformat doc-page-number-string
 .    chop doc-page-number-string
@@ -6019,6 +6033,12 @@
 ..
 .
 .
+.\" NS doc-url-count global register
+.\" NS   counter of hypertext references
+.
+.nr doc-url-count 0
+.
+.
 .\" NS doc-volume-count global register
 .\" NS   counter of reference title references
 .
@@ -6031,6 +6051,48 @@
 .ds doc-volume-name
 .
 .
+.\" NS %U user macro
+.\" NS   hypertext reference
+.\" NS
+.\" NS modifies:
+.\" NS   doc-arg-ptr
+.\" NS   doc-curr-font
+.\" NS   doc-curr-size
+.\" NS   doc-macro-name
+.\" NS   doc-reference-count
+.\" NS   doc-url-count
+.\" NS
+.\" NS local variables:
+.\" NS   doc-env-%U
+.\" NS
+.\" NS width register `%U' set in doc-common
+.
+.de %U
+.  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
+.    tm Usage: .%U URL ... (#\n[.c])
+.    return
+.  \}
+.
+.  nr doc-url-count +1
+.  nr doc-reference-count +1
+.
+.  ds doc-macro-name %U
+.  doc-parse-args \$@
+.
+.  nr doc-arg-ptr +1
+.  nr doc-curr-font \n[.f]
+.  nr doc-curr-size \n[.ps]
+.
+.  \" append to reference box
+.  boxa doc-url-name
+.  ev doc-env-%U
+.  evc 0
+.  in 0
+.  nf
+.  doc-do-references
+..
+.
+.
 .\" NS %V user macro
 .\" NS   reference volume
 .\" NS
@@ -6039,7 +6101,7 @@
 .\" NS   doc-curr-font
 .\" NS   doc-curr-size
 .\" NS   doc-macro-name
-.\" NS   doc-reference-title-count
+.\" NS   doc-reference-count
 .\" NS   doc-volume-count
 .\" NS
 .\" NS local variables:
diff -r aeb7dae77871 -r 7da054e3de60 gnu/dist/groff/tmac/groff_mdoc.man
--- a/gnu/dist/groff/tmac/groff_mdoc.man        Sun Oct 25 17:09:34 2009 +0000
+++ b/gnu/dist/groff/tmac/groff_mdoc.man        Sun Oct 25 18:33:36 2009 +0000
@@ -2528,6 +2528,8 @@
 Report name.
 .It Li .%T
 Title of article.
+.It Li .%U
+Optional hypertext reference.
 .It Li .%V
 Volume.
 .El



Home | Main Index | Thread Index | Old Index