Giter Site home page Giter Site logo

asciidoctor / asciidoctor.js Goto Github PK

View Code? Open in Web Editor NEW
719.0 27.0 131.0 30.23 MB

:scroll: A JavaScript port of Asciidoctor, a modern implementation of AsciiDoc

Home Page: https://asciidoctor.org

License: MIT License

JavaScript 84.32% Ruby 6.83% Java 0.21% Shell 0.69% HTML 0.45% TypeScript 7.50%
asciidoc asciidoctor javascript hacktoberfest

asciidoctor.js's Introduction

Asciidoctor

Asciidoctor is a fast, open source, Ruby-based text processor for parsing AsciiDoc® into a document model and converting it to output formats such as HTML 5, DocBook 5, manual pages, PDF, EPUB 3, and other formats.

Asciidoctor also has an ecosystem of extensions, converters, build plugins, and tools to help you author and publish content written in AsciiDoc. You can find the documentation for these projects at https://docs.asciidoctor.org.

In addition to running on Ruby, Asciidoctor can be executed on a JVM using AsciidoctorJ or in any JavaScript environment using Asciidoctor.js.

This document is also available in the following languages:
简体中文 | Deutsch | Français | 日本語

Latest Release library (API) docs Build Status (GitHub Actions) Project Chat (Zulip)

Sponsors

We want to recognize our sponsors for their commitment to improving the state of technical documentation by supporting this project. Thank you sponsors! Without your generous support, Asciidoctor would not be possible.

You can support this project by becoming a sponsor through OpenCollective.

AsciiDoc Processing and Built-in Converters

AsciiDoc is the language.
Asciidoctor is the processor.

Asciidoctor reads the AsciiDoc source, as shown in the panel on the left in the image below, and converts it to publishable formats, such as HTML 5, as shown rendered in the panel on the right.

Preview of AsciiDoc source and corresponding rendered HTML

Asciidoctor provides built-in converters for three output formats by default: HTML 5, DocBook 5, and man page (short for manual page). Additional converters, such as PDF and EPUB 3, are provided by separate gems. Asciidoctor also provides an out-of-the-box HTML experience complete with a default stylesheet and built-in integrations like Font Awesome (for icons), highlight.js, Rouge, and Pygments (for source highlighting), and MathJax (for STEM processing).

Asciidoctor Ecosystem

Although Asciidoctor is written in Ruby, it does not mean you need Ruby to use it. Asciidoctor can be executed on a JVM using AsciidoctorJ or in any JavaScript environment (including the browser) using Asciidoctor.js.

Installing an Asciidoctor processor is just the beginning of your publishing experience. Asciidoctor gives you access to a ecosystem of extensions and tools, ranging from add-on converters, to extended syntax, to build plugins, to integrated writing and preview environments:

Asciidoctor is the successor to AsciiDoc.py. If you’re using AsciiDoc.py, see Migrate from AsciiDoc.py to learn how to upgrade to Asciidoctor.

Requirements

Asciidoctor works on Linux, macOS and Windows and requires one of the following implementations of Ruby:

  • CRuby (aka MRI) 2.7 - 3.3

  • JRuby 9.2 - 9.4

  • TruffleRuby (GraalVM)

🔥

If you’re using a non-English Windows environment, you may bump into an Encoding::UndefinedConversionError when invoking Asciidoctor. To solve this issue, we recommend overriding the default external and internal character encodings to utf-8. You can do so by setting the RUBYOPT environment variable as follows:

RUBYOPT="-E utf-8:utf-8"

Once you make this change, all your Unicode headaches should be behind you.

If you’re using an IDE like Eclipse, make sure you set the encoding to UTF-8 there as well. Asciidoctor is optimized to work with UTF-8 as the default encoding.

Installation

Asciidoctor is packaged and distributed to RubyGems.org as a RubyGem (aka gem) named asciidoctor. The asciidoctor gem can be installed on all major operating systems using Ruby packaging tools (gem or bundle). Asciidoctor is also distributed as a Docker image, as a package for numerous Linux distributions, and as a package for macOS (via Homebrew and MacPorts).

Linux package managers

The version of Asciidoctor installed by the package manager may not match the latest release of Asciidoctor. Consult the package repository for your distribution to find out which version is packaged per distribution release.

If you want to use a version of Asciidoctor that’s newer than what is installed by the package manager, see the gem installation instructions.

apk (Alpine Linux)

To install the gem on Alpine Linux, open a terminal and type:

$ sudo apk add asciidoctor

pacman (Arch Linux)

To install the gem on Arch-based distributions, open a terminal and type:

$ sudo pacman -S asciidoctor

APT

On Debian and Debian-based distributions such as Ubuntu, use APT to install Asciidoctor. To install the package, open a terminal and type:

$ sudo apt-get install -y asciidoctor

DNF

On RPM-based Linux distributions, such as Fedora, CentOS, and RHEL, use the DNF package manager to install Asciidoctor. To install the package, open a terminal and type:

$ sudo dnf install -y asciidoctor

macOS

Homebrew

You can use Homebrew, the macOS package manager, to install Asciidoctor. If you don’t have Homebrew on your computer, complete the installation instructions first.

Once Homebrew is installed, you’re ready to install the asciidoctor gem. Open a terminal and type:

$ brew install asciidoctor

Homebrew installs the asciidoctor gem into an exclusive prefix that’s independent of system gems.

MacPorts

You can also use MacPorts, another package manager for macOS, to install Asciidoctor. If you don’t have MacPorts on your computer, complete the installation instructions first.

Once MacPorts is installed, you’re ready to install the asciidoctor gem via the Asciidoctor port. Open a terminal and type:

$ sudo port install asciidoctor

Windows

To use Asciidoctor with Windows, you have two options.

Chocolatey

When you already use chocolatey on your machine, you can use:

choco install ruby

Rubyinstaller

