From 5cf27cf1ad4bd072c995c4fd8f353a6351c94e1f Mon Sep 17 00:00:00 2001
From: Mark Wooding <mdw@distorted.org.uk>
Date: Sat, 3 Aug 2019 16:17:48 +0100
Subject: [PATCH] doc/sod.sty: Highlight hyperlinks to descriptions better.

Make the name itself be a link, and highlight `page' as part of the page
link.
---
 doc/sod.sty | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/doc/sod.sty b/doc/sod.sty
index 65dc7a1..48f07e7 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -369,10 +369,16 @@
 \def\descref#1{\@ifnextchar[{\descref@i{#1}}{\descref@ii{#1}{}}}
 \def\descref@i#1[#2]{\descref@ii{#1}{ #2}}
 \def\descref@ii#1#2#3{%
-  \code{#1}#2 (page~%
-  {\let\protect\@empty%
-   \def\@uscore{-\@gobble}\edef\@tempa{\noexpand\pageref{#3:#1}}\@tempa}%
-  )%
+  \begingroup%
+    \let\protect\@empty%
+    \def\@uscore{-\@gobble}%
+    \edef\@tempa##1{%
+      \endgroup%
+      \noexpand\hyperref[#3:#1]%
+      ##1%
+      \noexpand\autopageref{#3:#1}%
+    }%
+  \@tempa{{\code{#1}}#2 (})%
 }
 
 %%%----- That's all, folks --------------------------------------------------
-- 
2.11.0

