Pretty Printing Inform 7 Source Code

I want to print out the source code to a Inform 7 game that I am working on with all of the formatting, syntax color coding, etc. that I see in the Inform 7 IDE.

When I print to a color printer from the Inform 7 IDE the text is not word wrapped but cut off by the right margin. The same thing happens when I print to a PDF from the Inform 7 IDE (I am using a Macintosh computer).

I haven’t found anything in the I7 IDE Preferences, Page Setup, or Print dialogs that seems to help. Does anyone know of any way to print all of the source code without lines getting cut off by the right margin?

Thanks in advance.

1 Like

@zarf wrote scripts that use Pygments to style Inform 7 for HTML or RTF; the latter is probably your best bet for printing.

1 Like

Yeah. I haven’t touched that in a couple of years, but it’s what I used to generate, e.g., Heliopause: Source Code (HTML).

1 Like

Alternatively, you can use the directives Release along with the source text and a website. to get a set of HTML pages that include pretty-printed source text on a series of pretty-printed web pages. Of course, that means you have to hit the Release button to generate a release before you can print the web pages.

(You can always remove those directives before release, or proactively put them under a - not for release heading so you don’t accidentally release the source code with the game, if you don’t want to do that.)

2 Likes