summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--tmac/groff_www.man15
-rw-r--r--tmac/www.tmac50
3 files changed, 59 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index d471d7b1..33f46ef2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-15 Gaius Mulley <gaius@glam.ac.uk>
+
+ * tmac/www.tmac: New macro LINKSTYLE which allows users
+ to set various typographical url attributes for non HTML
+ devices.
+ * tmac/groff_www.man: Document LINKSTYLE.
+
2006-01-11 Werner LEMBERG <wl@gnu.org>
* configure.ac: Test for getc_unlocked (needed for localcharset).
diff --git a/tmac/groff_www.man b/tmac/groff_www.man
index 3f6f2e96..2e5cb9f8 100644
--- a/tmac/groff_www.man
+++ b/tmac/groff_www.man
@@ -102,6 +102,7 @@ Here is a summary of the functions found in this macro set.
\&.LNS start a new two-column
table with links in the left.
\&.LNE end the two-column table.
+\&.LINKSTYLE initialize default url attributes.
.fi
.PP
Output of the
@@ -512,6 +513,20 @@ right of the left-hand navigational links.
End a two-column table.
This should be called at the end of the document if .ALN was used.
.
+.TP
+.B ".LINKSTYLE color [ fontstyle [ openglyph closeglyph ] ]"
+Initialize default url attributes to be used when this macro set is not used
+with the HTML device.
+The macro set initializes itself with the following call
+.RS
+.IP
+.nf
+.ft B
+\&.LINKSTYLE blue C \e[la] \e[ra]
+.ft P
+.fi
+.RE
+but these values will be superseded by a user call to LINKSTYLE.
.
.SH SECTION HEADING LINKS
By default
diff --git a/tmac/www.tmac b/tmac/www.tmac
index 331838cf..93aa66a8 100644
--- a/tmac/www.tmac
+++ b/tmac/www.tmac
@@ -358,23 +358,23 @@ www functionality. It should work with any macro set.
. \}
. el \{\
. ie \\n[.color] \
-. nop \%\[la]\m[blue]\f[C]\\*[\\$0:adr]\f[]\m[]\[ra]\\$3
+. nop \%\\*[www:open]\m[\\*[www:color]]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\m[]\\*[www:close]\\$3
. el \
-. nop \%\[la]\f[CB]\\*[\\$0:adr]\f[]\[ra]\\$3
+. nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\\*[www:close]\\$3
. \}
. \}
. el \{\
. ie '\\$1'' \{\
. ie \\n[.color] \
-. nop \m[blue]\\$2\m[]\\$3
+. nop \m[\\*[www:color]]\\$2\m[]\\$3
. el \
-. nop \f[B]\\$2\f[]\\$3
+. nop \f[\\*[www:fontstyle]]\\$2\f[]\\$3
. \}
. el \{\
. ie \\n[.color] \
-. nop \m[blue]\\$2\m[] \%\[la]\f[C]\\*[\\$0:adr]\f[]\[ra]\\$3
+. nop \m[\\*[www:color]]\\$2\m[] \%\\*[www:open]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\\*[www:close]\\$3
. el \
-. nop \f[B]\\$2\f[] \%\[la]\f[C]\\*[\\$0:adr]\f[]\[ra]\\$3
+. nop \f[\\*[www:fontstyle]]\\$2\f[] \%\\*[www:open]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\\*[www:close]\\$3
. \}
. \}
. if !r ps4html .ad
@@ -420,23 +420,23 @@ www functionality. It should work with any macro set.
. \}
. el \{\
. ie \\n[.color] \
-. nop \%\m[blue]\f[C]\\$1\f[]\m[]\\$3
+. nop \%\m[\\*[www:color]]\f[\\*[www:fontstyle]]\\$1\f[]\m[]\\$3
. el \
-. nop \%\f[CB]\\$1\f[]\\$3
+. nop \%\f[\\*[www:fontstyle]]\\$1\f[]\\$3
. \}
. \}
. el \{\
. ie '\\$1'' \{\
. ie \\n[.color] \
-. nop \m[blue]\\$2\m[]\\$3
+. nop \m[\\*[www:color]]\\$2\m[]\\$3
. el \
-. nop \f[B]\\$2\f[]\\$3
+. nop \f[\\*[www:fontstyle]]\\$2\f[]\\$3
. \}
. el \{\
. ie \\n[.color] \
-. nop \m[blue]\\$2\m[] \%\[la]\f[C]\\$1\f[]\[ra]\\$3
+. nop \m[\\*[www:color]]\\$2\m[] \%\\*[www:open]\f[\\*[www:fontstyle]]\\$1\f[]\\*[www:close]\\$3
. el
-. nop \f[B]\\$2\f[] \%\[la]\f[C]\\$1\f[]\[ra]\\$3
+. nop \f[\\*[www:fontstyle]]\\$2\f[] \%\\*[www:open]\f[\\*[www:fontstyle]]\\$1\f[]\\*[www:close]\\$3
. \}
. \}
. \}
@@ -480,7 +480,7 @@ www functionality. It should work with any macro set.
width=\\n[www-width] height=\\n[www-height]>
. \}
. el \
-. nop \[la]\f[C]\\$1\f[]\[ra]
+. nop \\*[www:open]\f[\\*[www:fontstyle]]\\$1\f[]\\*[www:close]
..
.
.\" --------------------------------------------------------------------
@@ -1324,11 +1324,35 @@ www functionality. It should work with any macro set.
. \}
..
.
+.\" --------------------------------------------------------------------
+.\" LINKSTYLE color [ fontstyle [ openglyph closeglyph ] ]
+.\"
+.\" Initializes www.tmac so that when this macro set is used with
+.\" non html devices the urls are rendered the user defined attributes.
+.\" For example:
+.\"
+.\" LINKSTYLE blue CR < >
+.\"
+.de LINKSTYLE
+. if (\\n[.$] < 1) \
+. www:error .\\$0 expects at least 1 argument.
+. ds www:color \\$1
+. shift
+. if (\\n[.$] < 1) .return
+. ds www:fontstyle \\$1
+. shift
+. if (\\n[.$] < 1) \
+. www:error .\\$0 expects that both the open and close glyph is specified
+. ds www:open \\$1
+. ds www:close \\$2
+..
.
.\" --------------------------------------------------------------------
.\" Final Setup
.\" --------------------------------------------------------------------
.
+.LINKSTYLE blue C \[la] \[ra]
+.
.if \n[www-html] \{\
. nh
. nr HY 0