[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff-commit] groff ChangeLog tmac/www.tmac
From: |
Werner LEMBERG |
Subject: |
[Groff-commit] groff ChangeLog tmac/www.tmac |
Date: |
Sat, 05 Apr 2008 20:56:40 +0000 |
CVSROOT: /cvsroot/groff
Module name: groff
Changes by: Werner LEMBERG <wl> 08/04/05 20:56:40
Modified files:
. : ChangeLog
tmac : www.tmac
Log message:
Add better support for `.TAG #<label>' in non-HTML documents:
In case of a forward reference in a call to .URL, write `(see below)'.
In
case of a backwards reference use the page number instead. The
reference
gets stored in a string `TAG_<label>' and can be overridden while
calling
`.TAG' with its new optional argument -- this is useful for a
second-pass
system which resolves forward references.
* tmac/www.tmac (www:url_check_tag): New function.
(URL): Use it.
(TAG): Add optional argument to define string `TAG_<label>.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.1128&r2=1.1129
http://cvs.savannah.gnu.org/viewcvs/groff/tmac/www.tmac?cvsroot=groff&r1=1.53&r2=1.54
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.1128
retrieving revision 1.1129
diff -u -b -r1.1128 -r1.1129
--- ChangeLog 24 Mar 2008 20:01:36 -0000 1.1128
+++ ChangeLog 5 Apr 2008 20:56:40 -0000 1.1129
@@ -1,3 +1,17 @@
+2008-04-05 Dorai Sitaram <address@hidden>
+
+ Add better support for `.TAG #<label>' in non-HTML documents: In
+ case of a forward reference in a call to .URL, write `(see below)'.
+ In case of a backwards reference use the page number instead. The
+ reference gets stored in a string `TAG_<label>' and can be
+ overridden while calling `.TAG' with its new optional argument --
+ this is useful for a second-pass system which resolves forward
+ references.
+
+ * tmac/www.tmac (www:url_check_tag): New function.
+ (URL): Use it.
+ (TAG): Add optional argument to define string `TAG_<label>.
+
2008-03-24 Werner LEMBERG <address@hidden>
* tmac/trace.tmac (so, mso): Added.
Index: tmac/www.tmac
===================================================================
RCS file: /cvsroot/groff/groff/tmac/www.tmac,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- tmac/www.tmac 24 Mar 2008 20:01:37 -0000 1.53
+++ tmac/www.tmac 5 Apr 2008 20:56:40 -0000 1.54
@@ -354,14 +354,34 @@
. HTML <body background=\\$1>
..
.
+.\" www:url_check_tag str
+.\" If url named by \*[str] is internal (starts with #),
+.\" redefine \*[str] to be the value of the string TAG_url.
+.
+.de www:url_check_tag
+. ds \\$0:tmp \\*[\\$1]\"
+. substring \\$0:tmp 0 0
+. if '\\*[\\$0:tmp]'#' \{\
+. ds \\$0:tmp \\*[\\$1]\"
+. substring \\$0:tmp 1
+. ds \\$0:tmp TAG_\\*[\\$0:tmp]\"
+. ie !'\\*[\\*[\\$0:tmp]]'' \
+. ds \\$1 \\*[\\*[\\$0:tmp]]\"
+. el \
+. ds \\$1 see below\"
+. \}
+. rm \\$0:tmp
+..
+.
.\" --------------------------------------------------------------------
.\" URL url [description] [after]
.\" if description is absent then the url becomes the anchor text
.\"
.de URL
-. ie !'\\$1'' \{\
+. if !'\\$1'' \{\
. ds \\$0:adr \\$1\"
-. www:url_breaks \\$0:adr
+. www:url_check_tag \\$0:adr
+. if !\\n[www-html] .www:url_breaks \\$0:adr
. \}
. ie \\n[www-html] \{\
. ie '\\$3'' \
@@ -369,7 +389,7 @@
. el \
. ds \\$0:after \&\\$3\"
. ie '\\$2'' \
-. HTML-NS <a "href=""\\$1"">\\$1</a>"
+. HTML-NS <a "href=""\\$1"">\\*[\\$0:adr]</a>"
. el \
. HTML-NS <a "href=""\\$1"">\\$2</a>"
. nop \\*[\\$0:after]
@@ -477,12 +497,19 @@
..
.
.\" --------------------------------------------------------------------
-.\" TAG name
+.\" TAG name [text]
.\"
.\" Generate an html name NAME.
+.\" Define string TAG_NAME to TEXT, if present,
+.\" otherwise to \n[PN].
+.\"
.\"
.de TAG
. HTML <a "name=""\\$1""></a>"
+. ie '\\$2'' \
+. ds TAG_\\$1 \\n[PN]
+. el \
+. ds TAG_\\$1 \\$2\"
..
.
.\" --------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Groff-commit] groff ChangeLog tmac/www.tmac,
Werner LEMBERG <=