doc: Make HTML ids discoverable
authorPeter Eisentraut
Thu, 13 Apr 2023 08:15:20 +0000 (10:15 +0200)
committerPeter Eisentraut
Thu, 13 Apr 2023 08:16:33 +0000 (10:16 +0200)
In the HTML output, this decorates section headers and variable list
terms with a marker ("#") that is a link to the same section/term.
That way, links inside a page can be discovered for easier sharing.
The marker only appears when hovering.

This now requires that all elements that are candidates for such a
link have an id attribute.  Otherwise, an error will be generated.
All previously missing ids have been added prior to this patch.

Author: Brar Piening 
Reviewed-by: Karl O. Pinc
Discussion: https://www.postgresql.org/message-id/flat/CAB8KJ=jpuQU9QJe4+RgWENrK5g9jhoysMw2nvTN_esoOU0=a_w@mail.gmail.com

doc/src/sgml/stylesheet-html-common.xsl
doc/src/sgml/stylesheet.css

index bb6429ef7cf63a0d4bfe91d40109feb883e3f5d9..a368e0e199087fa4b5e0c1fb6f82367cd60e07de 100644 (file)
@@ -309,4 +309,131 @@ set       toc,title
   
 
 
+
+
+
+
+
+  
+  
+  
+  
+  
+
+  
+    
+      
+      
+        
+          
+        
+      
+      
+      
+        
+          
+        
+      
+      
+        
+          
+        
+      
+    
+  
+
+  
+  
+    
+      
+      6
+      
+        
+      
+    
+  
+  
+    
+    
+      
+        clear: both
+      
+    
+    
+      
+        
+        
+      
+    
+    
+    
+    
+      
+    
+    
+  
+
+
+
+
+
+
+
+  
+
+  
+  
+    
+      
+    
+  
+
+
+
+
+
+  
+  
+    
+       
+      
+        
+          #
+          
+            
+          
+        
+        
+          id_link
+        
+        #
+    
+    
+      
+      
+                    or $object/parent::variablelist/varlistentry[@id]">
+        
+          ERROR: id attribute missing on <
+          
+          > element under 
+          
+            /
+            
+            
+              [@
+              
+               = '
+              
+              ']
+            
+          
+        
+      
+    
+  
+
+
 
index cc14efa1ca3ca10834940033a7b367bde287cd62..86a8edb9268709991e40591592508169ebbce4ab 100644 (file)
@@ -169,3 +169,14 @@ acronym        { font-style: inherit; }
     width: 75%;
   }
 }
+
+/* links to ids of headers and definition terms */
+
+a.id_link {
+   color: inherit;
+   visibility: hidden;
+}
+
+*:hover > a.id_link {
+   visibility: visible;
+}