Mercurial
comparison .cms/lib/codemirror/mode/pig/index.html @ 0:78edf6b517a0 draft
24.10
author | Coffee CMS <info@coffee-cms.ru> |
---|---|
date | Fri, 11 Oct 2024 22:40:23 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:78edf6b517a0 |
---|---|
1 <!doctype html> | |
2 <title>CodeMirror: Pig Latin mode</title> | |
3 <meta charset="utf-8"/> | |
4 <link rel=stylesheet href="../../doc/docs.css"> | |
5 | |
6 <link rel="stylesheet" href="../../lib/codemirror.css"> | |
7 <script src="../../lib/codemirror.js"></script> | |
8 <script src="pig.js"></script> | |
9 <style>.CodeMirror {border: 2px inset #dee;}</style> | |
10 <div id=nav> | |
11 <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a> | |
12 | |
13 <ul> | |
14 <li><a href="../../index.html">Home</a> | |
15 <li><a href="../../doc/manual.html">Manual</a> | |
16 <li><a href="https://github.com/codemirror/codemirror5">Code</a> | |
17 </ul> | |
18 <ul> | |
19 <li><a href="../index.html">Language modes</a> | |
20 <li><a class=active href="#">Pig Latin</a> | |
21 </ul> | |
22 </div> | |
23 | |
24 <article> | |
25 <h2>Pig Latin mode</h2> | |
26 <form><textarea id="code" name="code"> | |
27 -- Apache Pig (Pig Latin Language) Demo | |
28 /* | |
29 This is a multiline comment. | |
30 */ | |
31 a = LOAD "\path\to\input" USING PigStorage('\t') AS (x:long, y:chararray, z:bytearray); | |
32 b = GROUP a BY (x,y,3+4); | |
33 c = FOREACH b GENERATE flatten(group) as (x,y), SUM(group.$2) as z; | |
34 STORE c INTO "\path\to\output"; | |
35 | |
36 -- | |
37 </textarea></form> | |
38 | |
39 <script> | |
40 var editor = CodeMirror.fromTextArea(document.getElementById("code"), { | |
41 lineNumbers: true, | |
42 indentUnit: 4, | |
43 mode: "text/x-pig" | |
44 }); | |
45 </script> | |
46 | |
47 <p> | |
48 Simple mode that handles Pig Latin language. | |
49 </p> | |
50 | |
51 <p><strong>MIME type defined:</strong> <code>text/x-pig</code> | |
52 (PIG code) | |
53 </article> |