Skip to content
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 a Rakupod directive for a page break #465

Open
tbrowder opened this issue Feb 17, 2025 · 1 comment
Open

Add a Rakupod directive for a page break #465

tbrowder opened this issue Feb 17, 2025 · 1 comment
Labels
language Changes to the Raku Programming Language

Comments

@tbrowder
Copy link
Member

tbrowder commented Feb 17, 2025

Currently there is no way to trigger a page break for a standalone Rakudpod document.

Such a directive is not needed for general use, since long pieces can be broken up into separate files, such as our own Raku documentation exemplifies.

However, when transforming a single Rakupod file into text or PDF, such a directive is very useful, particularly for producing such products as a PDF slide deck for presentations. In such a document, each slide becomes a new page within a single file. With a suitable video projector, the presenter's slides can be shown with a laptop with any OS using almost any PDF viewer, including Adobe's Acrobat Reader.

A simple example of creating a slide deck in Rakupod:

=begin rakupod
=comment use Rakupod to configure standard =page sections

=page
=comment config for slide 1 if needed    

text and graphics for slide 1

=page
=comment config for slide 2 if needed    

text and graphics for slide 2

=end rakupod
@tbrowder tbrowder added the language Changes to the Raku Programming Language label Feb 17, 2025
@zag
Copy link
Member

zag commented Feb 24, 2025

hi, @tbrowder , for creating a presentation, i suggest using a Named blocks (or User-defined blocks) approach. for example, you can handle your tasks using a block, for example, =Slide like this:

=begin Slide :title('test code')

text and graphics for slide 1

=end Slide

this way, you can easily manage page breaks when exporting to pdf, and you can also expand your presentation toolkit with extra features, like adding a background to your slides:

=comment config for slide 1 if needed    
=begin Slide :title('about') 
= :backimage('img/bg.jpg')

text and graphics for slide 1

=end Slide

this approach lets you bring your ideas to life using the current specification and also export to HTML, which can be useful for presentations too 😀.

you can check out a similar implementation in this module: Perl6::Pod::Slide.

of course, my suggestion doesn’t rule out the idea of having a =page or =pagebreak directive in the language!

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language Changes to the Raku Programming Language
Projects
None yet
Development

No branches or pull requests

2 participants