But when the same document is run through asciidoctorj inside my web app like this:
private final Asciidoctor asciidoctor = Asciidoctor.Factory.create();
Attributes attributes = new Attributes();
File readme = new File(unzippedRoot.getAbsolutePath() + File.separator + "README.adoc");
content = asciidoctor.renderFile(
...this is what I see:
<div class="paragraph"> <p>This guide walks you through the process of creating a "hello world" RESTful web service with Spring.</p> </div> ...
It appears the entire <html><header></header></html> part has been stripped out and only that which is inside the <div id="content"> tag. Is there a setting to give me ALL the HTML? I wanted to run a Jsoup query and extract the table of contents so I can stuff it in a sidebar. But that doesn't appear visible.
Re: asciidoctorj generates different HTML than command line asciidoctor
Whenever you invoke Asciidoctor through an API (either the Ruby one or the Java one), the document is rendered as embeddable HTML (body only, no header & footer). You'll need to explicitly enable the header/footer option in the API.
The one exception is when you write directly to disk. Since writing embeddable HTML in a standalone file rarely makes sense, we follow the intent.
The history behind this default in the API is that it was once a requirement for Asciidoctor to run on GitHub. We've kept it for backwards compatibility reasons.
Hopefully that clears things up!
On Nov 27, 2013 6:47 AM, "gregturn [via Asciidoctor :: Discussion]" <[hidden email]> wrote:
UPDATE: When I render the document "in place", then the HTML file on disk appears to have everything. Is this by design?