/asciidoctor-fb2

📕 Asciidoctor FB2 is an Asciidoctor extension for converting AsciiDoc to FB2

Primary LanguageRubyMIT LicenseMIT

Asciidoctor FB2

project chat Latest Release Build Status

Asciidoctor FB2 is an Asciidoctor extension for converting AsciiDoc documents directly to the FB2 e-book format.

Installation

Asciidoctor FB2 is published on RubyGems.org. You can install the published gem using the following command:

$ gem install asciidoctor-fb2

Assuming all the required gems install properly, verify you can run the asciidoctor-fb2 script:

$ asciidoctor-fb2 -v

If you see the version of Asciidoctor FB2 printed, you’re ready to use Asciidoctor FB2.

Usage

Converting an AsciiDoc document to FB2 is as simple as passing your document to the asciidoctor-fb2 command. This command should be available on your PATH if you installed the asciidoctor-fb2 gem. Otherwise, you can find the command in the bin folder of the project. We also recommend specifying an output directory using the -D option flag.

$ asciidoctor-fb2 -D output path/to/book.adoc

When the script completes, you’ll see the file book.fb2.zip appear in the output directory. Open that file with an FB2 reader to view the result.

The metadata in the generated FB2 file is populated from attributes in the AsciiDoc document. The names of the attributes and the metadata elements to which they map are documented in this section.

Table 1. AsciiDoc attributes that control the FB2 metadata
Name Description

uuid

Populates unique book identifier in FB2 metadata.

lang

Populates the content language in FB2 metadata.

keywords

Populates keywords list in FB2 metadata. The keywords should be represented as comma-separated values (CSV).

genres

Populates genres list in FB2 metadata. The genres should be represented as comma-separated values (CSV).

front-cover-image

Specifies path to front cover image.

Development

After checking out the repo, run bundle install to install dependencies. Then, run bundle exec rake spec to run the tests.