index.html 1.7 KB

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