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