help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Documentation syntax


From: Mike Anderson
Subject: Re: [Help-smalltalk] Documentation syntax
Date: Sat, 19 Aug 2006 16:29:26 +0000
User-agent: Mozilla Thunderbird 1.0.5 (X11/20050711)

Stewart Stremler wrote:

> Elsethread it was recommended that we have package-level documentation,
> which I thing would be pretty useful as well.

I definitely agree.

> A parent- and child-hierarchy and a used-by list would be on my wishlist.

What is used-by? A reversed pre-requisites? Try the attached. That's
generated from:

        | pkgs usedBy |
        pkgs := PackageLoader packages.
        usedBy := LookupTable new: pkgs size.
        pkgs do: [ :pkg | usedBy at: pkg name put: Set new ].
        pkgs do:
                [ :pkg | pkg prerequisites do:
                        [ :prq | usedBy at: prq ifPresent:
                                [ :set | set add: pkg name ] ] ].

Incidentally, that showed up that DhbNumericalMethods relies on
DhbNumericalMethodsExtensions, which doesn't exist.

> The document writer could put in type hints for the document reader,
> as the document reader needs more information than the code reader...
> 
>   " ...
>   @arg start a {Number} not less than 0 indicating the start position.
>   @arg end a {Number} not less than _start_ indicating the end position.
>     ..."
> 
> (Mabye type-hints? e.g. "@arg Number start ...." -- but that feels
> like it would go terribly wrong...)

I'd say so:

Object >> perform: selectorOrMessageOrMethod

"Send the unary message named selectorOrMessageOrMethod (if a Symbol) to
the receiver, or the message and arguments it identifies (if a Message
or DirectedMessage), or finally execute the method within the receiver
(if a CompiledMethod). ..."

Regards,

Mike

Applets

Pre-requisites

Used by

None

Blox

Pre-requisites

Used by

BloxGTK

Pre-requisites

Used by

None

BloxTK

Pre-requisites

None

Used by

Browser

Pre-requisites

Used by

None

Browser-Servlet

Pre-requisites

Used by

None

Cairo

Pre-requisites

Used by

CLibraries

Pre-requisites

Used by

Compiler

Pre-requisites

Used by

None

DB

Pre-requisites

None

Used by

DhbNumericalMethods

Pre-requisites

Used by

None

GDBM

Pre-requisites

None

Used by

None

Glorp

Pre-requisites

Used by

None

GTK

Pre-requisites

None

Used by

I18N

Pre-requisites

None

Used by

None

Imlib2

Pre-requisites

Used by

Java

Pre-requisites

Used by

None

MD5

Pre-requisites

None

Used by

None

MUtility

Pre-requisites

None

Used by

MySQL

Pre-requisites

Used by

NaiveXML

Pre-requisites

Used by

NetClients

Pre-requisites

Used by

PackageInstaller

Pre-requisites

Used by

None

PackageUtils

Pre-requisites

Used by

Parser

Pre-requisites

None

Used by

Regex

Pre-requisites

None

Used by

SUnit

Pre-requisites

None

Used by

TCP

Pre-requisites

None

Used by

WebServer

Pre-requisites

Used by

XLib

Pre-requisites

Used by

XML

Pre-requisites

None

Used by

XPath

Pre-requisites

Used by

XSL

Pre-requisites

Used by

None

"======================================================================
|
| Copyright 2006 Mike Anderson
| Written by Mike Anderson
|
| This file is part of Mumble, a development environment for GNU Smalltalk.
|
| Mumble is free software; you can redistribute it and/or modify it
| under the terms of the GNU General Public License as published by the Free
| Software Foundation; either version 2, or (at your option) any later version.
| 
| Mumble is distributed in the hope that it will be useful, but WITHOUT
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
| FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
| details.
| 
| You should have received a copy of the GNU General Public License along with
| Mumble; see the file COPYING.  If not, write to the Free Software
| Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
|
 ======================================================================
"

BrowserInitializeResponse subclass: #PackagesInitResponse
!

PackagesInitResponse methodsFor: 'everything'!

selfUrl
        ^'/Browser/Packages'.
!

sendPackageList: aNames heading: aHeading       
        self element: 'h4'; text: aHeading; end: 'h4'.
        aNames isEmpty 
                ifTrue:
                        [ self element: 'p'; text: 'None'; end: 'p' ]
                ifFalse:
                        [ self element: 'ul'.
                        aNames asSortedCollection do:
                                [ :name |
                                self 
                                        element: 'li';
                                        element: 'a';
                                        attribute: 'href' value: '#', name;
                                        text: name;
                                        end: 'a';
                                        end: 'li'. ].
                        self end: 'ul'. ].
!

sendBodyContent
        | pkgs usedBy |
        pkgs := PackageLoader packages.
        usedBy := LookupTable new: pkgs size.
        pkgs do: [ :pkg | usedBy at: pkg name put: Set new ].
        pkgs do: 
                [ :pkg | pkg prerequisites do:
                        [ :prq | usedBy at: prq ifPresent: 
                                [ :set | set add: pkg name ] ] ].
        
        (pkgs asSortedCollection:
                [ :a :b | a name < b name ])
                do:
                [ :pkg |
                self 
                        element: 'div';
                        attribute: 'id' value: pkg name;
                        element: 'h3';
                        text: pkg name;
                        end: 'h3';
                        sendPackageList: pkg prerequisites heading: 
'Pre-requisites';
                        sendPackageList: (usedBy at: pkg name) heading: 'Used 
by';
                        end: 'div'. ].
!

initScript
        ^''
"^'get_and_eval(''', self selfUrl, '?Name=Smalltalk'',
        document.getElementById(''root''));'"
!
!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]