Shared Smalltalk Workspace http://ws.stfx.eu/

http://ws.stfx.eu/http://ws.stfx.eu/

Doit | Raw | Getting Started Workspace | Home | New
"This script converst selected tiddlers from JSON format to STON,
so versioning and querying can be improved."
| tiddlersFile tiddler tiddlers curated folder tiddlersSTON |

folder := FileLocator home / 'Descargas/Comunal/wiki'.  
tiddlersFile := folder / 'tiddlers.json'.
tiddlers := NeoJSONReader fromString: tiddlersFile contents.
tiddler := tiddlers first. "Test single value"
curated := tiddlers reject: [:tid | (tid keys includes: 'type') and: [ (tid at: 'type') beginsWith: 'image/' ] ].
{ tiddlers . curated }.
tiddlersSTON := String streamContents: [ :stream |
	(STONWriter on: stream)
		prettyPrint: true;
"		newLine: String lf;"
		keepNewLines: true;
		nextPut: curated ]. "Cleaning a base64 binary image for tests."

MarkupFile exportAsFileOn: folder / 'tiddlers.ston' containing:  tiddlersSTON.

THIS SOFTWARE SERVICE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR SERVICE PROVIDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE SERVICE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE SERVICE.