Or you use the Rubyinstaller, download the package for your Windows Version and after the installation go ahead with gem installation instructions.

gem install

Before installing Asciidoctor using gem install, you should set up RVM (or similar) to install Ruby in your home directory (i.e., user space). Then, you can safely use the gem command to install or update the Asciidoctor gem, or any other gem for that matter. When using RVM, gems are installed in a location isolated from the system. (You should never use the gem command to install system-wide gems).

Once you’ve installed Ruby using RVM, and you have activated it using rvm use 3.0, open a terminal and type:

$ gem install asciidoctor

If you want to install a pre-release version (e.g., a release candidate), use:

$ gem install asciidoctor --pre

Bundler

  1. Create a Gemfile in the root folder of your project (or the current directory)

  2. Add the asciidoctor gem to your Gemfile as follows:

    source 'https://rubygems.org'
    gem 'asciidoctor'
    # or specify the version explicitly
    # gem 'asciidoctor', '2.0.22'
  3. Save the Gemfile

  4. Open a terminal and install the gem using:

    $ bundle

To upgrade the gem, specify the new version in the Gemfile and run bundle again. Using bundle update (without specifying a gem) is not recommended as it will also update other gems, which may not be the desired result.

Upgrade

If you installed Asciidoctor using a package manager, your operating system is probably configured to automatically update packages, in which case you don’t need to update the gem manually.

apk (Alpine Linux)

To upgrade the gem, use:

$ sudo apk add -u asciidoctor

APT

To upgrade the gem, use:

$ sudo apt-get upgrade -y asciidoctor

DNF

To upgrade the gem, use:

$ sudo dnf update -y asciidoctor

Homebrew (macOS)

To upgrade the gem, use:

$ brew update
$ brew upgrade asciidoctor

MacPorts (macOS)

To upgrade the gem, use:

$ sudo port selfupdate
$ sudo port upgrade asciidoctor

gem install

If you previously installed Asciidoctor using the gem command, you’ll need to manually upgrade Asciidoctor when a new version is released. You can upgrade the gem by typing:

$ gem install asciidoctor

When you install a new version of the gem using gem install, you end up with multiple versions installed. Use the following command to remove the old versions:

$ gem cleanup asciidoctor

Usage

If the Asciidoctor gem installed successfully, the asciidoctor command line interface (CLI) will be available on your PATH. To verify it’s available, run the following in your terminal:

$ asciidoctor --version

You should see information about the Asciidoctor version and your Ruby environment printed in the terminal.

