How to use the asciidoctor-opal-runtime.Opal function in asciidoctor-opal-runtime

To help you get started, we’ve selected a few asciidoctor-opal-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github asciidoctor / asciidoctor.js / packages / core / src / template-asciidoctor-node.js View on Github external
/* global Opal, Asciidoctor, ASCIIDOCTOR_JS_VERSION */
const Opal = require('asciidoctor-opal-runtime').Opal

// Node module
;(function (root, factory) {
  module.exports = factory
}(this, function (moduleConfig) {
//{{asciidoctorCode}}

//{{asciidoctorAPI}}

//{{asciidoctorVersion}}

  /**
   * Get Asciidoctor.js version number.
   *
   * @memberof Asciidoctor
   * @returns {string} - returns the version number of Asciidoctor.js.
github asciidoctor / asciidoctor.js / src / template-asciidoctor-umd.js View on Github external
if (typeof Opal === 'undefined' && typeof module === 'object' && module.exports) {
  Opal = require('asciidoctor-opal-runtime').Opal
}

if (typeof Opal === 'undefined') {
//{{opalCode}}
}

// UMD Module
(function (root, factory) {
  if (typeof module === 'object' && module.exports) {
    // Node. Does not work with strict CommonJS, but
    // only CommonJS-like environments that support module.exports,
    // like Node.
    module.exports = factory
  } else if (typeof define === 'function' && define.amd) {
    // AMD. Register a named module.
    define('asciidoctor', ['module'], function (module) {
github asciidoctor / asciidoctor.js / packages / core / spec / node / asciidoctor.spec.js View on Github external
const includeHttpsSpec = require('../share/asciidoctor-include-https-spec')
const semVer = require('../share/semver')

const config = {
  runtime: {
    platform: 'node',
    engine: 'v12',
    framework: 'lollipop'
  }
}

const isWin = process.platform === 'win32'

const asciidoctor = require('../../build/asciidoctor-node.js')(config)

const Opal = require('asciidoctor-opal-runtime').Opal // for testing purpose only
const packageJson = require('../../package.json')

const asciidoctorCoreSemVer = semVer(asciidoctor.getCoreVersion())
const testOptions = {
  platform: 'Node.js',
  baseDir: path.join(__dirname, '..', '..'),
  coreVersion: asciidoctorCoreSemVer
}

shareSpec(testOptions, asciidoctor, expect)
includeHttpsSpec(testOptions, asciidoctor, expect)

function fileExists (path) {
  try {
    fs.statSync(path)
    return true