Making screenshots programmatically for book
What is the best way to make screenshots for documentation? In Pillar we mostly have a figures directory with pngs. With the change rate of Pharo, making them by hand seems a bad idea. Stephan
Why not putting Smalltalk code that will take the screenshot and save it in the documentation ? Makes good functionnal tests too à la Python. Laurent Le vendredi 2 mai 2014, 11:27:47 Stephan Eggermont a écrit :
What is the best way to make screenshots for documentation? In Pillar we mostly have a figures directory with pngs. With the change rate of Pharo, making them by hand seems a bad idea.
Stephan
Very interesting concept, it indeed could help keep the images up to date with Pharo :) Maybe we should agree on some convention or use a common library for them that will take these images with just a single message ? Or even make it part of Pillar syntax ? On Fri, May 2, 2014 at 1:07 PM, Laurent Laffont <laurent.laffont@gmail.com>wrote:
Why not putting Smalltalk code that will take the screenshot and save it in the documentation ? Makes good functionnal tests too à la Python.
Laurent
Le vendredi 2 mai 2014, 11:27:47 Stephan Eggermont a écrit :
What is the best way to make screenshots for documentation? In Pillar we mostly have a figures directory with pngs. With the change rate of Pharo, making them by hand seems a bad idea.
Stephan
On Fri, May 2, 2014 at 12:07 PM, Laurent Laffont <laurent.laffont@gmail.com> wrote:
Why not putting Smalltalk code that will take the screenshot and save it in the documentation ? Makes good functionnal tests too à la Python.
FYI, it is possible to include Smalltalk code in Pillar files that will be executed when the Pillar file is compiled. This Smalltalk code can write to a stream in order to generate dynamic content. I use it to generate a part of Pillar documentation ( https://github.com/DamienCassou/pillar-documentation#42--configuration-param...) : [[[language=Smalltalk|eval=true | writeConfigurationParameter | writeConfigurationParameter := [: pragma | | methodWithDefaultValue methodComment | methodComment := [ :aMethod | aMethod comment ifNil: [ 'uncommented' ] ifNotNil: [ :comment | comment trimBoth: [ :c | c = $" ] ] ]. methodWithDefaultValue := pragma methodClass >> (#default , pragma selector capitalized) asSymbol. stream nextPutAll: '!!!! ' , pragma selector; lf; nextPutAll: '@sec:confParam:', pragma selector; lf; nextPutAll: (methodComment value: pragma method); lf; lf; nextPutAll: ';Default value'; lf; nextPutAll: ':'; nextPutAll: (methodWithDefaultValue comment ifNotNil: [ methodComment value: methodWithDefaultValue ] ifNil: [ methodWithDefaultValue isQuick ifTrue: [ '==', methodWithDefaultValue ast statements first value formattedCode, '==' ] ifFalse: [ 'uncommented' ] ]); lf; lf ]. ((Pragma allNamed: #pillarConfigurationParameter in: PRExportConfiguration) sort: [ :p1 :p2 | p1 selector < p2 selector ]) do: [ :pragma | writeConfigurationParameter value: pragma ] ]]] -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
2014-05-02 10:27 GMT+01:00 Stephan Eggermont <stephan@stack.nl>:
What is the best way to make screenshots for documentation? In Pillar we mostly have a figures directory with pngs. With the change rate of Pharo, making them by hand seems a bad idea.
Adapting PasteUpMorph>>#makeAScreenshot? Cheers, Sergi
I'm interested in the solution you propose. To me it should load a package run some code open the right window and save the screenshots. Right now working on https://ci.inria.fr/pharo-contribution/job/PharoLaserGame/17/artifact/LaserG... Stef On 2/5/14 11:27, Stephan Eggermont wrote:
What is the best way to make screenshots for documentation? In Pillar we mostly have a figures directory with pngs. With the change rate of Pharo, making them by hand seems a bad idea.
Stephan
participants (6)
-
Damien Cassou -
kilon alios -
Laurent Laffont -
Sergi Reyner -
Stephan Eggermont -
stepharo