-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add extended converter example that turns off running content on empt…
…y pages
- Loading branch information
1 parent
253dbcc
commit 591a590
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
docs/modules/extend/examples/pdf-converter-no-running-content-empty-page.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class NoRunningContentOnEmptyPageConverter < (Asciidoctor::Converter.for 'pdf') | ||
register_for 'pdf' | ||
|
||
def ink_running_content(*) | ||
state.pages.each do |page_| | ||
page_.imported if page_.empty? | ||
end | ||
# or | ||
#(1..page_count).each do |pgnum| | ||
# go_to_page pgnum | ||
# page.imported if page.empty? | ||
# ## to write content to an empty page, use this next statement instead | ||
# #ink_prose ' ' if page.empty? | ||
#end | ||
super | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters