Skip to content

Instantly share code, notes, and snippets.

@ggrossetie
Created December 8, 2017 08:32
Show Gist options
  • Save ggrossetie/7d0ccc3a92dd1773837cc72faf356242 to your computer and use it in GitHub Desktop.
Save ggrossetie/7d0ccc3a92dd1773837cc72faf356242 to your computer and use it in GitHub Desktop.
Deep dive, build Asciidictor.js introduction

Asciidoctor.js is a JavaScript port of Asciidoctor. With asciidoctor.js, the {asciidoc}[AsciiDoc] syntax can be used in the browser!

Introduction

The {asciidoctorjs-git}[asciidoctor.js project] is a direct port of Asciidoctor from Ruby to JavaScript using the {opal}[Opal] Ruby-to-JavaScript cross compiler. It consists of a Rake build script that executes the Opal compiler on the Asciidoctor source code to produce the asciidoctor.js script.

Opal parses the Ruby code and any required libraries, then rewrites the code into JavaScript under the Opal namespace. The resulting JavaScript can be executed within any JavaScript runtime environment (such as a browser).

To interact with the generated code, you either invoke the JavaScript APIs directly, or you can invoke native JavaScript objects from within the Ruby code prior to compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment