Creating default exporter for tex template.

This commit is contained in:
ruidajo 2022-04-16 01:37:11 -05:00
parent c9d9ec9620
commit f28e884a79
4 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,7 @@
accessing accessing
asDictionary asDictionary
^ { 'profile-card-avatar' -> self profileImageFile fullName. ^ { 'profile-card-avatar' -> self profileImageFile values first fullName.
'profile-card-fullname' -> self name . 'profile-card-fullname' -> self name .
'profile-card-username' -> self userName . 'profile-card-username' -> self userName .
'profile-bio' -> self profileBio } asDictionary 'profile-bio' -> self profileBio } asDictionary

View File

@ -0,0 +1,4 @@
accessing
exportDefaultReport
^ self exportWithTemplate: TweetsCollection dataStore / 'templates' / 'template.mus.tex' into: self folder

View File

@ -14,7 +14,7 @@ exportProfileImageOn: fileReference
tempFile := FileLocator temp / fileReference basename. tempFile := FileLocator temp / fileReference basename.
tempFile ensureCreateFile. tempFile ensureCreateFile.
tempFile binaryWriteStreamDo: [ :stream | tempFile binaryWriteStreamDo: [ :stream |
stream nextPutAll: profileImageUrl retrieveContents. stream nextPutAll: profileImageUrl asUrl retrieveContents.
super class super class
inform: 'Exported as: ', String cr, tempFile fullName. ]. inform: 'Exported as: ', String cr, tempFile fullName. ].

View File

@ -6,7 +6,8 @@ exportWithTemplate: mustacheFile into: folder
modified := self asDictionary at: 'profile-bio'. modified := self asDictionary at: 'profile-bio'.
modified := modified copyReplaceAll: '@' with: '\@'. modified := modified copyReplaceAll: '@' with: '\@'.
modified := modified copyReplaceAll: '_' with: '\_'. modified := modified copyReplaceAll: '_' with: '\_'.
modified := modified copyReplaceAll: '#' with: '\#'.
tempDictionary at: 'profile-bio' put: modified. tempDictionary at: 'profile-bio' put: modified.
MarkupFile ^ MarkupFile
exportAsFileOn: (folder / self userName , 'tex') exportAsFileOn: (folder / self userName , 'tex')
containing:(mustacheFile asMustacheTemplate value: tempDictionary) containing:(mustacheFile asMustacheTemplate value: tempDictionary)