41 lines
1.7 KiB
HTML
41 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="color-scheme" content="light dark">
|
|
<title>Golines Playground - Tools</title>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
|
<link rel="stylesheet" href="style.css">
|
|
</head>
|
|
<body class="container">
|
|
<header><hgroup>
|
|
<h1>Golines Playground</h1>
|
|
<p>Format Go code with <a href="https://github.com/golangci/golines">golines</a>. Everything runs in your browser.</p>
|
|
</hgroup></header>
|
|
<main>
|
|
<label for="max-len">Maximum line width: <output id="width-value" for="max-len">100</output></label>
|
|
<input id="max-len" type="range" min="40" max="180" step="5" value="100" disabled aria-describedby="config">
|
|
<p id="config"><small>Tab width: <span id="tab-value">4</span>. Comment shortening, struct tag formatting, and splitting method chains at dots are enabled.</small></p>
|
|
<div class="grid">
|
|
<div>
|
|
<label for="source">Go source</label>
|
|
<textarea id="source" spellcheck="false" autocapitalize="off" autocomplete="off" disabled aria-describedby="message">package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
fmt.Println("Hello from golines!", "Move the slider to explore how longer function calls are formatted.")
|
|
}
|
|
</textarea>
|
|
</div>
|
|
<div>
|
|
<label for="output">Formatted output</label>
|
|
<textarea id="output" readonly spellcheck="false" aria-label="Formatted output"></textarea>
|
|
</div>
|
|
</div>
|
|
<p id="message" role="status" aria-live="polite">Loading formatter…</p>
|
|
</main>
|
|
<script src="main.js" type="module"></script>
|
|
</body>
|
|
</html>
|