asciidoctor / asciidoctor-extensions-lab

A lab for testing and demonstrating Asciidoctor extensions. Please do not use this code in production. If you want to use one of these extensions in your application, create a new project, import the code, and distribute it as a RubyGem. You can then request to make it a top-level project under the Asciidoctor organization.
Other
104 stars 101 forks source link

ChartBlockMacro weird output #43

Closed rahmanusta closed 9 years ago

rahmanusta commented 9 years ago

Hi,

I want to build chart-block-macro, after build I'm getting only

/* Generated by Opal 0.6.3 */
(function($opal) {
  var $a, $b, TMP_1, self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice;

  self.$require_relative("chart-block-macro/extension");
  return ($a = ($b = $scope.Extensions).$register, $a._p = (TMP_1 = function(){var self = TMP_1._s || this, $a;

  if ((($a = self.$document()['$basebackend?']("html")) !== nil && (!$a._isBoolean || $a == true))) {
      return self.$block_macro($scope.ChartBlockMacro)
      } else {
      return nil
    }}, TMP_1._s = self, TMP_1), $a).call($b);
})(Opal);

What can be the reason?

ggrossetie commented 9 years ago

Hi,

I'm also working on cross compiling this extension to JavaScript. See https://github.com/asciidoctor/asciidoctor.js/issues/97

I made good progress but c3js is not compatible with Opal (c3js is trying to call bind function on Opal in a deep call stack).

To answer you question, Opal didn't resolve the require so you just have the code that register the extension. I made changes to resolve that issue, are you using the latest version (master up to date) ?

Guillaume Le 2 avr. 2015 18:32, "Rahman Usta" notifications@github.com a écrit :

Hi,

I want to build chart-block-macro, after build I'm getting only

/* Generated by Opal 0.6.3 */ (function($opal) { var $a, $b, TMP_1, self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice;

self.$require_relative("chart-block-macro/extension"); return ($a = ($b = $scope.Extensions).$register, $a._p = (TMP_1 = function(){var self = TMP_1._s || this, $a;

if ((($a = self.$document()'$basebackend?') !== nil && (!$a._isBoolean || $a == true))) { return self.$block_macro($scope.ChartBlockMacro) } else { return nil }}, TMP_1._s = self, TMP_1), $a).call($b); })(Opal);

What can be the reason?

— Reply to this email directly or view it on GitHub https://github.com/asciidoctor/asciidoctor-extensions-lab/issues/43.

rahmanusta commented 9 years ago

Thanks @Mogztter . I updated local master, and now eveything is OK.