Giter Site home page Giter Site logo

asciidoctor-backends'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-backends's People

Contributors

aheusingfeld avatar antoinesd avatar buuhsmead avatar cexbrayat avatar cmoulliard avatar danhyun avatar ggrossetie avatar houbie avatar jirutka avatar jordanmccullough avatar lightguard avatar lordofthejars avatar mojavelinux avatar nopeslide avatar obilodeau avatar paulojeronimo avatar pilhuhn avatar randybb avatar robertpanzer avatar stephane-deraco avatar tajmone 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

Watchers

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

asciidoctor-backends's Issues

Add helper method to coerce attribute values

Add a helper method to coerce attribute values so that they are assigned in JavaScript as the appropriate type and safely.

There are at least two cases, currently.

  1. the attribute value needs to be emitted as a quoted string
  2. the attribute value needs to be emitted as a boolean

In the second case, the backend is currently broken if the attribute value is not assigned a value of "true" or "false". For example, consider the following attribute declaration:

:revealjs_history:

This produces:

history: ,

Custom class should go directly on tag for inline markup in dzslides backend

Currently, the inline_quoted template puts a custom class on a nested <span> element for inline markup such as strong, emphasis, monospace, etc. For example:

[myclass]*text*

becomes

<strong><span class="myclass">text</span></strong>

This output inherits from the HTML 5 backend in AsciiDoc. But we don't have to follow it for the dzslides backend. Instead, the class should be put directly on the tag, when there is one, such as:

<strong class="myclass">text</strong>

This just makes sense and makes styling a heck of a lot simpler.

manpage backend having problems processing 'zero width space' `&#8203;`

zero width space character &#8203; is affecting the output of the manpage:

Examples using the asciidoctor.adoc man:

-\fBasciidoctor\fR [\fIOPTION\fR]\&... \fIFILE\fR\&...
+\fBasciidoctor\fR [\fIOPTION\fR]\&...&#8203; \fIFILE\fR\&...&#8203;
-\fB\-\-safe\fR
+\fB\-\-&#8203;safe\fR
-Auto\-number section titles\&. Synonym for
-\fB\-\-attribute numbered\fR\&.
+Auto\-number section titles\&. Synonym for \fB\-\-&#8203;attribute numbered\fR\&.

manpage backend is not printing all authors, only the first one

Here is a diff of the authors generated with the a2x tool and the manpage backend for asciidoctor.

I am using asciidoctor-backends version a40fe5edc4af19381a25b66dcfaef0f64732530e.

-.\"    Author: Dan Allen; Sarah White; Ryan Waldron
-.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"      Date: 09/14/2014
+.\"    Author: Dan Allen
+.\" Generator: Asciidoctor 1.5.0
+.\"      Date: 2014-09-27

Graduate the LaTeX backend to its own repository

Now that the LaTeX backend is well on its way to being complete, thanks to @jxxcarlson, I think it's time to graduate it to its own repository. This will allow us to release it much like asciidoctor-pdf and asciidoctor-epub3 so it can be installed as a gem and loaded from the load path using the -r flag.

Haml HTML5 Backend Unable to Build

Unable to successfully build from the Haml backend with any Asciidoc markup, including a simple sample file like this:

= Hello, World!
Jordan McCullough <[email protected]>

Test content

== Secton One

* Something Item
* More Something

A trace results in the following:

asciidoctor --trace -T ./asciidoctor-backends/haml/html5 test.adoc

./asciidoctor-backends/haml/html5/inline_anchor.html.haml:10:in `block in singletonclass': undefined local variable or method `role' for #<Asciidoctor::Inline:0x007fff1909b058> (NameError)

Thoughts on the issues for role?

Irritating '#' on deck.js slides

There is an irritating # printed on slides. I figured out it is a permalink, but it still does not look good.

screen shot 2014-06-18 at 14 58 53

The offending line

%a(href='.' title='Permalink to this slide' class='deck-permalink') #

is in haml/deckjs/document.html.haml

Maybe it should be replaced by

- if attr? :deckjs_permalinks
  %a(href='.' title='Permalink to this slide' class='deck-permalink') #

Callout not properly rendered with slim & reveal.js

When I use the slim reveal.js template a XML listing with callouts the callout is rendered wrong.
With this example:

