merchant-frontend-examples

ZZZ: Inactive/Deprecated
Log | Files | Refs

syntax.texi (987B)


      1 @c Syntax highlighting for texinfo's HTML output
      2 
      3 @html
      4 <script src="highlight.pack.js"></script>
      5 <script>
      6 var hls = [];
      7 var syntaxAuto = true;
      8 addEventListener("DOMContentLoaded", function() {
      9   // Highlight blocks with fixed language
     10   for (let x of hls) {
     11     let next = x[0].nextElementSibling;
     12     let blocks = next.querySelectorAll("pre.example, pre.smallexample");
     13     for (let i = 0; i < blocks.length; i++) {
     14       blocks[i].classList.add("language-" + x[1]);
     15       hljs.highlightBlock(blocks[i]);
     16     }
     17   } 
     18   // auto-detect other blocks if not disabled
     19   if (syntaxAuto) {
     20     let blocks = document.querySelectorAll("pre.example, pre.smallexample");
     21     for (let i = 0; i < blocks.length; i++) {
     22       hljs.highlightBlock(blocks[i]);
     23     }
     24   }
     25 });
     26 </script>
     27 @end html
     28 
     29 @macro setsyntax{lang}
     30 @html
     31 <script>
     32 hls.push([document.currentScript, "\lang\"]);
     33 </script>
     34 @end html
     35 @end macro
     36 
     37 @macro setsyntaxnoauto{}
     38 @html
     39 <script>
     40 syntaxAuto = false;
     41 </script>
     42 @end html
     43 @end macro