Browse Source

Class comment formatting

Nicolas Petton 11 years ago
parent
commit
085fa95f49
2 changed files with 14 additions and 11 deletions
  1. 1 1
      js/Importer-Exporter.js
  2. 13 10
      st/Importer-Exporter.st

+ 1 - 1
js/Importer-Exporter.js

@@ -1437,7 +1437,7 @@ smalltalk.LegacyPackageHandler.klass);
 
 
 smalltalk.addClass('PluggableExporter', smalltalk.Object, ['recipe'], 'Importer-Exporter');
-smalltalk.PluggableExporter.comment="I am an engine for exporting structured data on a Stream.\x0a\x0aMy instances are created using\x0a  PluggableExporter newUsing: recipe,\x0awhere recipe is structured description of the exporting algorithm,\x0a\x0aThen actual exporting is done using\x0a  aPluggableExporter export: data usingRecipe: recipe on: stream\x0a\x0aRecipe is an array, which can contain two kinds of elements:\x0a - an assocation where key is the receiver and value is two-arg selector\x0a    In this case, `receiver perform: selector withArguments: { data. stream }` is called.\x0a\x09This essentially defines one step of export process.\x0a\x09The key (eg. receiver) is presumed to be some kind of 'repository' of the exporting methods\x0a\x09that just format appropriate aspect of data into a stream; like a class or a singleton,\x0a\x09so you can make the recipe itself decoupled from data.\x0a - a subarray (sa), where first element is special and the rest is recursive recipe\x0a    `sa first` must be an association similar to one above,\x0a\x09with key being the 'repository' receiver, but value is one-arg selector.\x0a\x09In this case, `receiver perform: selector withArguments: { data }` should create a collection.\x0a\x09Then, the sub-recipe (`sa allButFirst`) is applied to every element of a collection, eg.\x0a\x09  collection do: [ :each | self export: each using: sa allButFirst on: stream ]\x0a  \x0aI am used to export amber packages, so I have convenience method\x0aexportPackage: aPackage on: aStream\x0awhich exports aPackage using recipe you passed on newUsing:\x0a(it is otherwise no special, so it may be renamed to export:on:)";
+smalltalk.PluggableExporter.comment="I am an engine for exporting structured data on a Stream.\x0a\x0aMy instances are created using\x0a  PluggableExporter newUsing: recipe,\x0awhere recipe is structured description of the exporting algorithm.\x0a\x0aThen actual exporting is done using\x0a  aPluggableExporter export: data usingRecipe: recipe on: stream\x0a\x0aRecipe is an array, which can contain two kinds of elements:\x0a\x0a - an assocation where the key is the receiver and the value is a two-arguments selector\x0a    In this case, `receiver perform: selector withArguments: { data. stream }` is called.\x0a\x09This essentially defines one step of export process.\x0a\x09The key (eg. receiver) is presumed to be some kind of 'repository' of the exporting methods\x0a\x09that just format appropriate aspect of data into a stream; like a class or a singleton,\x0a\x09so you can make the recipe itself decoupled from data.\x0a\x0a - a subarray, where first element is special and the rest is recursive recipe.\x0a\x0a    `subarray first` must be an association similar to one above,\x0a\x09with key being the 'repository' receiver, but value is one-arg selector.\x0a\x09In this case, `receiver perform: selector withArguments: { data }` should create a collection.\x0a\x09Then, the sub-recipe (`subarray allButFirst`) is applied to every element of a collection, eg.\x0a\x09  collection do: [ :each | self export: each using: sa allButFirst on: stream ]\x0a  \x0aI am used to export amber packages, so I have a convenience method\x0a`exportPackage: aPackage on: aStream`\x0awhich exports `aPackage` using the `recipe` passed on `newUsing:`\x0a(it is otherwise no special, so it may be renamed to export:on:)";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "export:usingRecipe:on:",

+ 13 - 10
st/Importer-Exporter.st

@@ -536,8 +536,8 @@ PackageHandler subclass: #LegacyPackageHandler
 	instanceVariableNames: ''
 	package: 'Importer-Exporter'!
 !LegacyPackageHandler commentStamp!
-I am responsible for handling package loading and committing.
-
+I am responsible for handling package loading and committing.
+
 I should not be used directly. Instead, use the corresponding `Package` methods.!
 
 !LegacyPackageHandler methodsFor: 'committing'!
@@ -646,28 +646,31 @@ I am an engine for exporting structured data on a Stream.
 
 My instances are created using
   PluggableExporter newUsing: recipe,
-where recipe is structured description of the exporting algorithm,
+where recipe is structured description of the exporting algorithm.
 
 Then actual exporting is done using
   aPluggableExporter export: data usingRecipe: recipe on: stream
 
 Recipe is an array, which can contain two kinds of elements:
- - an assocation where key is the receiver and value is two-arg selector
+
+ - an assocation where the key is the receiver and the value is a two-arguments selector
     In this case, `receiver perform: selector withArguments: { data. stream }` is called.
 	This essentially defines one step of export process.
 	The key (eg. receiver) is presumed to be some kind of 'repository' of the exporting methods
 	that just format appropriate aspect of data into a stream; like a class or a singleton,
 	so you can make the recipe itself decoupled from data.
- - a subarray (sa), where first element is special and the rest is recursive recipe
-    `sa first` must be an association similar to one above,
+
+ - a subarray, where first element is special and the rest is recursive recipe.
+
+    `subarray first` must be an association similar to one above,
 	with key being the 'repository' receiver, but value is one-arg selector.
 	In this case, `receiver perform: selector withArguments: { data }` should create a collection.
-	Then, the sub-recipe (`sa allButFirst`) is applied to every element of a collection, eg.
+	Then, the sub-recipe (`subarray allButFirst`) is applied to every element of a collection, eg.
 	  collection do: [ :each | self export: each using: sa allButFirst on: stream ]
   
-I am used to export amber packages, so I have convenience method
-exportPackage: aPackage on: aStream
-which exports aPackage using recipe you passed on newUsing:
+I am used to export amber packages, so I have a convenience method
+`exportPackage: aPackage on: aStream`
+which exports `aPackage` using the `recipe` passed on `newUsing:`
 (it is otherwise no special, so it may be renamed to export:on:)!
 
 !PluggableExporter methodsFor: 'accessing'!