110 lines
3.1 KiB
HTML
110 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Tree Sitter HCL Playground</title>
|
|
<style>
|
|
#playground-container {
|
|
max-width: 640px;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
|
|
#playground-container .CodeMirror {
|
|
border: 1px solid;
|
|
}
|
|
|
|
#create-issue-btn {
|
|
padding: 0.2em;
|
|
float: right;
|
|
font-size: 1.5em;
|
|
}
|
|
|
|
#checkboxes {
|
|
padding-bottom: 1em;
|
|
}
|
|
|
|
#output-container {
|
|
border: 1px solid;
|
|
}
|
|
|
|
.highlight {
|
|
background-color: #f8f8f8;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<!--
|
|
This file is licensed under MIT license
|
|
Taken from https://github.com/tree-sitter/tree-sitter/blob/master/docs/src/7-playground.md
|
|
-->
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.19.0/clusterize.min.css">
|
|
|
|
<h1>Tree Sitter HCL Playground</h1>
|
|
|
|
<div id="playground-container" class="ts-playground" style="visibility: hidden;">
|
|
<h2>Code</h2>
|
|
|
|
<div class="custom-select">
|
|
<button id="language-button" class="select-button">
|
|
<span class="selected-value">JavaScript</span>
|
|
<svg class="arrow" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
</svg>
|
|
</button>
|
|
<div class="select-dropdown">
|
|
<div class="option" data-value="hcl">HCL</div>
|
|
</div>
|
|
<select id="language-select" style="display: none;">
|
|
<option value="hcl">HCL</option>
|
|
</select>
|
|
</div>
|
|
|
|
<input id="logging-checkbox" type="checkbox"></input>
|
|
<label for="logging-checkbox">Log</label>
|
|
|
|
<input id="anonymous-nodes-checkbox" type="checkbox"></input>
|
|
<label for="anonymous-nodes-checkbox">Show anonymous nodes</label>
|
|
|
|
<input id="query-checkbox" type="checkbox"></input>
|
|
<label for="query-checkbox">Query</label>
|
|
|
|
<input id="accessibility-checkbox" type="checkbox"></input>
|
|
<label for="accessibility-checkbox">Accessibility</label>
|
|
|
|
<textarea id="code-input">
|
|
example "test" {
|
|
foo = "bar"
|
|
}
|
|
</textarea>
|
|
|
|
<div id="query-container" style="visibility: hidden; position: absolute;">
|
|
<h2>Query</h2>
|
|
<textarea id="query-input"></textarea>
|
|
</div>
|
|
|
|
<h2>Tree</h2>
|
|
<span id="update-time"></span>
|
|
<div id="output-container-scroll">
|
|
<pre id="output-container" class="highlight"></pre>
|
|
</div>
|
|
<button id="create-issue-btn" type="button">Create Issue</button>
|
|
</div>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js"></script>
|
|
<script id="playground-script" src="./playground.js?v=3"></script>
|
|
|
|
<script type="module">
|
|
import * as TreeSitter from './vendor/web-tree-sitter.js';
|
|
window.TreeSitter = TreeSitter;
|
|
setTimeout(() => window.initializePlayground({ local: false }), 1);
|
|
</script>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.19.0/clusterize.min.js"></script>
|
|
</body>
|
|
|
|
</html> |