From f73c12ac156e710bca31751922b6b7e95fba83bf Mon Sep 17 00:00:00 2001 From: Yuxuan 'fishy' Wang Date: Wed, 20 Aug 2014 17:14:11 -0700 Subject: [PATCH] Bump asciidoctorj to 1.5.0. Formerly asciidoctor-java-integration. This will fix the mixed content issue when serving the docs over https. Change-Id: I1f5ba308151e710299cd8c6fa69d93839ece7443 --- Documentation/asciidoc.defs | 5 ++++- Documentation/config.defs | 1 + lib/asciidoctor/BUCK | 5 +++-- lib/asciidoctor/java/AsciiDoctor.java | 5 ++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Documentation/asciidoc.defs b/Documentation/asciidoc.defs index 7adf265bee..4d00c50003 100644 --- a/Documentation/asciidoc.defs +++ b/Documentation/asciidoc.defs @@ -24,6 +24,7 @@ def genasciidoc( asciidoc = [ '$(exe //lib/asciidoctor:asciidoc)', '-z', '$OUT', + '--base-dir', '$SRCDIR', '--tmp', '$TMP', '--in-ext', '".txt%s"' % EXPN, '--out-ext', '".html"', @@ -57,7 +58,9 @@ def genasciidoc( out = ex, ) - asciidoc.append('$(location :%s)' % ex) + # The new AsciiDoctor requires both the css file and include files are under + # the same directory. Luckily Buck allows us to use :target as SRCS now. + newsrcs.append(':%s' % ex) genrule( name = name, diff --git a/Documentation/config.defs b/Documentation/config.defs index 642b91561c..8d67173d18 100644 --- a/Documentation/config.defs +++ b/Documentation/config.defs @@ -16,5 +16,6 @@ def documentation_attributes(revision): 'last-update-label!', 'source-highlighter=prettify', 'stylesheet=doc.css', + 'linkcss=true', 'revnumber="%s"' % revision, ] diff --git a/lib/asciidoctor/BUCK b/lib/asciidoctor/BUCK index b1d5933eb4..66a12c1c78 100644 --- a/lib/asciidoctor/BUCK +++ b/lib/asciidoctor/BUCK @@ -15,6 +15,7 @@ java_library( ':jruby', '//lib:args4j', '//lib:guava', + '//lib/log:api', ], visibility = ['//tools/eclipse:classpath'], ) @@ -42,8 +43,8 @@ java_library( maven_jar( name = 'asciidoctor', - id = 'org.asciidoctor:asciidoctor-java-integration:0.1.4', - sha1 = '3596c7142fd30d7b65a0e64ba294f3d9d4bd538f', + id = 'org.asciidoctor:asciidoctorj:1.5.0', + sha1 = '192df5660f72a0fb76966dcc64193b94fba65f99', license = 'Apache2.0', visibility = [], attach_source = False, diff --git a/lib/asciidoctor/java/AsciiDoctor.java b/lib/asciidoctor/java/AsciiDoctor.java index 9e48641950..c7562df111 100644 --- a/lib/asciidoctor/java/AsciiDoctor.java +++ b/lib/asciidoctor/java/AsciiDoctor.java @@ -53,6 +53,9 @@ public class AsciiDoctor { @Option(name = "--out-ext", usage = "extension for output files") private String outExt = ".html"; + @Option(name = "--base-dir", usage = "base directory") + private File basedir; + @Option(name = "--tmp", usage = "temporary output path") private File tmpdir; @@ -82,7 +85,7 @@ public class AsciiDoctor { OptionsBuilder optionsBuilder = OptionsBuilder.options(); optionsBuilder.backend(backend).docType(DOCTYPE).eruby(ERUBY) - .safe(SafeMode.UNSAFE); + .safe(SafeMode.UNSAFE).baseDir(basedir); // XXX(fishywang): ideally we should just output to a string and add the // content into zip. But asciidoctor will actually ignore all attributes if // not output to a file. So we *have* to output to a file then read the