UNPKG

3 kBHTMLView Raw
1<!DOCTYPE html>
2<html>
3<head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <style type="text/css">
6 /*
7 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
8 Code licensed under the BSD License:
9 http://developer.yahoo.com/yui/license.html
10 version: 3.2.0
11 build: 2676
12 */
13 html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
14
15 /*
16 * Custom styles
17 */
18 body {
19 width: 100%;
20 overflow: hidden;
21 }
22 #parse {
23 border: none;
24 background-color: white;
25 color: black;
26 z-index: 3;
27 position: absolute;
28 right: 50%;
29 top: 0;
30 width: 100px;
31 }
32 #yaml {
33 color: white;
34 background-color: black;
35 font-family: "Courier New";
36 font-size: 14px;
37 width: 50%;
38 border: none;
39 position: absolute;
40 top: 0;
41 left: 0;
42 z-index: 1;
43 height: 100%;
44 }
45 #result {
46 color: black;
47 background-color: white;
48 font-family: "Courier New";
49 font-size: 12px;
50 width: 50%;
51 border: none;
52 position: absolute;
53 top: 0;
54 left: 50%;
55 overflow: auto;
56 z-index: 2;
57 height: 100%;
58 vertical-align: top;
59 overflow: auto;
60 }
61 #tests {
62 width: 50%;
63 border: none;
64 position: absolute;
65 top: 0;
66 left: 50%;
67 z-index: 2;
68 }
69 </style>
70
71 <!-- standalone yaml.js library -->
72 <script type="text/javascript" src="../dist/yaml.debug.js"></script>
73
74 <title>yaml.js demo</title>
75</head>
76
77<body>
78<form action="" onsubmit="return false;">
79 <textarea name="yaml" id="yaml" cols="70" rows="20">--- !clarkevans.com/^invoice
80invoice: 34843
81date : 2001-01-23
82bill-to: &amp;id001
83 given : Chris
84 family : Dumars
85 address:
86 lines: |
87 458 Walkman Dr.
88 Suite #292
89 city : Royal Oak
90 state : MI
91 postal : 48046
92ship-to: *id001
93product:
94 - sku : &quot;BL394D&quot;
95 quantity : 4
96 description : Basketball
97 price : 450.00
98 - sku : BL4438H
99 quantity : 1
100 description : Super Hoop
101 price : 2392.00
102tax : 251.42
103total: 4443.52
104comments: &gt;
105 Late afternoon is best.
106 Backup contact is Nancy
107 Billsmer @ 338-4338.
108</textarea>
109<input type="button" id="parse" name="parse" value="Parse &raquo;" onclick="document.getElementById('result').innerHTML='<pre>'+JSON.stringify(YAML.parse(document.getElementById('yaml').value), null, 4)+'</pre>'" />
110<div id="result"></div>
111
112</form>
113</body>
114</html>
\No newline at end of file