-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
### Changed - Fix for fragment code blocks (@Toshizuki in #10)
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<title>CopyCode</title> | ||
<meta name="author" content="Martijn De Jongh (Martino)"> | ||
<link rel="icon" href="data:,"> | ||
<link rel="stylesheet" href="dist/reset.css"> | ||
<link rel="stylesheet" href="dist/reveal.css"> | ||
<link rel="stylesheet" href="dist/theme/black.css"> | ||
<link rel="stylesheet" href="plugin/highlight/monokai.css"> | ||
<link rel="stylesheet" href="assets/css/demo.css"> | ||
</head> | ||
<body> | ||
<div class="reveal"><a class="github-corner" href="https://github.com/martinomagnifico/reveal.js-copycode" target="blank" title="View source on GitHub"> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 55 55"> | ||
<path fill="currentColor" d="M27.5 11.2a16.3 16.3 0 0 0-5.1 31.7c.8.2 1.1-.3 1.1-.7v-2.8c-4.5 1-5.5-2.2-5.5-2.2-.7-1.9-1.8-2.4-1.8-2.4-1.5-1 .1-1 .1-1 1.6.1 2.5 1.7 2.5 1.7 1.5 2.5 3.8 1.8 4.7 1.4.2-1 .6-1.8 1-2.2-3.5-.4-7.3-1.8-7.3-8 0-1.8.6-3.3 1.6-4.4-.1-.5-.7-2.1.2-4.4 0 0 1.4-.4 4.5 1.7a15.6 15.6 0 0 1 8.1 0c3.1-2 4.5-1.7 4.5-1.7.9 2.3.3 4 .2 4.4 1 1 1.6 2.6 1.6 4.3 0 6.3-3.8 7.7-7.4 8 .6.6 1.1 1.6 1.1 3v4.6c0 .4.3.9 1.1.7a16.3 16.3 0 0 0-5.2-31.7"></path> | ||
</svg></a> | ||
<div class="slides"> | ||
<section> | ||
<h1>CopyCode</h1> | ||
<h3>for Reveal.js</h3> | ||
<p class="small">Customized copy button</p> | ||
<pre><code class="hljs javascript" data-line-numbers style="font-size: 1em">let why = `Because we always want to copy code | ||
during our presentations, right?`</code></pre> | ||
</section> | ||
<section> | ||
<h3>Configuring CopyCode</h3> | ||
<pre><code class="hljs javascript">copycode: { timeout: 1200, button: "hover", display: "icons", style: { copybg: "rgba(255,255,255,128)", copiedbg: "white", copyborder: "2px solid gray", copiedborder: "2px solid green", copiedcolor: "green", offset: 0.5, radius: 0.2} }</code></pre> | ||
<p class="small">Add the above code to the Reveal.js configuration, and you will get a 'GitHub-flavored' copy button.</p> | ||
</section> | ||
<section> | ||
<p>This is just an example file to show a customized copy button. For more CopyCode options, check the <a href="demo.html">demo</a>.</p> | ||
</section> | ||
</div> | ||
</div> | ||
<script src="dist/reveal.js"></script> | ||
<script src="plugin/highlight/highlight.js"></script> | ||
<script src="plugin/copycode/copycode.js"></script> | ||
<script> | ||
// Get the deck | ||
const deck = document.querySelector(".reveal"); | ||
|
||
// Define the plugins (Using strings) | ||
let plugins = ["CopyCode", "RevealHighlight"]; | ||
|
||
// Check the plugins | ||
const pluginCheck = (plugs) => plugs.reduce((a, p) => typeof window[p] === "function" ? (a.push(window[p]), a) : (console.warn(`Plugin "${p}" does not exist.`), a), []); | ||
|
||
let revealdeck = new Reveal(deck); | ||
revealdeck.initialize({ | ||
history: true, | ||
overview: false, | ||
center: true, | ||
margin: 0.15, | ||
controlsTutorial: false, | ||
copycode: { timeout: 1200, button: "always", display: "icons", style: { copybg: "rgba(255,255,255,128)", copiedbg: "white", copyborder: "2px solid gray", copiedborder: "2px solid green", copiedcolor: "green", offset: 0.5, radius: 0.2} }, | ||
plugins: pluginCheck(plugins) | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/***************************************************************** | ||
* | ||
* CopyCode for Reveal.js | ||
* Version 1.1.7 | ||
* Version 1.1.8 | ||
* | ||
* @author: Martijn De Jongh (Martino), [email protected] | ||
* https://github.com/martinomagnifico | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.