openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

index.html (1764B)


      1 <!doctype html>
      2 
      3 <title>CodeMirror: NSIS mode</title>
      4 <meta charset="utf-8"/>
      5 <link rel=stylesheet href="../../doc/docs.css">
      6 
      7 <link rel=stylesheet href=../../lib/codemirror.css>
      8 <script src=../../lib/codemirror.js></script>
      9 <script src="../../addon/mode/simple.js"></script>
     10 <script src="../../addon/edit/matchbrackets.js"></script>
     11 <script src=nsis.js></script>
     12 <style type=text/css>
     13   .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
     14 </style>
     15 <div id=nav>
     16   <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
     17 
     18   <ul>
     19     <li><a href="../../index.html">Home</a>
     20     <li><a href="../../doc/manual.html">Manual</a>
     21     <li><a href="https://github.com/codemirror/codemirror">Code</a>
     22   </ul>
     23   <ul>
     24     <li><a href="../index.html">Language modes</a>
     25     <li><a class=active href="#">NSIS</a>
     26   </ul>
     27 </div>
     28 
     29 <article>
     30 <h2>NSIS mode</h2>
     31 
     32 
     33 <textarea id=code>
     34 ; This is a comment
     35 !ifdef ERROR
     36     !error "Something went wrong"
     37 !endif
     38 
     39 OutFile "demo.exe"
     40 RequestExecutionLevel user
     41 SetDetailsPrint listonly
     42 
     43 !include "LogicLib.nsh"
     44 !include "WinVer.nsh"
     45 
     46 Section -mandatory
     47 
     48     Call logWinVer
     49 
     50     ${If} 1 > 0
     51       MessageBox MB_OK "Hello world"
     52     ${EndIf}
     53 
     54 SectionEnd
     55 
     56 Function logWinVer
     57 
     58     ${If} ${IsWin10}
     59         DetailPrint "Windows 10!"
     60     ${ElseIf} ${AtLeastWinVista}
     61         DetailPrint "We're post-XP"
     62     ${Else}
     63         DetailPrint "Legacy system"
     64     ${EndIf}
     65 
     66 FunctionEnd
     67 </textarea>
     68 
     69 <script>
     70   var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
     71     mode: 'nsis',
     72     indentWithTabs: true,
     73     smartIndent: true,
     74     lineNumbers: true,
     75     matchBrackets: true
     76   });
     77 </script>
     78 
     79 <p><strong>MIME types defined:</strong> <code>text/x-nsis</code>.</p>
     80 </article>