Skip to content

A set of Asciidoctor extensions that add a chart block and block macro to AsciiDoc for including charts in your AsciiDoc document.

License

Notifications You must be signed in to change notification settings

ioannisstavrakakis/asciidoctor-chart

 
 

Repository files navigation

Asciidoctor Chart

badge asciidoctor chart?include prereleases

A set of Asciidoctor extensions that adds a chart block and block macro for including charts powered by C3.js, Chartist, or Chart.js in your AsciiDoc document.

Prerequisites

All that’s needed is Ruby 2.5 or better (or JRuby 9.2 or better) and a few Ruby gems (including at least Asciidoctor 2.0.0), which we explain how to install in the next section.

To check if you have Ruby available, use the ruby command to query the version installed:

$ ruby -e 'puts RUBY_VERSION'

Make sure this command reports a Ruby version that’s at least 2.5. If so, you may proceed.

Getting Started

You can get Asciidoctor Chart by installing the published gem. You can also run the code from source if you want to use a development version or participate in development.

Install the Published Gem

To install Asciidoctor Chart, first make sure you have satisfied the prerequisites. Then, install the gem from RubyGems.org using the following command:

$ gem install asciidoctor-chart --pre

Enable the Extension

Assuming all the required gems install properly, you can enable the extension using --require option (or -r for short) from the Asciidoctor CLI:

$ asciidoctor --require asciidoctor-chart my-doc.adoc

Usage

Line chart powered by C3.js (default) declared as 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
....
chart c3js
Line chart powered by Chart.js declared as a block macro with a CSV file as target
chart::sample-data.csv[line,engine="chartjs"]
chart chartjs

For more examples, see example.adoc.

Authors

Asciidoctor Chart was written by Guillaume Grossetie.

Copyright © 2014-2020 Guillaume Grossetie Free use of this software is granted under the terms of the MIT License.

For the full text of the license, see the LICENSE file.

About

A set of Asciidoctor extensions that add a chart block and block macro to AsciiDoc for including charts in your AsciiDoc document.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%