views:

105

answers:

3

What is the best way to print - syntax colored and well formatted - code from Pharo/Squeak on paper?

1) Is there a way to print directly from within Pharo/Squeak? (i use it on macosx)
2) Is there a way to export syntax colored, well formatted code from Pharo/Squak?
3) Are there external tools to color and format a filed out piece of code?

A: 

1) Install shout from www.squeaksource.com

2) I don't know. May be you can customize shout.

3) In gnu-smalltalk you have a smalltalk mode for emacs. But I am not pretty sure to understand what you are looking for.

mathk
I’m looking for a way to read smalltalk code. And i wanted to print it on paper (the question was not about „pretty-print“ in the smalltalk-browser).
A: 

Pharo browsers seem to use syntax highlighting.

What difficulty are you having reading Smalltalk code using the browsers and senders/implementors ?

Edit: Would something that produces UML give the overview you're looking for? The Dandelion website only shows downloads for old Squeak versions - I don't know if they would work with Pharo.

And perhaps this GSoC project "Generate UML diagrams from Smalltalk code for Pharo" suggests not.

igouy
The Pharo browsers are good. It’s just my desk is so much bigger than my screen - so i can have a look at so much more code at once - and i think it’s easier to get the „big picture“.At the moment i print screenshots from the Pharo browser for each class - this gives me something in the spirit of crc-cards (http://c2.com/doc/crc/draw.html)
@roy-fleming - I was never even slightly tempted to do that with Smalltalk so it's quite puzzling to me.
igouy
A: 

For the appendix in my master thesis I used the Pier CMS-to-LaTeX converter in the Pier-Documentation package. However, this plugin only takes class comments and method comments into consideration, it does not print the source code. Pier also provides a package ShoutPier for syntax highlighting of Smalltalk code, so I guess it would require little work to bring the two together. You can find the mentioned extension packages in http://source.lukas-renggli.ch/pieraddons.html.

Lukas Renggli
Thank you. I was able to get some nice printouts using PRLatexBuilder.
Nevertheless i hoped something like this would be a common task and built into the standard system.. But it seems people don’t print code on paper so often?
Earlier versions of Squeak (around version 3.0) had a HTML exporter similar to the file-out mechanism still present today. I guess that could have worked for printing. It was removed at some point because nobody used it and it broke over time.
Lukas Renggli