1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-11 13:25:37 +02:00

Add info block.

This commit is contained in:
Alec Thomas 2019-07-16 22:08:09 +10:00
parent aa71d61cc0
commit c86a26959c
2 changed files with 15 additions and 3 deletions

View File

@ -11,6 +11,13 @@ document.addEventListener("DOMContentLoaded", function () {
var output = document.getElementById("output");
var htmlCheckbox = document.getElementById("html");
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
$notification = $delete.parentNode;
$delete.addEventListener('click', () => {
$notification.parentNode.removeChild($notification);
});
});
function debounce(func, wait, immediate) {
var timeout;
return function () {

View File

@ -9,8 +9,7 @@
}
#output {
{{.Background}}
{{.Background}};
overflow-x: scroll;
}
@ -22,10 +21,16 @@
</head>
<body>
<div class="container">
<div class="notification is-hidden"></div>
<h1 class="title">Chroma Playground</h1>
<div class="notification is-info">
<button class="delete"></button>
<a href="https://github.com/alecthomas/chroma">Chroma</a> is a general purpose syntax highlighter in pure Go.
It takes source code and other structured text and converts it into syntax highlighted HTML, ANSI-coloured text,
etc. Chroma is based heavily on Pygments, and includes translators for Pygments lexers and styles.
</div>
<form id="chroma" method="post">
{{ .CSRFField }}
<div class="columns">