Login  Register

Re: asciidoctorj generates different HTML than command line asciidoctor

Posted by gregturn on Nov 27, 2013; 1:46pm
URL: https://discuss.asciidoctor.org/asciidoctorj-generates-different-HTML-than-command-line-asciidoctor-tp1137p1138.html

UPDATE: When I render the document "in place", then the HTML file on disk appears to have everything. Is this by design?

            Attributes attributes = new Attributes();
            attributes.setAllowUriRead(true);
            attributes.setSkipFrontMatter(true);
            File readme = new File(unzippedRoot.getAbsolutePath() + File.separator + "README.adoc");
            asciidoctor.renderFile(
                    readme,
                    OptionsBuilder.options().safe(SafeMode.SAFE).attributes(attributes).inPlace(true));
            content = StreamUtils.copyToString(new FileInputStream(new File(unzippedRoot.getAbsolutePath() + File.separator + "README.html")),
                    Charset.defaultCharset());
Greg Turnquist (@gregturn)
Author of Darklight and Hacking with Spring Boot 2.3
Sign up for my newsletter and get a FREE e-book