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.
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.
Name | Description |
---|---|
|
Populates unique book identifier in FB2 metadata. |
|
Populates the content language in FB2 metadata. |
|
Populates keywords list in FB2 metadata. The keywords should be represented as comma-separated values (CSV). |
|
Populates genres list in FB2 metadata. The genres should be represented as comma-separated values (CSV). |
|
Specifies path to front cover image. |