The Inbox: HelpSystem-Core-kfr.75.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: HelpSystem-Core-kfr.75.mcz

commits-2
A new version of HelpSystem-Core was added to project The Inbox:
http://source.squeak.org/inbox/HelpSystem-Core-kfr.75.mcz

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

Name: HelpSystem-Core-kfr.75
Author: kfr
Time: 13 May 2015, 1:52:38.849 pm
UUID: 5b487f7f-b174-5343-894a-aff28511d4fa
Ancestors: HelpSystem-Core-mt.74

HelpBrowser>>accept: changed so it works. The changed topic is compiled but the current topic loaded in the HelpBrowser is not updated

=============== Diff against HelpSystem-Core-mt.74 ===============

Item was changed:
  ----- Method: HelpBrowser>>accept: (in category 'actions') -----
  accept: text
  "Accept edited text. Compile it into a HelpTopic"
 
+ | code topicClass topicMethod updatedTopic |
+ "true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being']."
+ (self find: (self currentTopic contents copyFrom: 1 to: 20)) asArray
+ ifNotEmpty: [:refs |
- | code topicClass topicMethod |
- true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being'].
- (self find: self topic contents) asArray ifNotEmpty: [:refs |
  topicClass := refs first actualClass theNonMetaClass.
  topicMethod := refs first selector].
 
  code := String streamContents:[:s|
  s nextPutAll: topicMethod.
  s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'.
  s crtab; nextPutAll: '"', self name,' edit: ', topicMethod storeString,'"'.
  s crtab; nextPutAll: '^HelpTopic'.
  s crtab: 2; nextPutAll: 'title: ', currentTopic title storeString.
  s crtab: 2; nextPutAll: 'contents: '.
  s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: text]) storeString.
  s nextPutAll:' readStream nextChunkText'.
  ].
 
+ updatedTopic := topicClass class
- topicClass class
  compile: code
  classified: ((topicClass class organization categoryOfElement: topicMethod) ifNil:['pages']).
+
-
  self flag: #fixme. "mt: Update will not work because the topic builder eagerly cached all the contents and lost track of its origins. We need to get rid of the topic builders and create topic contents lazily resp. live."
+ self currentTopic: updatedTopic.
-
  self changed: #toplevelTopics..
  self changed: #currentTopic.
  self changed: #topicContents.
      !


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

marcel.taeumel
This can only work for ClassBasedHelpTopics because those have contents encoded in methods and classes (being subclasses of CustomHelp). Can you add a check for that?

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

marcel.taeumel
The pages are cached so they can be found and navigated to from the search results. We could think about some cache invalidation for changed pages.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

Karl Ramberg
In reply to this post by marcel.taeumel
I added a basic way that give info that a help topic is not editable.

Karl

On Wed, May 13, 2015 at 3:10 PM, marcel.taeumel <[hidden email]> wrote:
This can only work for ClassBasedHelpTopics because those have contents
encoded in methods and classes (being subclasses of CustomHelp). Can you add
a check for that?

Best,
Marcel



--
View this message in context: http://forum.world.st/The-Inbox-HelpSystem-Core-kfr-75-mcz-tp4826158p4826168.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

Karl Ramberg
In reply to this post by marcel.taeumel
Yes, reloading of topics would be good.
I'm not quite sure how to do it yet. 

Karl

On Wed, May 13, 2015 at 3:18 PM, marcel.taeumel <[hidden email]> wrote:
The pages are cached so they can be found and navigated to from the search
results. We could think about some cache invalidation for changed pages.

Best,
Marcel



--
View this message in context: http://forum.world.st/The-Inbox-HelpSystem-Core-kfr-75-mcz-tp4826158p4826172.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

marcel.taeumel
We could add the notion of a #parent. Then each topic could tell its parent that it has changed. The parent topic then just updates the cache/subtopics.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

Karl Ramberg
Hi,
I made an attempt at updating the topic in place.
There are some issues with it still, the edited topic changes place in the topic list in the treeMorph.

I'm also a little confused why we have two hierarchies ( rootTopic and topLevelTopics) with the help topics.
It would seem that one would be enough ?

On Wed, May 13, 2015 at 7:37 PM, marcel.taeumel <[hidden email]> wrote:
We could add the notion of a #parent. Then each topic could tell its parent
that it has changed. The parent topic then just updates the cache/subtopics.

Best,
Marcel



--
View this message in context: http://forum.world.st/The-Inbox-HelpSystem-Core-kfr-75-mcz-tp4826158p4826254.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

marcel.taeumel
The tree widget expects a list of "roots" but the help browser es exactly one, which is not visible but encoded in the windows title bar.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

Karl Ramberg
Ok

Karl

On Thu, May 14, 2015 at 11:02 AM, marcel.taeumel <[hidden email]> wrote:
The tree widget expects a list of "roots" but the help browser es exactly
one, which is not visible but encoded in the windows title bar.

Best,
Marcel



--
View this message in context: http://forum.world.st/The-Inbox-HelpSystem-Core-kfr-75-mcz-tp4826158p4826317.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

marcel.taeumel
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: HelpSystem-Core-kfr.75.mcz

Karl Ramberg
This looks nice :-)



Karl

On Thu, May 14, 2015 at 6:30 PM, marcel.taeumel <[hidden email]> wrote:
How's this:
http://forum.world.st/The-Inbox-HelpSystem-Core-mt-78-mcz-td4826370.html

:)

Best,
Marcel



--
View this message in context: http://forum.world.st/The-Inbox-HelpSystem-Core-kfr-75-mcz-tp4826158p4826371.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.