简体   繁体   English

如何从Pharo / Squeak打印Smalltalk代码?

[英]How to print Smalltalk code from Pharo/Squeak?

What is the best way to print - syntax colored and well formatted - code from Pharo/Squeak on paper? 什么是最好的打印方式 - 语法彩色和格式良好 - Pharo / Squeak的代码在纸上?

1) Is there a way to print directly from within Pharo/Squeak? 1)有没有办法直接从Pharo / Squeak内打印? (i use it on macosx) (我在macosx上使用它)
2) Is there a way to export syntax colored, well formatted code from Pharo/Squak? 2)有没有办法从Pharo / Squak导出语法彩色,格式良好的代码?
3) Are there external tools to color and format a filed out piece of code? 3)是否有外部工具可以对存档的代码进行着色和格式化?

For the appendix in my master thesis I used the Pier CMS -to-LaTeX converter in the Pier-Documentation package. 对于硕士论文中的附录,我在Pier-Documentation包中使用了Pier CMS -to-LaTeX转换器。 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. Pier还提供了一个ShoutPier软件包,用于语法高亮显示Smalltalk代码,因此我想将两者结合起来只需要很少的工作。 You can find the mentioned extension packages in http://source.lukas-renggli.ch/pieraddons.html . 您可以在http://source.lukas-renggli.ch/pieraddons.html中找到所提到的扩展包。

Here's how I did it on my Mac, I think this should work on other platforms too. 这是我在Mac上的表现,我认为这也适用于其他平台。

  1. Save your categories to a Monticello local folder on your disk -- see the Pharo manual on how to do this: http://book.pharo-project.org/book/PharoTools/Monticello/?_s=hdGOLc_FXsvVY1iR&_k=YYH-Ln8f5mtWZ8z2&_n&148 将您的类别保存到磁盘上的Monticello本地文件夹 - 请参阅Pharo手册,了解如何执行此操作: http ://book.pharo-project.org/book/PharoTools/Monticello/?_s = HDGOLc_FXsvVY1iR&_k = YYH-Ln8f5mtWZ8z2 &_n& 148

  2. Browse to this folder, and unzip the .mcz file 浏览到此文件夹,然后解压缩.mcz文件

  3. You'll see all your code in snapshot/source.st file 您将在snapshot / source.st文件中看到所有代码

  4. You'll need to edit this a bit, to remove the ! 你需要编辑一下,删除! characters for eg, there might be a tool to do this? 例如,可能有一个工具来做这个?

-Eric. -Eric。

有webdoc项目,它允许您在Web浏览器中导航代码: http ://ss3.gemstone.com/ss/webdoc.html(当然,您可以从您喜欢的Web浏览器打印代码)。

Pharo browsers seem to use syntax highlighting. Pharo浏览器似乎使用语法高亮。

What difficulty are you having reading Smalltalk code using the browsers and senders/implementors ? 使用浏览器和发件人/实现者阅读Smalltalk代码有什么困难?

Edit: Would something that produces UML give the overview you're looking for ? 编辑:产生UML的东西是否会提供您正在寻找的概述 The Dandelion website only shows downloads for old Squeak versions - I don't know if they would work with Pharo. 蒲公英网站仅显示旧Squeak版本的下载 - 我不知道它们是否可以与Pharo一起使用。

And perhaps this GSoC project "Generate UML diagrams from Smalltalk code for Pharo" suggests not. 也许这个GSoC项目“从 Phapp的Smalltalk代码生成UML图”表明没有。

1) Install shout from www.squeaksource.com 1)从www.squeaksource.com安装呼叫

2) I don't know. 2)我不知道。 May be you can customize shout. 也许你可以自定义喊叫。

3) In gnu-smalltalk you have a smalltalk mode for emacs. 3)在gnu-smalltalk中,你有一个针对emacs的smalltalk模式。 But I am not pretty sure to understand what you are looking for. 但我不太清楚你在寻找什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM