Skip to content

ctangel/RevealEditor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Reveal Editor

An editor for coding demonstrations designed for the HTML presentation platform reveals.js.

The editor will allow for Javascript, HTML, and CSS coding without ever exiting the fullscreen presentation.

The editor was designed to be used with reveal.js, it does not need reveal.js to function.

Checkout the demo!

Dependencies

It does depend on jQuery and Ace Editor. Ace requires the entire contents of the src-noconflict folder.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> 
<script src="src-noconflict/ace.js"></script> 

Instructions

To properly install the plugin, you must add the style.css file and plugin.js file to your html document. Create an element, such as a button, that you will select to and call the plugin's function on.

<head>
    <link rel="stylesheet" href="style.css">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
    <script src="revealeditor.js"></script>
</head>
<body>
    <a class="btn"> Open </a>
</body>
<script>
    $(".btn").RevealEditor();
</script>

Copy Code on Slides

The editor allows you to copy any code you have on the current active slide into the active editor by pressing the Copy button.

To ensure that you properly copy your code, make sure your code is enclosed in a code tag like this:

<pre><code class="hljs js" data-trim contenteditable>
function multiply(a, b) {
    return a * b;
}

console.log(multiply(4, 5));
</code></pre>

Be sure to use the class 'js', 'html', or 'css' depending on the type of code contained in the pre-code block.

Options

By default Javascript, HTML, and CSS editors are enabled, but you can disable the ones you do not need. You also have access to change the theme of the Ace editor

    RevealEditor({
        aceTheme: "ace/theme/twilight",
        javascript: true,
        html: true,
        css: true,
        fontSize: 18
    });

If you want to make changes simply overwrite the default options like so:

    RevealEditor({
        aceTheme: "ace/theme/xcode",
        javascript: true,
        html: false,
        css: false,
        fontSize: 24
    });

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published