Adding exporting options.
This commit is contained in:
parent
f1d39f2fc6
commit
7fcc13e450
3
RoloLudo.package/SfTruth.class/instance/asJson.st
Normal file
3
RoloLudo.package/SfTruth.class/instance/asJson.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
asJson
|
||||
^ STONJSON toStringPretty: (self asTiddlers collect: [:each | each asDictionary]) asArray
|
23
RoloLudo.package/SfTruth.class/instance/asTiddlers.st
Normal file
23
RoloLudo.package/SfTruth.class/instance/asTiddlers.st
Normal file
@ -0,0 +1,23 @@
|
||||
accessing
|
||||
asTiddlers
|
||||
| tiddlers transcluderText transcluder |
|
||||
tiddlers := OrderedCollection new.
|
||||
transcluderText := '' writeStream.
|
||||
self options doWithIndex: [:opt :i | | tiddler |
|
||||
tiddler := Tiddler new
|
||||
title: self name, 'Option', i asString;
|
||||
text: opt asWikiText;
|
||||
created: DateAndTime now asString.
|
||||
transcluderText nextPutAll: '{{', tiddler title, '}}'; cr; cr.
|
||||
tiddlers add: tiddler.
|
||||
].
|
||||
transcluderText
|
||||
nextPutAll: '----'; cr;
|
||||
nextPutAll: '👤 ', self character.
|
||||
transcluder := Tiddler new
|
||||
title: self name;
|
||||
tags: 'Starforged Truths';
|
||||
text: transcluderText contents;
|
||||
created: DateAndTime now asString.
|
||||
tiddlers add: transcluder.
|
||||
^ tiddlers
|
3
RoloLudo.package/SfTruth.class/instance/character.st
Normal file
3
RoloLudo.package/SfTruth.class/instance/character.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
character
|
||||
^ character
|
19
RoloLudo.package/SfTruthOption.class/instance/asWikiText.st
Normal file
19
RoloLudo.package/SfTruthOption.class/instance/asWikiText.st
Normal file
@ -0,0 +1,19 @@
|
||||
accessing
|
||||
asWikiText
|
||||
| stream |
|
||||
stream := '' writeStream.
|
||||
stream
|
||||
nextPutAll: '<b>';
|
||||
nextPutAll: self chance first asString, '-', self chance last asString;
|
||||
nextPutAll: ' | ', self brief;
|
||||
nextPutAll: '</b>'; cr;
|
||||
nextPutAll: String cr;
|
||||
nextPutAll: self details;
|
||||
nextPutAll: String cr;
|
||||
nextPutAll: self subtableAsWikiText.
|
||||
stream
|
||||
nextPutAll: String cr;
|
||||
nextPutAll: '<$details summary="Quest Starter">'; cr;
|
||||
nextPutAll: '//', self questStarter, '//'; cr;
|
||||
nextPutAll: '</$details>'.
|
||||
^ stream contents
|
3
RoloLudo.package/SfTruthOption.class/instance/details.st
Normal file
3
RoloLudo.package/SfTruthOption.class/instance/details.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
details
|
||||
^ details
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
questStarter
|
||||
^ questStarter
|
@ -0,0 +1,10 @@
|
||||
accessing
|
||||
subtableAsWikiText
|
||||
| stream chances |
|
||||
stream := '' writeStream.
|
||||
self subtable ifEmpty: [ ^ stream contents ].
|
||||
chances := self subtable collect: [ :each | each at: 'Chance' ].
|
||||
chances doWithIndex: [:ch :i |
|
||||
stream nextPutAll: '| ', ch asString, ' |', ((self subtable at: i) at: 'Description'), ' |' ; cr
|
||||
].
|
||||
^ stream contents
|
Loading…
Reference in New Issue
Block a user