1. <!doctype html>
    
  2. <html>
    
  3. <head>
    
  4.   <title>Chroma Playground ({{.Version}})</title>
    
  5.   <style>
    
  6.     {{CSS "index.css"}}
    
  7.     #output {
    
  8.       {{.Background}};
    
  9.     }
    
  10.   </style>
    
  11. </head>
    
  12. <body>
    
  13. <div class="container">
    
  14. 
    
  15.   <h1 class="title">Chroma Playground ({{.Version}})</h1>
    
  16. 
    
  17.   <div class="notification">
    
  18.     <button class="delete"></button>
    
  19.     <a href="https://github.com/alecthomas/chroma">Chroma</a> is a general purpose syntax highlighter in pure Go.
    
  20.     It takes source code and other structured text and converts it into syntax highlighted HTML, ANSI-coloured text,
    
  21.     etc. Chroma is based heavily on Pygments, and includes translators for Pygments lexers and styles.
    
  22.   </div>
    
  23. 
    
  24.   <form id="chroma" method="post">
    
  25.     {{ .CSRFField }}
    
  26. 
    
  27.     <nav class="level">
    
  28.       
    
  29.       <div class="level-left">
    
  30.         <div class="level-item">
    
  31.           <div class="label">Code</div>
    
  32.         </div>
    
  33.         <div class="level-item">
    
  34.           <div class="control">
    
  35.             <div class="select">
    
  36.               <select name="language" id="language">
    
  37.                 <option value="" disabled{{if eq "" $.SelectedLanguage}} selected{{end}}>Language</option>
    
  38.                 {{- range .Languages}}
    
  39.                   <option value="{{.}}"{{if eq . $.SelectedLanguage}} selected{{end}}>{{.}}</option>
    
  40.                 {{- end}}
    
  41.               </select>
    
  42.             </div>
    
  43.           </div>
    
  44.         </div>
    
  45. 
    
  46.         <div class="level-item">
    
  47.           <div class="control">
    
  48.             <div class="select">
    
  49.               <select name="style" id="style">
    
  50.                 <option value="" disabled{{if eq "" $.SelectedStyle}} selected{{end}}>Style</option>
    
  51.                 {{- range .Styles}}
    
  52.                   <option value="{{.}}"{{if eq . $.SelectedStyle}} selected{{end}}>{{.}}</option>
    
  53.                 {{- end}}
    
  54.               </select>
    
  55.             </div>
    
  56.           </div>
    
  57.         </div>
    
  58.       </div>
    
  59. 
    
  60.       <div class="level-right">
    
  61.         <div class="level-item">
    
  62.             <button name="copy" id="copy" class="button">
    
  63.               <span class="icon is-small">
    
  64.                 <ion-icon name="copy-outline"></ion-icon>
    
  65.               </span>
    
  66.             </button>
    
  67.         </div>
    
  68.       </div>
    
  69.   </nav>
    
  70. 
    
  71.     <div class="field">
    
  72.       <div class="control">
    
  73.         <textarea autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="textarea" id="text" name="text" rows="15" cols="80"></textarea>
    
  74.       </div>
    
  75.     </div>
    
  76. 
    
  77.     <hr>
    
  78. 
    
  79.     <label class="checkbox is-pulled-right">
    
  80.       <input name="html" id="html" type="checkbox">
    
  81.       Show HTML
    
  82.     </label>
    
  83. 
    
  84.     <label class="label">
    
  85.       Output
    
  86.     </label>
    
  87. 
    
  88.     <div class="field box" id="output"></div>
    
  89.   </form>
    
  90. </div>
    
  91. <script type="module">
    
  92. {{JS "index.js"}}
    
  93. </script>
    
  94. <script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
    
  95. <script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
    
  96. </body>
    
  97. </html>