summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2018-04-05 07:54:01 -0400
committerGraham Christensen <graham@grahamc.com>2018-04-05 07:54:01 -0400
commit8f33464ca7a603301cf9a5a213be23ca701d6cce (patch)
treeb524e95295d498a5241d04b977ec12b03769bf96 /pkgs
parentced3a201e39397f5c7a311d40525088494ea7808 (diff)
downloadnixpkgs-8f33464ca7a603301cf9a5a213be23ca701d6cce.tar
nixpkgs-8f33464ca7a603301cf9a5a213be23ca701d6cce.tar.gz
nixpkgs-8f33464ca7a603301cf9a5a213be23ca701d6cce.tar.bz2
nixpkgs-8f33464ca7a603301cf9a5a213be23ca701d6cce.tar.lz
nixpkgs-8f33464ca7a603301cf9a5a213be23ca701d6cce.tar.xz
nixpkgs-8f33464ca7a603301cf9a5a213be23ca701d6cce.tar.zst
nixpkgs-8f33464ca7a603301cf9a5a213be23ca701d6cce.zip
nixos docs: syntax highlight
 - Rectifies diverging CSS by combining
   nixos/nixpkgs docs CSS
 - Moves our custom Highlight.js loader in to
   the hljs package
 - Switches the nixos docs to use SVG
   callouts too
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/misc/documentation-highlighter/loader.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkgs/misc/documentation-highlighter/loader.js b/pkgs/misc/documentation-highlighter/loader.js
new file mode 100644
index 00000000000..4ad7dbf24b5
--- /dev/null
+++ b/pkgs/misc/documentation-highlighter/loader.js
@@ -0,0 +1,7 @@
+/* This file is NOT part of highlight.js */
+document.onreadystatechange = function () {
+    var listings = document.querySelectorAll('.programlisting, .screen');
+    for (i = 0; i < listings.length; ++i) {
+        hljs.highlightBlock(listings[i]);
+    }
+}