-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from FlorianFranzen/bin
Add bin/asciidoctor-multipage executable
- Loading branch information
Showing
4 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# This executable is based on `bin/asciidoctor-pdf` from the | ||
# asciidoctor/asciidoctor-pdf project. Please consult that file for | ||
# potential updates. | ||
|
||
require 'asciidoctor-multipage' | ||
require 'asciidoctor-multipage/version' | ||
require 'asciidoctor/cli' | ||
|
||
options = Asciidoctor::Cli::Options.new backend: 'multipage_html5' | ||
|
||
# FIXME (from asciidoctor-pdf) provide an API in Asciidoctor for sub-components to print version information | ||
unless ARGV != ['-v'] && (ARGV & ['-V', '--version']).empty? | ||
$stdout.write %(Asciidoctor Multipage #{AsciidoctorMultipage::VERSION} using ) | ||
options.print_version | ||
exit 0 | ||
end | ||
|
||
# FIXME (from bespoke) This is a really bizarre API. Please make me simpler. | ||
if Integer === (result = options.parse! ARGV) | ||
exit result | ||
else | ||
invoker = Asciidoctor::Cli::Invoker.new options | ||
GC.start | ||
invoker.invoke! | ||
exit invoker.code | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# coding: utf-8 | ||
|
||
require 'asciidoctor' | ||
require 'asciidoctor/converter/html5' | ||
|
||
class Asciidoctor::AbstractBlock | ||
|