[squeak-dev] The Trunk: HelpSystem-Core-tbn.53.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Sep 30 22:11:09 UTC 2010


Torsten Bergmann uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-tbn.53.mcz

==================== Summary ====================

Name: HelpSystem-Core-tbn.53
Author: tbn
Time: 1 October 2010, 12:11:03.269 am
UUID: cffd5e9f-f4db-224d-b40d-7fdab1718a39
Ancestors: HelpSystem-Core-tbn.52

Custom help books are now able to define where subbooks should be placed/displayed

See also http://code.google.com/p/pharo/issues/detail?id=3022 and thanx to Enrico Spinielli for the idea and initial implementation.

=============== Diff against HelpSystem-Core-tbn.52 ===============

Item was changed:
  ----- Method: CustomHelpHelpBuilder>>createTopicFrom: (in category 'private') -----
  createTopicFrom: aDescription
+ 	"Create a topic from a description stored on a class.
+ 	aDescription can specify (via #pages) the name of a class and not
+ 	only a selector. This allows for hierarchies with 'subtrees in the middle'"
- 	"Create a topic from a description stored on a class"
  	
+ 	|topic page   pageClasses |
- 	|topic page method pragma   |
  	topic := HelpTopic named: aDescription bookName.
  	topic key: aDescription key.
+ 	topic icon: aDescription icon.
+ 	pageClasses := Set new.
+ 	aDescription pages do: [:pageSelectorOrClass|
+ 		page:= (Smalltalk hasClassNamed: pageSelectorOrClass asString)
+ 					ifFalse: [aDescription perform: pageSelectorOrClass]
+ 					ifTrue: [pageClasses add: (Smalltalk classNamed: pageSelectorOrClass asString).
+ 							 (Smalltalk classNamed: pageSelectorOrClass asString) asHelpTopic].
- 	topic icon: aDescription icon.	
- 	aDescription pages do: [:pageSelector|
- 		page := aDescription perform: pageSelector.	 
  		topic addSubtopic: page.
  	].	
+ 	((aDescription subclasses asSet)
+ 		removeAllFoundIn: pageClasses;
+ 		yourself) do: [:subclass | topic subtopics add: subclass asHelpTopic ].
- 	aDescription subclasses do: [:subclass |
- 		topic subtopics add: subclass asHelpTopic ].
  	^topic!

Item was changed:
  ----- Method: HelpHowToHelpTopicsFromCode classSide>>pages (in category 'accessing') -----
  pages
+ 	^#(overview step1 step2 step3 step4 step5 step6 step7)!
- 	^#(overview step1 step2 step3 step4 step5)!

Item was added:
+ ----- Method: HelpHowToHelpTopicsFromCode classSide>>step6 (in category 'pages') -----
+ step6
+ 	^HelpTopic
+ 		title: 'Step 6 - Add more structure'
+ 		contents:
+ 	'STEP 6 - ADD MORE STRUCTURE
+ 
+ If you add a new subclass to your custom help class and repeating step 2 to 4 you can
+ profide new substructures (subbooks) since the help books are mapped to the 
+ class hierarchy. Example:
+  
+ MyAppHelp subclass: #MyAppTutorial
+     	instanceVariableNames: ''''
+ 	  classVariableNames: ''''
+ 	  poolDictionaries: ''''
+ 	  category: ''MyApp-Help'' 
+ 
+ then implement a #bookName, the pages and a #pages method as before on this new 
+ class and reopen the help browser. 		
+ '
+ !

Item was added:
+ ----- Method: HelpHowToHelpTopicsFromCode classSide>>step7 (in category 'pages') -----
+ step7
+ 	^HelpTopic
+ 		title: 'Step 7 - Tips and Tricks'
+ 		contents:
+ 	'STEP 7 - TIPS AND TRICKS
+ 
+ Tip1:
+           If you implement the #pages method you can also 
+           use the name of a custom help class that should be 
+           integrated between the specific pages:
+  
+               #pages
+                    ^(firstPage MyAppTutorial secondPage)
+ 
+ Tip2:
+           You can easily edit the help contents of a page by 
+           using the #edit: message. For our example just evaluate:
+ 
+ 			MyAppHelp edit: #firstPage
+ 			
+ 	     This will open a workspace with the help contents and 
+ 	     when you accept it it will be saved back to the help 
+ 	     method defining the topic.		  
+ 		
+ 
+ '
+ !




More information about the Squeak-dev mailing list