Improved listed tiddlers.
This commit is contained in:
parent
ddd6820255
commit
8894a61b12
@ -230,13 +230,24 @@ Tiddler >> list: anObject [
|
||||
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> listedTiddlers [
|
||||
"I only include the so called 'pureLinks' or manual links (see [1]) i.e. those which are enclosed in '[[' and ']]'
|
||||
An improved future version of me should include all links with CamelCase
|
||||
[1] https://tiddlywiki.com/static/Linking%2520in%2520WikiText.html"
|
||||
| listedTiddlersTitles |
|
||||
"I export all tiddlers in the list field as an alphabetic collection.
|
||||
Future versions should preserve the order in the list."
|
||||
| remainList remainListArray listedTiddlers |
|
||||
self list ifNil: [^ nil ].
|
||||
listedTiddlersTitles := WikiTextGrammar new linkSea star parse: self list.
|
||||
^ self wiki tiddlers select: [:tiddler | listedTiddlersTitles includes: tiddler title ]
|
||||
remainList := self list copy.
|
||||
self manualLinksList do: [:manualLink |
|
||||
remainList := remainList copyReplaceAll: manualLink with: ''
|
||||
].
|
||||
remainListArray := (remainList copyReplaceAll: '[[]]' with: '') withBlanksCondensed splitOn: Character space.
|
||||
listedTiddlers := self manualLinksList, remainListArray.
|
||||
^ self wiki tiddlers select: [:tiddler | listedTiddlers includes: tiddler title ].
|
||||
|
||||
]
|
||||
|
||||
{ #category : 'accessing' }
|
||||
Tiddler >> manualLinksList [
|
||||
self list ifNil: [^ nil].
|
||||
^ WikiTextGrammar new linkSea star parse: self list.
|
||||
]
|
||||
|
||||
{ #category : 'utilities' }
|
||||
|
Loading…
Reference in New Issue
Block a user