nchammas commented on code in PR #59547:
URL: https://github.com/apache/spark/pull/59547#discussion_r4334264838


##########
docs/_layouts/global.html:
##########
@@ -196,7 +196,18 @@ <h1 class="title">{{ page.title }}</h1>
         <script src="{{ rel_path_to_root }}js/vendor/jquery.min.js"></script>
         <script src="{{ rel_path_to_root 
}}js/vendor/bootstrap.bundle.min.js"></script>
 
-        <script src="{{ rel_path_to_root }}js/vendor/anchor.min.js"></script>
+        <script src="{{ rel_path_to_root }}js/vendor/anchor.min.js">
+            // Keep the version of AnchorJS used here in sync with what's used 
on the main website.
+            // See: 
https://github.com/apache/spark-website/blob/asf-site/js/vendor/anchor.min.js
+        </script>
+        <script>
+            // Display anchor links when hovering over headings.
+            // See: https://www.bryanbraun.com/anchorjs/
+            anchors.options = { placement: 'right' };
+            // Note: AnchorJS 4.0+ excludes h1 from the default selector, but 
many
+            // Spark doc pages use h1 for section headings, so we include it 
explicitly.
+            anchors.add('h1, h2, h3, h4, h5, h6');

Review Comment:
   Addressed. I used the more modern `:is` CSS selector here, as it's cleaner. 
Any browser released since early 2021 will support it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to