[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="foo"
        module="Bar"
        revision="1.0.0-SNAPSHOT">
    </info>
    <configurations> <!--1-->
        <conf name="compile"/>
        <conf name="compile-only" extends="compile"/>
        <conf name="runtime" extends="compile"/>
        <conf name="test-compile" extends="compile"/>
        <conf name="test" extends="runtime, test-compile"/>
    </configurations>
    <dependencies> <!--2-->
        <dependency org="org.jboss.spec" name="jboss-javaee-6.0" rev="${version.jboss-javaee}" conf="compile-only,test-compile->default(*)"/>
        <dependency org="org.aspectj" name="aspectjrt"  rev="${version.aspectj}"    conf="compile->default(*)"/>
        <dependency org="commons-io"  name="commons-io" rev="${version.commons-io}" conf="compile->default(*)"/>
    </dependencies>
</ivy-module>
----

the callout gets rendered like this:

<section id="_basic_structure_ivy_xml"><h2>Basic structure ivy.xml</h2><div class="listingblock"><div class="content"><pre class="highlight"><code class="xml language-xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven"&gt;
    &lt;info organisation="foo"
        module="bar"
        revision="1.0.0-SNAPSHOT"&gt;
    &lt;/info&gt;
    &lt;configurations&gt; <b>(1)</b>

So <b> and </b> are visible as text in the rendered HTML.

This does not occur when I use the haml template. :-)
But it in this case the listing is not as pretty. :-(

deck.js backend is out-of-date

After exploring the asciidoctor deck.js backend I've concluded the asciidcotor back-end is out-of-date with deck.js

The asciidoctor backend refers to the deck.hash extension through a reference to it's css file:

https://github.com/asciidoctor/asciidoctor-backends/blob/master/haml/deckjs/document.html.haml#L45

This extensions seems to have been available with deck.js 1.0.0:

https://github.com/imakewebthings/deck.js/tree/1.0.0/extensions

but not with 1.1.0, nor what's on master:

https://github.com/imakewebthings/deck.js/tree/1.1.0/extensions

inline video is not supported

When video option is added in a paragraph or a table

[width="100%"]
|============================================== 
|video:video/bob_waterslide.mp4[] |
|==============================================

HTML is not rendered with a videoblock as until now the existing templates does not support inline video like inline image, ...

<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:50%;">
<col style="width:50%;"> 
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">video:video/bob_waterslide.mp4[]</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

manpage backend missing NAME in output

Diff between the output of the asciidoctor.adoc manpage generated with the manpage backend and the a2x command:

 .ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+asciidoctor \- converts AsciiDoc source files to HTML, DocBook and other formats
 .SH "SYNOPSIS"
 .sp
 \fBasciidoctor\fR [\fIOPTION\fR]\&... \fIFILE\fR\&...

Deck.js backend does not support block_audio

When a page contains a block_audio :

audio::audio/ocean_waves.mp3[options="autoplay,loop"]

asciidoctor generates this message :

Couldn't find a view in @views for block_audio

Split backends into multiple repositories

In order to distribute the backends, I think it will work best if we split them into multiple repositories.

  • There should be one repository to hold the clones of the built-in backends (html5, docbook45 and manpage)
  • Each slideshow framework should have its own repository since they tend to move at a different pace
  • There should be one repository where new backends go, an incubator so to speak

Improve Slide show (section, fragment, navigation, ...)

As discussed here, we suffer for the moment to propose a too basic way to split HTML pages into slides (based on title with level ==). To improve the situation, here are some suggestions after reviewing RevealJS, Slidy, LandSlide, DeckJS

  • Section or Slide attribute is a good name as they are used by different slideshows solutions
  • Ideally, we should add it like as a block before each slide creation : [section: attribute(s)] as it will correspond to a
  • Attributes to be supported for a section/slide
    • transition : horizontal, vertical, fade, ...
    • transition-style : default, fade, none, ...
    • transition : theme
    • transition-speed : fast, slow
    • image-background or data-background : css color or image

[section: transition=horizontal, transition-speed=fast]

Remark : The section starts with a a section block and ends when a new section block is defined late on

  • Within a section, we should support [fragment](also called incremental by others) where
    • navigation : left, right, top, bottom define how the fragment will appear

[fragment: navigation=right]

There are certainly others properties that we should define globally like :

  • Timing presentation
  • width,height,margin
  • autoslide (millisecond, second for transitions)
  • history : to register slides in history of the browser
  • Keyboard
  • Keyboards binding (Table Of Content, Menu, Goto, Full Screen, ...)
  • More info here from reveal project

NameError: undefined local variable or method `nofooter'

Hi Dan, all,

Regarding commit 7277f99, using asciidoctor 0.1.4 on Fedora 19 we're actually now seeing errors like

NameError: undefined local variable or method `nofooter' for #<Asciidoctor::Document:0x9e8ddf8>

when using a custom template, as with asciidoctor -T backends/ foo.adoc, whereby we have a custom document.html.erb in backends/. Does this commit assume another change elsewhere that we haven't yet pulled?

Many thanks!

David

NameError: uninitialized constant Asciidoctor::Stylesheets::DATA_PATH

I get the error NameError: uninitialized constant Asciidoctor::Stylesheets::DATA_PATH when running asciidoctor -T ../../../../build/asciidoctor-backends/haml/deckjs 001-introduction-2014-09-03.adoc

$ asciidoctor --trace -T ../../../../build/asciidoctor-backends/haml/deckjs 001-introduction-2014-09-03.adoc
/var/lib/gems/2.1.0/gems/asciidoctor-1.5.0/lib/asciidoctor/stylesheets.rb:10:in `<class:Stylesheets>': uninitialized constant Asciidoctor::Stylesheets::DATA_PATH (NameError)
        from /var/lib/gems/2.1.0/gems/asciidoctor-1.5.0/lib/asciidoctor/stylesheets.rb:6:in `<module:Asciidoctor>'
        from /var/lib/gems/2.1.0/gems/asciidoctor-1.5.0/lib/asciidoctor/stylesheets.rb:1:in `<top (required)>'
        from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
        from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
        from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
        from /home/niklaas/build/asciidoctor-backends/haml/deckjs/helpers.rb:1:in `<top (required)>'
        from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/lib/ruby/vendor_ruby/asciidoctor/renderer.rb:121:in `block in initialize'
        from /usr/lib/ruby/vendor_ruby/asciidoctor/renderer.rb:69:in `each'
        from /usr/lib/ruby/vendor_ruby/asciidoctor/renderer.rb:69:in `initialize'
        from /usr/lib/ruby/vendor_ruby/asciidoctor/document.rb:743:in `new'
        from /usr/lib/ruby/vendor_ruby/asciidoctor/document.rb:743:in `renderer'
        from /usr/lib/ruby/vendor_ruby/asciidoctor/document.rb:752:in `render'
        from /usr/lib/ruby/vendor_ruby/asciidoctor.rb:915:in `render'
        from /usr/lib/ruby/vendor_ruby/asciidoctor/cli/invoker.rb:86:in `block in invoke!'
        from /usr/lib/ruby/vendor_ruby/asciidoctor/cli/invoker.rb:79:in `each'
        from /usr/lib/ruby/vendor_ruby/asciidoctor/cli/invoker.rb:79:in `invoke!'
        from /usr/bin/asciidoctor:13:in `<main>'
$ gem list --local

*** LOCAL GEMS ***

asciidoctor (1.5.0, 0.1.4)
bigdecimal (1.2.4)
haml (4.0.5)
io-console (0.4.2)
json (1.8.1)
minitest (5.4.1, 4.7.5)
power_assert (0.1.3)
psych (2.0.5)
rake (10.3.2, 10.1.0)
rdoc (4.1.1, 4.1.0)
slim (2.0.3)
temple (0.6.8)
test-unit (3.0.1, 2.1.2.0)
tilt (2.0.1)
$ uname -a
Linux len-x61s 3.14-2-amd64 #1 SMP Debian 3.14.15-2 (2014-08-09) x86_64 GNU/Linux

I followed the instructions at http://asciidoctor.org/docs/install-and-use-deckjs-backend/ . I installed asciidoctor with aptitude install asciidoctor.

Create a backend for impress.js presentations

Create a backend for impress.js presentations.

Impress.js: http://bartaz.github.io/impress.js/#/bored

Additional ideas: https://github.com/regebro/hovercraft

Keep in mind that we want to try to align the different presentation backends (deck.js, reveal.js, dzslides, etc) so that the same AsciiDoc source file will work using any one of them (within reason).

Also, each backend should be create in its own git repository to make collaboration and releases easier.

labeled lists throw error in deckjs backend

label of the list:: my content

throws the following stacktrace when using deckjs:

[#] /home/agori/projects/asciidoctor-backends/haml/deckjs/block_dlist.html.haml:42:in block (2 levels) in singletonclass' [#] /home/agori/projects/asciidoctor-backends/haml/deckjs/block_dlist.html.haml:40:ineach'
[#] /home/agori/projects/asciidoctor-backends/haml/deckjs/block_dlist.html.haml:40:in block in singletonclass' [#] /home/agori/projects/asciidoctor-backends/haml/deckjs/block_dlist.html.haml:65528:ininstance_eval'
[#] /home/agori/projects/asciidoctor-backends/haml/deckjs/block_dlist.html.haml:65528:in singletonclass' [#] /home/agori/projects/asciidoctor-backends/haml/deckjs/block_dlist.html.haml:65526:in__tilt_21149840'
[#] /var/lib/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:170:in call' [#] /var/lib/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:170:inevaluate'
[#] /var/lib/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/haml.rb:24:in evaluate' [#] /var/lib/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:103:inrender'

Embed fonts instead of linking with dzslides-fonts

With dzslides, you can define the fonts to use, e.g:

:dzslides-fonts: family=Neuton:400,700,800,400italic|Cedarville+Cursive

This results in a link like this:

<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Neuton:400,700,800,400italic|Cedarville+Cursive" />

Would it be possible to have it by default download the font and link it locally or embed it?

Alternatively, if linkcss is passed, it should link to it, as it does now.

This would be useful for when the presentation is given offline.

Create a backend for reveal.js presentations

Create a backend for reveal.js presentations.

reveal.js: http://lab.hakim.se/reveal-js/

Keep in mind that we want to try to align the different presentation backends (deck.js, reveal.js, dzslides, etc) so that the same AsciiDoc source file will work using any one of them (within reason).

Also, each backend should be create in its own git repository to make collaboration and releases easier.

Invoking latex converter from elsewhere

Am trying to set things up so that I can invoke asciidoctor -r ./latex_converter.rb -b latex from
other than the directory /Users/carlson/Dropbox/prog/git/asciidoctor-backends/ruby/latex. This to facilitate giving the converter a real workout with real documents.

This works:

$ pwd
/Users/carlson/Dropbox/prog/git/asciidoctor-backends/ruby/latex
 $ asciidoctor -r ./latex_converter.rb -b latex test/sample1.adoc -o foo.tex

The below doesn't. Any suggestions?

 $ pwd
/Users/carlson/Dropbox/Beijing_2014/hodge/text
 $ export LTC=/Users/carlson/Dropbox/prog/git/asciidoctor-backends/latex_converter.rb
 $ echo $LTC
/Users/carlson/Dropbox/prog/git/asciidoctor-backends/latex_converter.rb
 $ asciidoctor -r $LTC -b latex 002-Algebraic_Varieties.ad -o foo.tex
asciidoctor: FAILED: '/Users/carlson/Dropbox/prog/git/asciidoctor-backends/latex_converter.rb' 
could not be loaded

Add FontAwesome support

Add FontAwesome if the value of the icons attribute is font to support font-based admonition icons and the inline icon macro.

(For deck.js) make it more obvious where images go

I have

== Aktuell

RHQ 4.9

  • 11.9.2013
  • Grundlage für JBoss ON 3.2
  • Läuft intern auf JBoss EAP 6

[canvas-image="images/RHQ-classic.png"]

== la la la this is not shown

[role="canvas-caption", position="center-up"]
Klassisches Setup

[canvas-image="images/StorageNodes.png"]

== Eingebaute Storage Nodes

[role="canvas-caption", position="center-up"]
Storage Nodes

[canvas-image="images/Monitoring2.png"]

== Another slide
[role="canvas-caption", position="center-up"]
Neue Graphen

+++
here it is not obvious that the == between [canvas-image] and [role] is a) just needed for syntax sugar, that b) the image + heading is actually the [canvas-image] before and the [role]+text after and c) that the first [canvas-image] does not show on the same slide than the first == Aktuell block, even if it looks like when just looking at the == blocks.

So I think that should be re-written to something like

== Title, ignored
[canvas-image , caption= , caption-position=]

Keyboard letters g, m, t & b does not work when pressed

I think that I know the reason. This is because the deck.js backend (https://github.com/asciidoctor/asciidoctor-backends/blob/master/haml/deckjs/document.html.haml) does not add the following lines to be able to use the options (g = goto, m = menu, b = blank page, t=table of contents)

What we generate today -->

<a class="deck-permalink" href="." title="Permalink to this slide">#</a>
<script src="deck.js/jquery-1.7.2.min.js"></script>
<script src="deck.js/core/deck.core.js"></script>
<script src="deck.js/core/deck.core.js"></script>
<script src="deck.js/extensions/hash/deck.hash.js"></script>
<script src="deck.js/extensions/menu/deck.menu.js"></script>
<script src="deck.js/extensions/goto/deck.goto.js"></script>
<script src="deck.js/extensions/status/deck.status.js"></script>
<script src="deck.js/extensions/navigation/deck.navigation.js"></script>
<script src="deck.js/extensions/scale/deck.scale.js"></script>
<script>
  $(function() {
    $.deck('.slide');
  });
</script>

but should be -->

<a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
<a href="#" class="deck-next-link" title="Next">&#8594;</a>
<p class="deck-status">
        <span class="deck-status-current"></span>
        /
        <span class="deck-status-total"></span>
</p>
<div class="deck-toc"></div>
<form action="." method="get" class="goto-form">
        <label for="goto-slide">Go to slide:</label>
        <input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
        <datalist id="goto-datalist"></datalist>
        <input type="submit" value="Go">
</form>
<a href="." title="Permalink to this slide" class="deck-permalink">#</a>
<!-- Other extension HTML snippets go here, at the bottom of the deck container. -->
<!-- Initialize the deck. You can put this in an external file if desired. -->
<script>
        (function($, deck, undefined) {

$.deck.defaults.keys["previous"] = [8, 33, 37, 39];
$.deck.defaults.keys["next"] = [13, 32, 34, 39];

                $.extend(true, $[deck].defaults, {
                        countNested: false
                });

                $.deck('.slide');
        })(jQuery, 'deck');
</script>

revealjs: source vs listing and syntax highlighting

Currently the slim reveal.js backend will only trigger syntax highlight on explicit source blocks. Since by default:

----
this
----

will generate a 'listing' block one need to always specify [source] above the block.

Could both source and listing blocks be highlighted (since their description is the same) or is there a reasoning behind this?

I'm willing to do the required change.

Thanks!

How to access attr method from helpers.rb

Hi @mojavelinux,

I tried fixing the issue you highlighted in #54 regarding breaking the config with: https://github.com/obilodeau/asciidoctor-backends/tree/feature/more-resistant-config

But the code can't seem to call attr properly. I tried importing a few things but it didn't work. What do I need to import to be able to call attr ?

This is the first ruby code I write so feel free to give me advice and/or refocus my attention on an improved implementation if you think this shouldn't be in helpers.rb.

Thanks!

Add table with backends supported - README file

The README file of asciidoctor backends does not list the backends supported. Should be great to have a table listing what we have and also what is compatible with asciidoc (or not like slidy)

screen shot 2013-11-18 at 12 59 31

Graduate the reveal.js backend to its own repository

What do you think about graduating the reveal.js backend to it's own repository as asciidoctor-revealjs (or asciidoctor-backend-revealjs)?

The motivation is two fold:

  1. Independent release cycle
  2. Distribution

Regarding (1), managing different backends in the same repository prevents us from using the full capabilities of git and the GitHub interface...at least not without stepping on the toes of other parts.

For (2), I think we could consider using Bower to handle distribution so that it's easier for people to download and setup. We could also consider packaging it as a RubyGem and modifying core, if necessary, to be able to discover and load the templates from an installed location.

If you think we can do all that from within the asciidoctor-backends repository, I'm open to that possibility. But I don't want to keep it coupled if it makes things harder.

Align chart extension with AsciiDoc conventions

To be consistent with the <name>::<target>[<attributes>] convention, I think we should change the placement of arguments so the data is <target> and the chart type is the first positional attribute. I think chart type should default to "line" if not specified.

chart::sample.csv[line]

chart::sample.csv[bar]

chart::sample.csv[step]

chart::sample.csv[spline]

I think we should also support positional attributes for x and y label as well as size.

chart::<data-uri>[<type>,<x-label>,<y-label>,<width>,<height>]

We should also support a block form where the data is specified in a literal block:

[chart,line]
....
January,February,March,April,May,June,July
28,48,40,19,86,27,90
65,59,80,81,56,55,40
....

It will be necessary to register separate extensions for the block macro and block forms, but they can share common code.

Update backend ReadMe

Needs general usage instructions and descriptions added
How to create a custom backend
How to modify a backend
Links or references to stylesheet docs

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.