asciidoctor-latex 1.5.0.dev → 1.5.0.1.dev
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +118 -122
- data/data/extras.css +6 -0
- data/{try-out → examples}/README.adoc +8 -4
- data/examples/box.adoc +16 -0
- data/examples/chem.adoc +17 -0
- data/{try-out → examples}/click.adoc +0 -0
- data/{try-out → examples}/code.adoc +0 -0
- data/{try-out → examples}/env.adoc +0 -0
- data/examples/eq-alignment.adoc +5 -0
- data/examples/eq-block.adoc +60 -0
- data/{try-out → examples}/eq-latex.adoc +0 -0
- data/{try-out → examples}/eq-stem.adoc +0 -0
- data/{try-out → examples}/eqno-latex.adoc +0 -0
- data/{try-out → examples}/math_article.adoc +0 -0
- data/{try-out → examples}/pyth-stem.adoc +0 -0
- data/{try-out → examples}/theorem-latex.adoc +0 -0
- data/{try-out → examples}/xref-equations.adoc +2 -1
- data/lib/asciidoctor/latex/click_block.rb +0 -2
- data/lib/asciidoctor/latex/converter.rb +90 -77
- data/lib/asciidoctor/latex/environment_block.rb +44 -26
- data/lib/asciidoctor/latex/prepend_processor.rb +1 -1
- data/lib/asciidoctor/latex/preprocess.rb +0 -8
- data/lib/asciidoctor/latex/tex_preprocessor.rb +2 -2
- data/lib/asciidoctor/latex/version.rb +1 -1
- data/manual.adoc +2 -2
- data/test/examples/adoc/env.adoc +1 -9
- data/test/examples/adoc/eq.adoc +1 -1
- data/test/examples/adoc/zero.adoc +2 -0
- data/test/examples/asciidoc-html/env.adoc +103 -0
- data/test/examples/asciidoc-html/equations.adoc +15 -0
- data/test/examples/tex/env.tex +1 -127
- data/test/examples/tex/eq.tex +2 -125
- data/test/examples/tex/zero.tex +2 -120
- metadata +39 -21
- data/rake/cacert.pem +0 -3894
- data/rake/jdk_helper.rb +0 -105
- data/rake/tar-licence +0 -19
- data/rake/tar.rb +0 -38
- data/test/examples/asciidoc-html/block_open.adoc +0 -17
data/rake/jdk_helper.rb
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
require 'open-uri'
|
2
|
-
require 'progressbar'
|
3
|
-
require_relative 'tar'
|
4
|
-
|
5
|
-
include Util::Tar
|
6
|
-
|
7
|
-
class JdkHelper
|
8
|
-
|
9
|
-
def self.extract_jdk path, extract_folder
|
10
|
-
FileUtils.remove_dir extract_folder, :force => true
|
11
|
-
io = ungzip File.new(path, "r")
|
12
|
-
untar io, extract_folder
|
13
|
-
jdk_bin_dir = "#{extract_folder}/bin"
|
14
|
-
File.chmod(0755, "#{jdk_bin_dir}/jjs")
|
15
|
-
File.chmod(0755, "#{jdk_bin_dir}/javac")
|
16
|
-
File.chmod(0755, "#{jdk_bin_dir}/java")
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.download_binary_file url, destination_file
|
20
|
-
if File.file?(destination_file)
|
21
|
-
puts "File #{destination_file} already exists, skipping download"
|
22
|
-
else
|
23
|
-
puts "Downloading #{url} in #{destination_file}..."
|
24
|
-
pbar = nil
|
25
|
-
bindata = open(url, 'rb', :content_length_proc => lambda { |t|
|
26
|
-
if t && 0 < t
|
27
|
-
pbar = ProgressBar.new("...", t)
|
28
|
-
pbar.file_transfer_mode
|
29
|
-
end
|
30
|
-
}, :progress_proc => lambda {|s|
|
31
|
-
pbar.set s if pbar
|
32
|
-
}) {|file| file.read }
|
33
|
-
IO.binwrite(destination_file, bindata)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.get_jdk9_download_url
|
38
|
-
jdk_id = OS.windows? ? 'winOffline64JDK' : 'lin64JDKrpm'
|
39
|
-
get_jdk_download_url jdk_id, 'https://jdk9.java.net/download/'
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.get_jdk8_download_url
|
43
|
-
jdk_id = OS.windows? ? 'winOffline64JDK' : 'lin64JDKrpm'
|
44
|
-
get_jdk_download_url jdk_id, 'https://jdk8.java.net/download.html'
|
45
|
-
end
|
46
|
-
|
47
|
-
def self.get_jdk_download_url jdk_id, url
|
48
|
-
html = open(url) {|file| file.read }
|
49
|
-
jdk_url_regexp = /document\.getElementById\(\"#{jdk_id}\"\)\.href = \"http:\/\/www.java.net\/download\/(.*)\";/
|
50
|
-
# Avoid redirection http -> https
|
51
|
-
"http://download.java.net/#{html.match(jdk_url_regexp).captures[0]}"
|
52
|
-
end
|
53
|
-
|
54
|
-
def self.compile_run_java_nashorn javac_bin, java_bin, file_path, class_name
|
55
|
-
puts "Compiling #{file_path} into build..."
|
56
|
-
`\"#{javac_bin}\" ./#{file_path} -d ./build`
|
57
|
-
puts "Compiling #{file_path} into build... OK"
|
58
|
-
puts "Running Nashorn java #{class_name}..."
|
59
|
-
beginning_time = Time.now
|
60
|
-
output = `\"#{java_bin}\" -classpath ./build #{class_name}`
|
61
|
-
end_time = Time.now
|
62
|
-
puts "Running Nashorn java #{class_name}... OK in #{(end_time - beginning_time)*1000} ms"
|
63
|
-
output
|
64
|
-
end
|
65
|
-
|
66
|
-
def self.run_jjs_nashorn jjs_bin, jjs_script
|
67
|
-
puts "Running Nashorn jjs #{jjs_script}..."
|
68
|
-
beginning_time = Time.now
|
69
|
-
output = `\"#{jjs_bin}\" #{jjs_script}`
|
70
|
-
end_time = Time.now
|
71
|
-
puts "Running Nashorn jjs #{jjs_script}... OK in #{(end_time - beginning_time)*1000} ms"
|
72
|
-
output
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
class Assertion
|
77
|
-
def self.check_convert output, test_name
|
78
|
-
unless output.include? "<h1>asciidoctor.js, AsciiDoc in JavaScript</h1>"
|
79
|
-
puts "output #{output}"
|
80
|
-
raise "#{test_name} failed, AsciiDoc source is not converted"
|
81
|
-
end
|
82
|
-
unless output.include? "include content"
|
83
|
-
puts "output #{output}"
|
84
|
-
raise "#{test_name} failed, include directive is not processed"
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
module OS
|
90
|
-
def OS.windows?
|
91
|
-
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
|
92
|
-
end
|
93
|
-
|
94
|
-
def OS.mac?
|
95
|
-
(/darwin/ =~ RUBY_PLATFORM) != nil
|
96
|
-
end
|
97
|
-
|
98
|
-
def OS.unix?
|
99
|
-
!OS.windows?
|
100
|
-
end
|
101
|
-
|
102
|
-
def OS.linux?
|
103
|
-
OS.unix? and not OS.mac?
|
104
|
-
end
|
105
|
-
end
|
data/rake/tar-licence
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Copyright (C) 2011 by Colin MacKenzie IV
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
5
|
-
in the Software without restriction, including without limitation the rights
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
8
|
-
furnished to do so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
11
|
-
all copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
THE SOFTWARE.
|
data/rake/tar.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rubygems/package'
|
3
|
-
require 'zlib'
|
4
|
-
require 'fileutils'
|
5
|
-
|
6
|
-
module Util
|
7
|
-
module Tar
|
8
|
-
# un-gzips the given IO, returning the
|
9
|
-
# decompressed version as a StringIO
|
10
|
-
def ungzip(tarfile)
|
11
|
-
z = Zlib::GzipReader.new(tarfile)
|
12
|
-
unzipped = StringIO.new(z.read)
|
13
|
-
z.close
|
14
|
-
unzipped
|
15
|
-
end
|
16
|
-
|
17
|
-
# untars the given IO into the specified
|
18
|
-
# directory
|
19
|
-
def untar(io, destination)
|
20
|
-
Gem::Package::TarReader.new io do |tar|
|
21
|
-
tar.each do |tarfile|
|
22
|
-
# NOTE skip the root directory of the tarfile
|
23
|
-
destination_file = File.join destination, tarfile.full_name.split('/', 2).last
|
24
|
-
|
25
|
-
if tarfile.directory?
|
26
|
-
FileUtils.mkdir_p destination_file
|
27
|
-
else
|
28
|
-
destination_directory = File.dirname(destination_file)
|
29
|
-
FileUtils.mkdir_p destination_directory unless File.directory?(destination_directory)
|
30
|
-
File.open destination_file, "wb" do |f|
|
31
|
-
f.print tarfile.read
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
// .env_theorem
|
2
|
-
[env.theorem]
|
3
|
-
--
|
4
|
-
There exist infinitely many prime numbers.
|
5
|
-
--
|
6
|
-
|
7
|
-
// .env_equation
|
8
|
-
[env.equation]
|
9
|
-
--
|
10
|
-
a^{p-1} \equiv 1\ \text{mod}\ p
|
11
|
-
--
|
12
|
-
|
13
|
-
// .click_comment
|
14
|
-
[click.comment]
|
15
|
-
--
|
16
|
-
It is sometimes useful to "hide" a comment ...
|
17
|
-
--
|