Skip to content

Instantly share code, notes, and snippets.

@rafaelcamargo
Created November 14, 2023 21:11
Show Gist options
  • Save rafaelcamargo/02a8a9fc00f5ca9bb6a3494cb5e95e2e to your computer and use it in GitHub Desktop.
Save rafaelcamargo/02a8a9fc00f5ca9bb6a3494cb5e95e2e to your computer and use it in GitHub Desktop.
Glorious Demo Multi-line Command
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multi-line Command</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@glorious/demo/dist/gdemo.min.css">
<script src="https://cdn.jsdelivr.net/npm/@glorious/demo/dist/gdemo.min.js"></script>
<style>
.container {
margin: 20px auto;
max-width: 500px;
}
</style>
</head>
<body>
<div id="demo-container" class="container"></div>
<script>
(function () {
const demo = new GDemo('#demo-container');
demo
.openApp('terminal', {
minHeight: '350px',
windowTitle: 'terminal',
onCompleteDelay: 1000,
promptString: '$'
})
.command('curl \\')
.command('http://localhost:8008 \\', { promptString: '>' })
.command('--request POST \\')
.command('--header "Content-Type: application/json" \\')
.command('--data \'{"status": "ok"}\'', { onCompleteDelay: 500 })
.respond('OK')
.command('', { promptString: '$' })
.end();
}());
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment