Starting support for listed tiddlers.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-10-05 19:26:17 -05:00
parent aa998bfd50
commit ddd6820255
2 changed files with 23 additions and 0 deletions

View File

@ -228,6 +228,17 @@ Tiddler >> list: anObject [
list := anObject 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 |
self list ifNil: [^ nil ].
listedTiddlersTitles := WikiTextGrammar new linkSea star parse: self list.
^ self wiki tiddlers select: [:tiddler | listedTiddlersTitles includes: tiddler title ]
]
{ #category : 'utilities' } { #category : 'utilities' }
Tiddler >> markdownLinksAsWikiText [ Tiddler >> markdownLinksAsWikiText [
"I'm useful to convert _internal_ links between formats, as is a common pattern "I'm useful to convert _internal_ links between formats, as is a common pattern

View File

@ -44,6 +44,11 @@ TiddlyWiki >> configFile [
] ]
{ #category : 'accessing' }
TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection [
^ MarkupFile exportAsFileOn: self file parent / 'subtiddlers.json' containing: (self jsonSubtiddlers: subtiddlersCollection)
]
{ #category : 'accessing' } { #category : 'accessing' }
TiddlyWiki >> exportSTONFile [ TiddlyWiki >> exportSTONFile [
| stonFile output | | stonFile output |
@ -83,6 +88,13 @@ TiddlyWiki >> importJSONFile [
]) ])
] ]
{ #category : 'accessing' }
TiddlyWiki >> jsonSubtiddlers: subtiddlersCollection [
| subtiddlersDict |
subtiddlersDict := subtiddlersCollection collect: [:tiddler | tiddler asDictionary ].
^ STONJSON toStringPretty: subtiddlersDict
]
{ #category : 'accessing' } { #category : 'accessing' }
TiddlyWiki >> loadFromConfig: wikiname [ TiddlyWiki >> loadFromConfig: wikiname [
^ self configDictonary at: wikiname. ^ self configDictonary at: wikiname.