forked from mholt/json-to-go
-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.html
79 lines (77 loc) · 2.81 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<head>
<title>YAML-to-Go: Convert YAML to Go instantly</title>
<meta charset="UTF-8">
<script src="resources/js/jquery.min.js"></script>
<script src="resources/js/highlight.min.js"></script>
<script src="resources/js/js-yaml.min.js"></script>
<script src="resources/js/yaml-to-go.js"></script>
<script src="resources/js/common.js"></script>
<script src="resources/js/gofmt.js" async></script>
<link rel="stylesheet" href="resources/css/tomorrow.highlight.css">
<link rel="stylesheet" href="resources/css/common.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-154900018-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-154900018-1');
</script>
</head>
<body>
<header>
<div class="intro">
<div class="title">
<h1>YAML-to-Go</h1>
<h2>Convert YAML to Go struct</h2>
</div>
<div>
<p>
This tool instantly converts YAML into a Go type definition. Paste a YAML structure on the left and the equivalent Go type will be generated to the right, which you can paste into your program. The script has to make some assumptions, so double-check the output!
</p>
<p>
For an example, try converting YAML from the <a href="javascript:" id="sample1">.gitlab-ci.yml</a> or the <a href="javascript:" id="sample2">GCP Node.js startup script sample</a>.
</p>
<p>
© 2019 <a href="https://github.com/Zhwt">Zhwt</a>
• <a href="https://github.com/Zhwt/yaml-to-go">View on GitHub</a>
<!-- • <a href="javascript:" id="dark">Dark mode</a> -->
</p>
</div>
<div>
<img src="resources/images/yaml-to-go.png" id="brand">
</div>
</div>
</header>
<table>
<tr>
<th style="width: 45%;">YAML</th>
<th style="width: 10%; font-size: 22px;">→</th>
<th style="width: 45%;">Go <span class="copy" id="copy-btn">Copy to clipboard</span></th>
</tr>
<tr>
<th style="width: 50%;"><label>Go type name: </label><input type="text" id="struct" placeholder="AutoGenerated"></th>
<th></th>
<th style="width: 50%;"><label><input type="checkbox" id="inline" checked>Inline type definitions</label></th>
</tr>
</table>
<table>
<tr>
<td style="width: 50%;">
<textarea id="input" style="box-sizing: border-box;"></textarea>
</td>
<td style="width: 50%;">
<div id="output"></div>
</td>
</tr>
</table>
<footer>
© 2019 Zhwt<br />
Forked from Matt Holt's <a href="https://github.com/mholt/json-to-go/">json-to-go</a>
<br>
The Go Gopher artwork is a derivative of that by Renee French.
</footer>
</body>
</html>