Code Monkey home page Code Monkey logo

revealeditor's Introduction

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
    });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.