-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the option to skip docbook for single page #1391
Conversation
This adds the option to generate html directly from asciidoctor for single page books with `--direct_html`. Right now no books use this but we'd like to migrate all of them too it once we're sure the output looks good for them! Relates to elastic#743
@@ -206,27 +208,7 @@ sub build_single { | |||
$raw_dest->mkpath; | |||
} | |||
|
|||
my %xsltopts = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved next to the xslt invocation.
my ( $output, $died ); | ||
my $dest_xml = $index->basename; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved into the branch that deals with the xml.
@@ -267,25 +254,47 @@ sub build_single { | |||
} or do { $output = $@; $died = 1; }; | |||
_check_build_error( $output, $died, $lenient ); | |||
|
|||
if ( !$lenient ) { | |||
unless ( $direct_html ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything in here is either moved from above or the same as it was before, just indented one more time.
@@ -52,7 +52,6 @@ module.exports = templateSource => { | |||
* at the end of the chunk in case the marker is on the edge. */ | |||
const slice = Math.max(0, chunk.length - preserve); | |||
chunk = chunk.slice(slice) + result.value; | |||
// TODO check if slice + keeps a copy of internal memory. This implementation assumes it *doesn't* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked this while debugging the failure below.
@@ -189,7 +193,8 @@ module.exports = templateSource => { | |||
const out = apply(raw[Symbol.asyncIterator](), lang, initialJsState); | |||
write.on("close", resolve); | |||
write.on("error", reject); | |||
out.on("error", write.destroy); | |||
// out.on("error", write.destroy) doesn't properly forward the error! | |||
out.on("error", err => write.destroy(err)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why this is required. Maybe destroy
is altered once you start the pipe or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perl LGTM!
This adds the option to generate html directly from asciidoctor for
single page books with
--direct_html
. Right now no books use this butwe'd like to migrate all of them too it once we're sure the output looks
good for them!
Relates to #743