Improving oracles' import/export.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-07-06 12:20:25 -05:00
parent 9f8556bfa3
commit f5edec4708
4 changed files with 8 additions and 4 deletions

View File

@ -3,5 +3,5 @@ asTiddler
^ Tiddler new
title: self name;
tags: 'Starforged';
text: self intro, String lf, String lf, self optionsWikiTextTable;
text: self introText, String cr, String cr, self optionsWikiTextTable;
created: DateAndTime now asString.

View File

@ -1,7 +1,7 @@
accessing
fromDictionary: aDictionary
| optionsTable |
name := aDictionary at: 'Name'.
name := aDictionary at: 'Name' ifAbsent: [ name := aDictionary at: 'Display name' ].
optionsTable := aDictionary at: 'Table'.
optionsTable doWithIndex: [:opt :i | | key value prevKey |
(i = 1)

View File

@ -0,0 +1,3 @@
accessing
introText
^ self intro ifNil: [ ^ '' ]

View File

@ -2,9 +2,10 @@ accessing
optionsWikiTextTable
| output |
output := '' writeStream.
self options keysAndValuesDo: [:k :v |
self options keysAndValuesDo: [:k :v | | keyString |
keyString := ((k size = 1) ifTrue: [ k first asString ] ifFalse: [ k first asString, ' - ', k last asString ]).
output
nextPutAll: '| ', k first asString, ' - ', k last asString, ' |';
nextPutAll: '| ',keyString , ' |';
nextPutAll: v, ' |'; cr
].
^ output contents