-
Notifications
You must be signed in to change notification settings - Fork 176
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
make rendering of substeps as separate page optional #174
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,13 @@ parser.script('decktape').options({ | |
default : 0, | ||
help : 'Duration in milliseconds between the page has loaded and starting to export slides', | ||
}, | ||
enableSubsteps: { | ||
abbr: 'substeps', | ||
metavar: '<true|false>', | ||
type: 'boolean', | ||
help: 'If substeps should be used as separate slides', | ||
default: true | ||
}, | ||
screenshots : { | ||
default : false, | ||
flag : true, | ||
|
@@ -299,8 +306,18 @@ async function exportSlides(plugin, page, printer) { | |
exportedSlides : 0, | ||
pdfFonts : {}, | ||
pdfXObjects : {}, | ||
totalSlides : await plugin.slideCount(), | ||
totalSlides : await plugin.slideCount(options.enableSubsteps), | ||
}; | ||
|
||
if(options.enableSubsteps===false){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is specific to Impress so that should better be added to the The |
||
page.$$eval('.substep', substeps => { | ||
substeps.forEach(substep=>{ | ||
substep.classList.remove('substep'); | ||
substep.classList.add('substep-visible'); | ||
}); | ||
}) | ||
} | ||
|
||
// TODO: support a more advanced "fragment to pause" mapping | ||
// for special use cases like GIF animations | ||
// TODO: support plugin optional promise to wait until a particular mutation | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,15 @@ class Impress { | |
}); | ||
} | ||
|
||
slideCount() { | ||
slideCount(enableSubsteps) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd be preferable to have the |
||
if(enableSubsteps){ | ||
return this.page.evaluate(_ => | ||
document.querySelectorAll('#impress .step, #impress .substep').length); | ||
} | ||
return this.page.evaluate(_ => | ||
document.querySelectorAll('#impress .step, #impress .substep').length); | ||
document.querySelectorAll('#impress .step').length); | ||
|
||
|
||
} | ||
|
||
nextSlide() { | ||
|
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.
This would basically cover #24. I wonder what could be the best terminology across all the HTML presentation frameworks. Reveal calls it fragments, other refer to incremental display of slide content...