Asciidoctor 2.0.22 [https://asciidoctor.org]
Runtime Environment (ruby 3.0.1p64 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

Command line interface (CLI)

The asciidoctor command allows you to invoke Asciidoctor from the command line (i.e., a terminal).

The following command converts the file README.adoc to HTML and saves the result to the file README.html in the same directory. The name of the generated HTML file is derived from the source file by changing its file extension to .html.

$ asciidoctor README.adoc

You can control the Asciidoctor processor by adding various flags and switches, which you can learn about using:

$ asciidoctor --help

For instance, to write the file to a different directory, use:

$ asciidoctor -D output README.adoc

The asciidoctor man page provides a complete reference of the command line interface.

Refer to the following resources to learn more about how to use the asciidoctor command.

Ruby API

Asciidoctor also provides an API. The API is intended for integration with other Ruby software, such as Rails, GitHub, and GitLab, as well as other languages, such as Java (via AsciidoctorJ) and JavaScript (via Asciidoctor.js).

To use Asciidoctor in your application, you first need to require the gem:

require 'asciidoctor'

You can then convert an AsciiDoc source file to an HTML file using:

Asciidoctor.convert_file 'README.adoc', to_file: true, safe: :safe
⚠️
When using Asciidoctor via the API, the default safe mode is :secure. In secure mode, several core features are disabled, including the include directive. If you want to enable these features, you’ll need to explicitly set the safe mode to :server (recommended) or :safe.

You can also convert an AsciiDoc string to embeddable HTML (for inserting in an HTML page) using:

content = '_Zen_ in the art of writing https://asciidoctor.org[AsciiDoc].'
Asciidoctor.convert content, safe: :safe

If you want the full HTML document, enable the header_footer option as follows:

content = '_Zen_ in the art of writing https://asciidoctor.org[AsciiDoc].'
html = Asciidoctor.convert content, header_footer: true, safe: :safe

If you need access to the parsed document, you can split the conversion into discrete steps:

content = '_Zen_ in the art of writing https://asciidoctor.org[AsciiDoc].'
document = Asciidoctor.load content, header_footer: true, safe: :safe
puts document.doctitle
html = document.convert

Keep in mind that if you don’t like the output Asciidoctor produces, you can change it! Asciidoctor supports custom converters that can handle converting from the parsed document to the generated output.

One easy way to customize the output piecemeal is by using the template converter. The template converter allows you to supply a Tilt-supported template file to handle converting any node in the document.

However you go about it, you can have 100% control over the output. For more information about how to use the API or to customize the output, see:

Contributing

New contributors are always welcome! If you discover errors or omissions in the source code, documentation, or website content, please don’t hesitate to submit an issue or open a pull request with a fix.

Here are some ways you can contribute:

  • by using prerelease (alpha, beta or preview) versions

  • by reporting bugs

  • by suggesting new features

  • by writing or editing documentation

  • by writing code with tests — No patch is too small.

    • fix typos

    • add comments

    • clean up inconsistent whitespace

    • write tests!

  • by refactoring code

  • by fixing issues

  • by reviewing patches

The Contributing guide provides information on how to create, style, and submit issues, feature requests, code, and documentation to Asciidoctor.

Getting Help

Asciidoctor is developed to help you easily write and publish your content. But we can’t do it without your input. If you need assistance or want to provide feedback, please follow the links to the resources listed on the Get Help page in the docs. Here’s a quick summary:

Project chat (Zulip)

https://chat.asciidoctor.org

Discussion list (archived)

https://discuss.asciidoctor.org

Social media (Twitter)

Follow @asciidoctor or search the #asciidoctor hashtag

Further information and documentation about Asciidoctor can be found on the project’s website.

Home | News | Docs

The Asciidoctor organization on GitHub hosts the project’s source code, issue tracker, and sub-projects.

Code of Conduct

The core Asciidoctor project is governed by the Code of Conduct for the Asciidoctor community of projects. By participating, you’re agreeing to honor this code. Let’s work together to make this a welcoming, professional, inclusive, and safe environment for everyone.

Versioning and Release Policy

This project adheres to semantic versioning (major.minor.patch). Typically, patch releases are only made for the current minor release. However, exceptions are made on a case-by-case basis to address security vulnerabilities and other high-priority issues.

Copyright © 2012-present Dan Allen, Sarah White, Ryan Waldron, and the individual contributors to Asciidoctor. Use of this software is granted under the terms of the MIT License.

See the LICENSE for the full license text.

Authors

Asciidoctor is led by Dan Allen and Sarah White and has received contributions from many individuals in Asciidoctor’s awesome community. The project was initiated in 2012 by Ryan Waldron based on a prototype written by Nick Hengeveld for the Git website.

AsciiDoc.py was started and maintained by Stuart Rackham from 2002 to 2013 and has received contributions from many individuals in the AsciiDoc.py community.

Trademarks

AsciiDoc® and AsciiDoc Language™ are trademarks of the Eclipse Foundation, Inc.

Changelog

Refer to the CHANGELOG for a complete list of changes in older releases.

asciidoctor.js's People

Contributors

1602 avatar abelsromero avatar adambeynon avatar anthonny avatar benjaminleonard avatar bitpogo avatar brunchboy avatar cexbrayat avatar cm-wada-yusuke avatar cunka avatar dependabot-preview[bot] avatar dependabot[bot] avatar djencks avatar gastaldi avatar ggrossetie avatar henriette-einstein avatar jiakuan avatar jmini avatar kay-is avatar ldez avatar lucianbuzzo avatar mojavelinux avatar nawroth avatar rahmanusta avatar rayoffiah avatar s-leroux avatar sufuf3 avatar thetutlage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asciidoctor.js's Issues

includes does not work correctly

using asciidoc.js in nodejs

try-adoc.js:

'use strict';

var asciidoc = require('asciidoctor.js')();
var AsciiDoctor = asciidoc.Asciidoctor(true);
var html = AsciiDoctor.$convert('include::include.adoc[]', null);

console.log(html);

include.adoc:

hi, i am an include!
node try-doc.js
<div class="paragraph">
<p><a href="include.adoc">include.adoc</a></p>
</div>

hyperlink is not an include, what am i doing wrong?

Accessing document header attributes

I'm writing an asciidoc(tor.js) plugin for docpad. Any text-based document in Docpad can provide metadata using a YAML front matter, but I'd rather get this metadata from asciidoc's header attributes.

I've successfully parsed the document using adoc = Asciidoctor().Document.$new(contentString) and calling adoc.$render() on the result works nicely, but I can't find a way to get header attributes:

  • adoc.attributes and adoc.$attributes() only contain what seems to be configuration options
  • adoc.$header() returns Nil

Is there a way to access the header attributes from JavaScript? I'm not a rubyist so I could be missing something obvious.

Support deck.js backend

I guess supporting multiple backends would make sense, but I find the case of slides especially interesting to be able to render directly in the browser.

Possibly related to #5.

Problem with Russian Win7

When I try to open any AsciiDoc in Chrome I see:

Error:

TypeError : Cannot call method 'join' of null

The problem is in file opal.js:9392 and asciidoctor.js:2740 - the regular expression doesn`t include cyrillic symbols.

The line crush when try parse time zone written in Russian.

I think issue asciidoctor/asciidoctor-chrome-editor#1 caused by the same way.

Delimiters not created correctly in MathJax.Hub.Config

The asciidoctor.js generated MathJax.Hub.Config script block is incorrect and differs from the one created by Ruby Asciidoctor (tested with 1.5.0 and 1.5.1).

This node.js sample code

var asciidoctor = require('asciidoctor.js')();
var opal = asciidoctor.Opal;

var  processor = asciidoctor.Asciidoctor(true);

var content = ":stem: \nhttp://asciidoctor.org[*Asciidoctor*] " +
    "running on http://opalrb.org[_Opal_] " +
    "brings AsciiDoc to Node.js!";
var options = opal.hash2(
    ['doctype', 'header_footer'],
    {doctype: 'article', header_footer: true});
var html = processor.$convert(content, options);
console.log(html);

embeds this

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  tex2jax: {
    inlineMath: [\(,\)],
    displayMath: [\[,\]],
    ignoreClass: "nostem|nolatexmath"
  },
  asciimath2jax: {
    delimiters: [\$,\$],
    ignoreClass: "nostem|noasciimath"
  }
});
</script>

non-working configuration block into HTML.

The correct one created by Ruby Asciidoctor looks like this:

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  tex2jax: {
    inlineMath: [["\\(","\\)"]],
    displayMath: [["\\[","\\]"]],
    ignoreClass: "nostem|nolatexmath"
  },
  asciimath2jax: {
    delimiters: [["\\$","\\$"]],
    ignoreClass: "nostem|noasciimath"
  }
});
</script>

hash of attributes

More of a feature request/inquiry.

Is there a hash of the defined attributes available from js?

$opal.Object._scope.IO has no method $read

I try to convert an asciidoc file with the following parameters :

  var opts = Opal.hash2(['base_dir', 'safe', 'doctype', 'attributes', 'header_footer'], {
      'base_dir': folder,
      'safe': 'unsafe',
      'doctype': 'book',
      'attributes': 'platform=opal platform-opal env=browser env-browser',
      'header_footer': true
  });

I have the following error :

ata = (($b = $opal.Object._scope.IO) == null ? $opal.cm('IO') : $b).$read((($b
                                                                    ^
TypeError: undefined is not a function
    at $Stylesheets.module.exports.def.$primary_stylesheet_data (/home/anthonny/99-Projects/child-process/node_modules/asciidoctorjs-npm-wrapper/index.js:11280:179)
    at $Stylesheets.module.exports.def.$embed_primary_stylesheet (/home/anthonny/99-Projects/child-process/node_modules/asciidoctorjs-npm-wrapper/index.js:11286:36)
    at $Html5Converter.module.exports.def.$document (/home/anthonny/99-Projects/child-process/node_modules/asciidoctorjs-npm-wrapper/index.js:5464:44)
    at $Html5Converter.$opal.defn.TMP_1 (/home/anthonny/99-Projects/child-process/node_modules/asciidoctorjs-npm-wrapper/node_modules/opal-npm-wrapper/index.js:1793:21)
    at $Html5Converter.module.exports.def.$convert (/home/anthonny/99-Projects/child-process/node_modules/asciidoctorjs-npm-wrapper/index.js:4995:21)
    at $Document.module.exports.def.$convert (/home/anthonny/99-Projects/child-process/node_modules/asciidoctorjs-npm-wrapper/index.js:7613:35)
    at OpalModule.module.exports.self._proto.$convert (/home/anthonny/99-Projects/child-process/node_modules/asciidoctorjs-npm-wrapper/index.js:12385:22)
    at /home/anthonny/99-Projects/child-process/main.js:35:26
    at fs.js:291:14
    at Object.oncomplete (fs.js:97:15)

The problem occured in :

 def.$primary_stylesheet_data = function() {
    var $a, $b, self = this;
    return ((($a = self.primary_stylesheet_data) !== false && $a !== nil) ? $a : self.primary_stylesheet_data = (($b = $opal.Object._scope.IO) == null ? $opal.cm('IO') : $b).$read((($b = $opal.Object._scope.File) == null ? $opal.cm('File') : $b).$join($scope.STYLESHEETS_DATA_PATH, "asciidoctor-default.css")).$chomp());
      };

Any idea to solve the problem ?

When an AsciiDoc string is rendered to file an exception is thrown

When an AsciiDoc string is rendered to file an exception is thrown when Nashorn is used. The test is located at https://github.com/lordofthejars/asciidoctorj/blob/feature_189/src/test/java/org/asciidoctor/WhenAsciidoctorJIsUsedWithinNashorn.java#L52

I think this is the expected behavior because Nashorn is a JavaScript implementation not implementing global functions like TimeOut and so on. So based on this basis, we are going to have some problems to write to disk. Probably this will happens in convertFile method as well (during reading).

So I think there are 3 possible solutions:

  • warn users that asciidoctor-js in asciidoctorj can only be used when access to disk is required.
  • create some kind of handler in asciidoctorj-nashorn that intercepts options and acts as adapter reading and writing files to disk, so only an string is sent to asciidoctor.js. Basic problem here is for big documents.
  • Because we can use java code inside asciidoctor.js, create some kind of flag in opal which if is set means that this js will be run inside JVM and can use IO streams and generate code accordantly.

Also I am not sure if it would work asciidoctor.js and Nashorn when you want to include a file or embed an image.

WDYT?

Publish dist files to a tag only

The dist files should only be published to the git repository under a tag. Other option is to push the dist files to a dedicated git repository like asciidoctor.js-dist (though, I'm leading more towards tags). Otherwise, we are constantly checking in the build output, which is unnecessary overhead.

What might help to kick off this task is a link to an article about how to manage published artifacts generated by grunt so that bower / npm can still consume them.

Integrate XRegExp.js for fully-compliant Unicode support

We are starting to hit the limits of the basic regexp engine in JavaScript and it may be time to integrate XRegExp.js to better align Ruby and JavaScript.

Thus far, we've used preprocessor-style conditional blocks to setup regular expressions for the Ruby and JavaScript environments, respectively. However, the JavaScript regular expressions can only match word characters within the basic Latin range because of the limitations of the regexp implementation. Fortunately, the engine can match ranges of unicode characters, so it's technically possible. XRegExp preprocesses the regular expression and replaces the posix character groups like \p{Word} with the full set of character ranges across the Unicode spectrum.

You can find more information about XRegExp on the website:

http://xregexp.com/

This may not be as high priority as I first anticipated. It seems that in Firefox and Chrome, the [a-zA-Z0-9] character group is matching like \p{Word}. However, this may not be true of all browsers. Some research may be required to find out what is and is not supported.

attribute values containing '0' not correctly parsed

Line 9339 of asciidoctor.js seems to replace blanks with 0's in attributes string. Then line 93340 does the inverse using 0's to split into an array. The issue arises when attribute name or value contain 0. In such a case the code below incorrectly splits attribute name or value and inserts partial key or value in the target array.

If we have to do such an ugly hack I recommend using some more unique string than only '0' character.

Adam

attrs = attrs.$gsub($scope.REGEXP['$[]']("space_delim"), "\\10").$gsub($scope.REGEXP['$[]']("escaped_space"), "1");
          attrs = options['$[]=']("attributes", ($a = ($c = attrs.$split("0")).$inject, $a._p = (TMP_4 = function(accum, entry){var self = TMP_4._s || this, $a, k = nil, v = nil;if (accum == null) accum = nil;if (entry == null) entry = nil;

base_dir not working for include:: with relative paths

Setting the 'base_dir' option as in

  var opts = Opal.hash2(['base_dir', 'safe', 'doctype', 'attributes'], {
                'base_dir': basedir,
                'safe': safemode,
                'doctype': doctype,
                'attributes': attributes
            });

            bodyText = Opal.Asciidoctor.$render(docText, opts);

does not seem to affect the relative paths of include::' directives. Relative paths of 'image::' directives are working fine, though.

rake dist fails

After cloning the project locally on my machine, running bundle install and rake dist I get these errors

rake dist
Cannot handle dynamic require :asciidoctor:59
Cannot handle dynamic require :asciidoctor:60
Cannot handle dynamic require :asciidoctor:61
Cannot handle dynamic require :asciidoctor:62
Cannot handle dynamic require :asciidoctor:64
Cannot handle dynamic require :asciidoctor/helpers:21
Cannot handle dynamic require :asciidoctor/renderer:36
Cannot handle dynamic require :asciidoctor/renderer:133

Bundle install reports -->

    bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Installing asciidoctor (1.5.0.preview.1)
Using hike (1.2.3)
Using json (1.8.1)
Using multi_json (1.8.4)
Using source_map (3.0.1)
Using opal (0.5.5)
Using rack (1.5.2)
Using tilt (1.4.1)
Installing sprockets (2.11.0)
Using opal-sprockets (0.3.0)
Using bundler (1.5.2)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

What could be the issue ?

Broken code blocks

Hello,

I am using asciidoctor.js through the Chrome Extension.
It seems the documented code block syntax is not handled properly.

Here are the different use case I encounter and the various outputs it produces.

Code block + filename + linespace

Sample asciidoc

[source,javascript]
module-example.js
----
var privateValue = 0;

module.exports = {
    incrementValue: function(){
        privateValue++;
  },
  getValue: function(){
    return privateValue;
  }  
};
----

Output

Output is not correct

codeblock-filename-linebreak

Code block + filename

Sample asciidoc

[source,javascript]
module-example.js
----
var privateValue = 0;
module.exports = {
    incrementValue: function(){
        privateValue++;
  },
  getValue: function(){
    return privateValue;
  }  
};
----

Output

Output is not correct

codeblock-filename

Code block only

Sample asciidoc

[source,javascript]
----
var privateValue = 0;

module.exports = {
    incrementValue: function(){
        privateValue++;
  },
  getValue: function(){
    return privateValue;
  }  
};
----

Output

Output is correct

codeblock

Let me know if you need clearer explanations to reproduce the problem (and hopefully lead to a solution; it is not blocking anyhow).

Document Title is not converted

I'm having issues with the following:

var asciidoctor = require('asciidoctor.js')()
var processor = asciidoctor.Asciidoctor()
console.log(processor.$convert('= Test', null))

This codes outputs an empty string and no exceptions are thrown. If I change the last line to:

...
console.log(processor.$convert('== Test', null))

Then there is some output.

Problem with docbook5 backend

Hi i have a sample book document, i wanted to convert it docbook5 style. Both asciidoctor (ruby) and asciidoctor.js produces chapters in surrounded last book element in document like preface, appendix, colophon etc.

Sample Content

= Book Name
Author's Name
:doctype: book
:encoding: utf-8
:lang: tr

[preface]
Önsöz
======

Java 8 ve yeniliklerini içeren bu kitap ile, Java programlama dilinin en yeni özelliklerini öğrenebilirsiniz.

Java 8 Ebook http://kodcu.com[kodcu.com] 'da http://kodcu.com/author/rahmanusta/[Rahman Usta] tarafından kaleme alınan Java 8 yazılarını içermektedir.

[appendix]
= Bu kitap nasıl yazıldı?

*Java 8 Ebook* kitabı açık kaynak kodlu http://asciidocfx.com/[Asciidoc Fx] kitap editörü kullanılarak, http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/[Asciidoc işaretleme dili] ile yazılmıştır.

=== Chapter 01

Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir. Lorem Ipsum, adı bilinmeyen bir matbaacının bir hurufat numune kitabı oluşturmak üzere bir yazı galerisini alarak karıştırdığı 1500'lerden beri endüstri standardı sahte metinler olarak kullanılmıştır. Beşyüz yıl boyunca varlığını sürdürmekle kalmamış, aynı zamanda pek değişmeden elektronik dizgiye de sıçramıştır.

image::images/kodcu.png[align="center"]

1960'larda Lorem Ipsum pasajları da içeren Letraset yapraklarının yayınlanması ile ve yakın zamanda Aldus PageMaker gibi Lorem Ipsum sürümleri içeren masaüstü yayıncılık yazılımları ile popüler olmuştur.

==== SubChapter 01

Lorem Ipsum pasajlarının birçok çeşitlemesi vardır. Ancak bunların büyük bir çoğunluğu mizah katılarak veya rastgele sözcükler eklenerek değiştirilmişlerdir. Eğer bir Lorem Ipsum pasajı kullanacaksanız, metin aralarına utandırıcı sözcükler gizlenmediğinden emin olmanız gerekir. İnternet'teki tüm Lorem Ipsum üreteçleri önceden belirlenmiş metin bloklarını yineler.


==== SubChapter 02

Yinelenen bir sayfa içeriğinin okuyucunun dikkatini dağıttığı bilinen bir gerçektir. Lorem Ipsum kullanmanın amacı, sürekli 'buraya metin gelecek, buraya metin gelecek' yazmaya kıyasla daha dengeli bir harf dağılımı sağlayarak okunurluğu artırmasıdır. Şu anda birçok masaüstü yayıncılık paketi ve web sayfa düzenleyicisi, varsayılan mıgır metinler olarak Lorem Ipsum kullanmaktadır.

=== Chapter 02

1500'lerden beri kullanılmakta olan standard Lorem Ipsum metinleri ilgilenenler için yeniden üretilmiştir. Çiçero tarafından yazılan 1.10.32 ve 1.10.33 bölümleri de 1914 H. Rackham çevirisinden alınan İngilizce sürümleri eşliğinde özgün biçiminden yeniden üretilmiştir.

[source,java]
----
public interface Editable{

    void useAsciidocFX();

}
----

=== Chapter 03

Lorem Ipsum pasajlarının birçok çeşitlemesi vardır. Ancak bunların büyük bir çoğunluğu mizah katılarak veya rastgele sözcükler eklenerek değiştirilmişlerdir. Eğer bir Lorem Ipsum pasajı kullanacaksanız, metin aralarına utandırıcı sözcükler gizlenmediğinden emin olmanız gerekir. İnternet'teki tüm Lorem Ipsum üreteçleri önceden belirlenmiş metin bloklarını yineler.

.Table Title (Optional)
[width="100%",options="header"]
|====================
|abcdefq |abcdefq |abcdefq |abcdefq 
|abcdefq |abcdefq |abcdefq |abcdefq 
|abcdefq |abcdefq |abcdefq |abcdefq 
|====================

Sample Docbook5 Output

<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc?>
<?asciidoc-numbered?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" lang="tr">
<info>
<title>Book Name</title>
<date>2014-11-02</date>
<author>
<personname>
<firstname>Author's</firstname>
<surname>Name</surname>
</personname>
</author>
<authorinitials>AN</authorinitials>
</info>
<preface xml:id="_Önsöz">
<title>Önsöz</title>
<simpara>Java 8 ve yeniliklerini içeren bu kitap ile, Java programlama dilinin en yeni özelliklerini öğrenebilirsiniz.</simpara>
<simpara>Java 8 Ebook <link xlink:href="http://kodcu.com">kodcu.com</link> 'da <link xlink:href="http://kodcu.com/author/rahmanusta/">Rahman Usta</link> tarafından kaleme alınan Java 8 yazılarını içermektedir.</simpara>
</preface>
<appendix xml:id="_bu_kitap_nasıl_yazıldı">
<title>Bu kitap nasıl yazıldı?</title>
<simpara><emphasis role="strong">Java 8 Ebook</emphasis> kitabı açık kaynak kodlu <link xlink:href="http://asciidocfx.com/">Asciidoc Fx</link> kitap editörü kullanılarak, <link xlink:href="http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/">Asciidoc işaretleme dili</link> ile yazılmıştır.</simpara>
<section xml:id="_chapter_01">
<title>Chapter 01</title>
<simpara>Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir. Lorem Ipsum, adı bilinmeyen bir matbaacının bir hurufat numune kitabı oluşturmak üzere bir yazı galerisini alarak karıştırdığı 1500&#8217;lerden beri endüstri standardı sahte metinler olarak kullanılmıştır. Beşyüz yıl boyunca varlığını sürdürmekle kalmamış, aynı zamanda pek değişmeden elektronik dizgiye de sıçramıştır.</simpara>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata fileref="images/kodcu.png" align="center"/>
</imageobject>
<textobject><phrase>kodcu</phrase></textobject>
</mediaobject>
</informalfigure>
<simpara>1960&#8217;larda Lorem Ipsum pasajları da içeren Letraset yapraklarının yayınlanması ile ve yakın zamanda Aldus PageMaker gibi Lorem Ipsum sürümleri içeren masaüstü yayıncılık yazılımları ile popüler olmuştur.</simpara>
<section xml:id="_subchapter_01">
<title>SubChapter 01</title>
<simpara>Lorem Ipsum pasajlarının birçok çeşitlemesi vardır. Ancak bunların büyük bir çoğunluğu mizah katılarak veya rastgele sözcükler eklenerek değiştirilmişlerdir. Eğer bir Lorem Ipsum pasajı kullanacaksanız, metin aralarına utandırıcı sözcükler gizlenmediğinden emin olmanız gerekir. İnternet&#8217;teki tüm Lorem Ipsum üreteçleri önceden belirlenmiş metin bloklarını yineler.</simpara>
</section>
<section xml:id="_subchapter_02">
<title>SubChapter 02</title>
<simpara>Yinelenen bir sayfa içeriğinin okuyucunun dikkatini dağıttığı bilinen bir gerçektir. Lorem Ipsum kullanmanın amacı, sürekli 'buraya metin gelecek, buraya metin gelecek' yazmaya kıyasla daha dengeli bir harf dağılımı sağlayarak okunurluğu artırmasıdır. Şu anda birçok masaüstü yayıncılık paketi ve web sayfa düzenleyicisi, varsayılan mıgır metinler olarak Lorem Ipsum kullanmaktadır.</simpara>
</section>
</section>
<section xml:id="_chapter_02">
<title>Chapter 02</title>
<simpara>1500&#8217;lerden beri kullanılmakta olan standard Lorem Ipsum metinleri ilgilenenler için yeniden üretilmiştir. Çiçero tarafından yazılan 1.10.32 ve 1.10.33 bölümleri de 1914 H. Rackham çevirisinden alınan İngilizce sürümleri eşliğinde özgün biçiminden yeniden üretilmiştir.</simpara>
<programlisting language="java" linenumbering="unnumbered">public interface Editable{

    void useAsciidocFX();

}</programlisting>
</section>
<section xml:id="_chapter_03">
<title>Chapter 03</title>
<simpara>Lorem Ipsum pasajlarının birçok çeşitlemesi vardır. Ancak bunların büyük bir çoğunluğu mizah katılarak veya rastgele sözcükler eklenerek değiştirilmişlerdir. Eğer bir Lorem Ipsum pasajı kullanacaksanız, metin aralarına utandırıcı sözcükler gizlenmediğinden emin olmanız gerekir. İnternet&#8217;teki tüm Lorem Ipsum üreteçleri önceden belirlenmiş metin bloklarını yineler.</simpara>
<table frame="all" rowsep="1" colsep="1">
<title>Table Title (Optional)</title>
<?dbhtml table-width="100%"?>
<?dbfo table-width="100%"?>
<?dblatex table-width="100%"?>
<tgroup cols="4">
<colspec colname="col_1" colwidth="106*"/>
<colspec colname="col_2" colwidth="106*"/>
<colspec colname="col_3" colwidth="106*"/>
<colspec colname="col_4" colwidth="106*"/>
<thead>
<row>
<entry align="left" valign="top">abcdefq</entry>
<entry align="left" valign="top">abcdefq</entry>
<entry align="left" valign="top">abcdefq</entry>
<entry align="left" valign="top">abcdefq</entry>
</row>
</thead>
<tbody>
<row>
<entry align="left" valign="top"><simpara>abcdefq</simpara></entry>
<entry align="left" valign="top"><simpara>abcdefq</simpara></entry>
<entry align="left" valign="top"><simpara>abcdefq</simpara></entry>
<entry align="left" valign="top"><simpara>abcdefq</simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara>abcdefq</simpara></entry>
<entry align="left" valign="top"><simpara>abcdefq</simpara></entry>
<entry align="left" valign="top"><simpara>abcdefq</simpara></entry>
<entry align="left" valign="top"><simpara>abcdefq</simpara></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</appendix>
</book>

What is the problem there? Thanks.

Create a dist build task that populates the dist folder

Create a dist build task that populates the dist folder with both the minimized and non-minimized versions of asciidoctor.js and asciidoctor_extensions.js.

Consider making another file that combines asciidoctor.js and asciidoctor_extensions.js into one, perhaps asciidoctor_complete.js. We may even want to make an asciidoctor_all.js that also bundles opal.js for simpler usage.

We need to get the dist to automatically run when we tag a release.

Update "changes to Asciidoctor" section in README

The changes to Asciidoctor section in the README should be updated to reflect which accommodations Asciidoctor core makes for the Opal compiler / environment.

This section will be important for ensuring that developers who work on Asciidoctor core understand the constraints for allowing the code to be cross compiled.

Support custom templates

Not exactly sure how we'll get around the browser sandbox, but I'm sure something can be figured out.

Build fail with Asciidoctor.rc.1

Having updated the Gemfile and i made a fast test, i have the following error :

Running "shell:bundleExecRake" (shell) task
Warning: Command failed: /bin/sh -c bundle exec rake
Cannot handle dynamic require :asciidoctor/helpers:19
rake aborted!
parse error on value "elsif" (kELSIF) :asciidoctor/substitutors:203
  (in /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0.rc.1/lib/asciidoctor/substitutors.rb)
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/parser.rb:50:in `on_error'
(eval):3:in `_racc_do_parse_c'
(eval):3:in `do_parse'
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/parser.rb:22:in `parse_to_sexp'
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/parser.rb:17:in `parse'
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/compiler.rb:67:in `compile'
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/sprockets/processor.rb:77:in `evaluate'
/var/lib/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/context.rb:197:in `block in evaluate'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/context.rb:194:in `each'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/context.rb:194:in `evaluate'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:12:in `initialize'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:374:in `new'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:374:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:395:in `circular_call_protection'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:373:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:94:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/caching.rb:51:in `cache_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:93:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:287:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:61:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:111:in `block in resolve_dependencies'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:105:in `each'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:105:in `resolve_dependencies'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:97:in `build_required_assets'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:16:in `initialize'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:374:in `new'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:374:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:395:in `circular_call_protection'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:373:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:94:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/caching.rb:51:in `cache_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:93:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:287:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:61:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/bundled_asset.rb:16:in `initialize'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:377:in `new'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:377:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:94:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/caching.rb:51:in `cache_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:93:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:287:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:61:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/environment.rb:75:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:295:in `[]'
/home/anthonny/99-Projects/asciidoctor.js/Rakefile:34:in `block in <top (required)>'
Tasks: TOP => default => dist

Maybe it's an issue for Opal ?

Rework the README

I think the sections are not in the right order:

  1. About
  2. Installation
  3. Usage
  4. Contribute/Build from sources

It could also be nice to create a more detailed documentation about the Javascript API: the Opal.hash2 is very confusing and there is a $ before method name.

Another idea is to show how to create an extension in Javascript. I look at the code generated by Opal and it's quite straightforward...

Document attributes are ignored

I tried to add :icons: font in my document but nothing happened. When I add this attribute in the options page of the Chrome extension, it's working...

Make the toc work

The table of contents currently relies on source files that are not compiled into the Opal environment. Find a way to extract this logic into a location where it can be compiled by Opal and included in asciidoctor.js.

Running Asciidoctor.js with jjs throws exception

Hello asciidoctor.js team,

Trying to run following script asciidoctor with jjs (Nashorn CLI and REPL).

#!/usr/bin/env jjs -scripting

load("./lib/asciidoctor-all.js");

var data = <<<EOS;
= asciidoctor.js, AsciiDoc in JavaScript
Doc Writer <[email protected]>

Asciidoctor and Opal come together to bring
http://asciidoc.org[AsciiDoc] to the browser!.

== Technologies

* AsciiDoc
* Asciidoctor
* Opal

NOTE: That's all she wrote!!!
EOS

var options = Opal.hash2(['doctype', 'attributes'], {doctype: 'inline', attributes: ['showtitle']});
var html = Opal.Asciidoctor.$convert(data, options);
print(html);

Getting following error

»  ./asciidoctor_test.js
./lib/asciidoctor-all.js:7530 TypeError: Cannot read property "length" from undefined
»  java -version
java version "1.8.0_40-ea"
Java(TM) SE Runtime Environment (build 1.8.0_40-ea-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b16, mixed mode)

Do I need to use any specific js file?

Thanks

"include::" not load file content

When i write :

include::include.asciidoc[]

The result is a link :

<div class="paragraph">
<p><a href="https://github.com/Nikku/asciidoc-samples/blob/master/include.asciidoc">include.asciidoc</a></p>
</div>

capture du 2014-03-07 17 02 52

The file content is not loaded

Missing file asciidoctor_example.js

The file asciidoctor_example.html available under examples is a template that we can use to render asciidoctor file. It includes an asciidoctor_example.js script file but this file does not exist within the project

Remark : opal.js and asciidoctor.js are avaialable under dist but not relative to the directory of the examples directory.

  <!DOCTYPE html>
  <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Asciidoctor in JavaScript powered by Opal</title>
      <link rel="stylesheet" href="asciidoctor.css">
    </head>
    <body>
      <div id="content"></div>
      <script src="opal.js"></script>
      <script src="asciidoctor.js"></script>
      <script src="asciidoctor_example.js"></script>
    </body>
  </html>

stylesheet attribute prepended with "./"

If a URL is passed through the 'stylesheet' attribute, URL in the generated HTML contains an extra './'.

This code (may include syntax errors)

var asciidoctor = require('asciidoctor.js')();
var opal = asciidoctor.Opal;

var  processor = asciidoctor.Asciidoctor(true);

var options = opal.hash2(
    ['doctype', 'header_footer', 'attributes'],
    {'doctype': 'article', 
     'header_footer': true,
     'attributes': 'stylesheet=file:///home/tom/asciidoctor.css'
});
var html = processor.$convert("asciidoctor.js!", options);
console.log(html);

will include the following link:

<link rel="stylesheet" href="./file:///home/tom/asciidoctor.css">

Same results on Windows and Linux.

Change asciidoctor submodule to a dependency

Link to Asciidoctor as a RubyGems dependency instead of a git submodule.

Since we've aligned asciidoctor.js with Asciidoctor core, let's switch from using a git submodule to use a RubyGems dependency.

We can still keep the git submodule for the backends for now.

Consolidate build scripts

We have some (a lot of?) overlap between the grunt and rake tasks. Consolidate the build scripts so that we are doing everything in grunt except for what has to be done in rake. The rake parts should be limited to executing Opal.

Ideally, we could even eliminate rake and just use the opal command directly, but that's not a hard requirement.

Callout ids duplication problem

Hi, when using callouts in code blocks, generated id's makes duplication of ids. How can i generate uniques id's for my callouts. Throwed exception like below .

org.apache.fop.fo.ValidationException: Property ID "CO1-1" (found on "fo:inline") previously used; I
D values must be unique within a document! (See fo:inline, id=CO1-1)

Build fail with Asciidoctor.rc.3

After having updated Gemfile :

Running "shell:bundleExecRake" (shell) task
Warning: Command failed: /bin/sh -c bundle exec rake
Cannot handle dynamic require :asciidoctor/helpers:19
Cannot handle dynamic require :asciidoctor/converter/factory:48
Cannot handle dynamic require :asciidoctor/converter/factory:196
Cannot handle dynamic require :asciidoctor/converter/factory:201
Cannot handle dynamic require :asciidoctor/converter/factory:206
Cannot handle dynamic require :asciidoctor/converter/factory:214
Cannot handle dynamic require :asciidoctor/converter/factory:217
rake aborted!
parse error on value "'" (tSTRING_BEG) :asciidoctor/document:389
  (in /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0.rc.3/lib/asciidoctor/document.rb)
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/parser.rb:50:in `on_error'
(eval):3:in `_racc_do_parse_c'
(eval):3:in `do_parse'
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/parser.rb:22:in `parse_to_sexp'
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/parser.rb:17:in `parse'
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/compiler.rb:67:in `compile'
/var/lib/gems/1.9.1/gems/opal-0.6.2/lib/opal/sprockets/processor.rb:77:in `evaluate'
/var/lib/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/context.rb:197:in `block in evaluate'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/context.rb:194:in `each'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/context.rb:194:in `evaluate'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:12:in `initialize'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:374:in `new'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:374:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:395:in `circular_call_protection'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:373:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:94:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/caching.rb:51:in `cache_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:93:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:287:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:61:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:111:in `block in resolve_dependencies'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:105:in `each'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:105:in `resolve_dependencies'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:97:in `build_required_assets'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/processed_asset.rb:16:in `initialize'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:374:in `new'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:374:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:395:in `circular_call_protection'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:373:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:94:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/caching.rb:51:in `cache_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:93:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:287:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:61:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/bundled_asset.rb:16:in `initialize'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:377:in `new'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:377:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:94:in `block in build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/caching.rb:51:in `cache_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:93:in `build_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:287:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/index.rb:61:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/environment.rb:75:in `find_asset'
/var/lib/gems/1.9.1/gems/sprockets-2.12.1/lib/sprockets/base.rb:295:in `[]'
/home/anthonny/99-Projects/asciidoctor.js/Rakefile:34:in `block in <top (required)>'
Tasks: TOP => default => dist
(See full trace by running task with --trace)
 Use --force to continue.

I think Opal hate String values 😢

xlinks split over multiple lines don't get converted

The following asciidoc

If you're new to AsciiDoc read this section and the <<X6,Getting
Started>> section and take a look at the example AsciiDoc (`*.txt`)
source files in the distribution `doc` directory.

will be converted to

<simpara>This is an overly large document, it probably needs to be refactored
into a Tutorial, Quick Reference and Formal Reference.</simpara>
<simpara>If you&#8217;re new to AsciiDoc read this section and the &lt;&lt;X6,Getting
Started&gt;&gt; section and take a look at the example AsciiDoc (<literal>*.txt</literal>)
source files in the distribution <literal>doc</literal> directory.</simpara>

The link to X6 is not handled because it flows over a line break.

This was generated with asciidoctor.js 1.5.0 preview 7

Run JavaScript in rendered HTML

If the generated HTML contains <script> tags, they need to be handled explicitly when embedding the HTML into another document. Provide an API that performs this function.

In fact, it might be a good idea to provide an API that handles embedding the result into an HTML element. We can use Opal's native interface to interact with the DOM.

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.