Skip to content

Commit

Permalink
add preview
Browse files Browse the repository at this point in the history
  • Loading branch information
noraj committed Nov 1, 2021
1 parent b66ec7a commit 0b051c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@
--top-level-division=chapter \
--highlight-style #{style}
)
puts "\n[+] PDF generated at #{pdf}"

# Preview
puts "\n[+] Do you want to preview the report? [y/N]"
print '> '
choice = gets.chomp
if choice.downcase == 'y'
viewer = fork do
exec "xdg-open #{pdf}"
end
Process.detach(viewer)
end

# Generating archive
puts "\n[+] Generating archive..."
Expand Down

0 comments on commit 0b051c5

Please sign in to comment.