mirror of
https://github.com/deuill/grawkit.git
synced 2024-09-28 08:22:46 +00:00
Alex Palaistras
24d63cd8a9
Running `grawkit` locally can be a hassle for one-off tasks, and can be hard to iterate against when plotting graphs based on complex command-line descriptions. Given recent fixes for POSIX compatibility, this commit implements a basic web-based "playground"-style application that allows for entering command-line descriptions in an HTML textarea, and seeing the results (or errors) instantly. The playground application itself is built in Go (Awk itself would be insufficient for the throughput required, but may be investigated in the future), with the excellent GoAwk library providing parsing and execution duties, therefore making for a pure-Go implementation (other than Grawkit itself). Additional support for setting custom styling and an online deployment with Docker are forthcoming.
50 lines
1.7 KiB
Plaintext
50 lines
1.7 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en-us" class="no-js">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>Grawkit Playground</title>
|
|
<meta name="description" content="">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito">
|
|
|
|
<link rel="stylesheet" href="/css/normalize.css">
|
|
<link rel="stylesheet" href="/css/skeleton.css">
|
|
<link rel="stylesheet" href="/css/main.css">
|
|
</head>
|
|
|
|
<body>
|
|
<div class="content container">
|
|
<form action="/" method="post">
|
|
<div class="preview-header row">
|
|
<div class="column one-half">
|
|
<a href="/">
|
|
<span class="title">Grawkit<br>Playground</span>
|
|
<img src="/img/logo.png" alt="Grawkit Logo" class="logo">
|
|
</a>
|
|
</div>
|
|
<div class="column one-half">
|
|
<div class="action-buttons">
|
|
<button type="submit" name="generate" class="button" onclick="submitForm(this.form); return false;">Generate</button>
|
|
<button type="submit" name="download" class="button">Download</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="preview-content row">
|
|
<div class="column one-half">
|
|
<textarea name="content" class="editor">{{if .Content}}{{printf .Content}}{{else}}{{template "default-content.template"}}{{end}}</textarea>
|
|
</div>
|
|
<div class="column one-half">
|
|
<div id="generated" class="preview-generated">{{if .Preview}}{{printf .Preview}}{{else}}{{template "default-preview.template"}}{{end}}</div>
|
|
</div>
|
|
</div>
|
|
<div class="preview-footer">
|
|
<div id="error" class="error">{{if .Error}}{{printf .Error}}{{end}}</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<script src="/js/main.js"></script>
|
|
</body>
|
|
</html>
|