The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
=head1 How to create an EPUB ebook from RFCs

There are three steps to create an EPUB ebook from an RFC.

=over 4

=item 1.

Download the RFC tools.ietf.org. Either as HTML:

    wget -O- https://tools.ietf.org/html/rfc2328 > download/rfc2328.html

or as plain text:

    wget -O- https://tools.ietf.org/rfc/rfc2328.txt > download/rfc2328.txt

=item 2.

Since the HTML RFCs from https://tools.ietf.org/html/ are not directly
suitable for use in an EPUB, clean up the HTML file with this script in the
directory I<< examples/rfc >>.

    bin/finish-htmlrfc.pl download/rfc2328.html > clean/rfc2328.html

This HTML-RFC looks exactly as the plain text version and is only suitable for
ebook readers with big screen because it does use the C<< <pre> >> tag to
render the text.

The alternative is to take the plaintext RFC and convert it like this

    bin/rfc2xhtml.pl download/rfc2328.txt > clean/rfc2328.html

This HTML-RFC is formatted using C<< <p> >> tags for paragraphs and
C<< <pre> >> tags only for figures and tables.

=item 3.

Make the EPUB (this works with the output of rfc2xhtml.pl).

    make-epub -publisher IETF \
              -rights 'The Internet Society' \
	      -author 'John Moy' \
	      -title RFC2328 \
	      -tocdepth 2 \
	      -level2 '_tag:h2' \
	      -output rfc2328.epub \
	      clean

=back

=head2 Check your EPUB ebook

If you happen to have installed epubcheck you can verify the EPUB

    epubcheck rfc2328.epub

If there are any problems with the HTML in the ebook,
try to repair them by adjusting the script I<< bin/finish-htmlrfc.pl >>.

If there are any problem with the rest of the EPUB please file a bug at
L<rt.pan.org|https://rt.cpan.org/Public/Dist/Display.html?Name=App-MakeEPUB>.