PubPub footnotes conversion

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-05-10 11:31:54 -05:00
parent e20cca500e
commit 77ddf8a801
1 changed files with 26 additions and 3 deletions

View File

@ -140,6 +140,21 @@ Markdeep >> contents [
^ output contents.
]
{ #category : #accessing }
Markdeep >> converPubPubFootnoteBetween: footnote and: nextFootnote in: footnotesArray [
| currentNoteIndex nextNoteIndex response noteLines |
currentNoteIndex := footnotesArray indexOf: footnote, ': '.
nextNoteIndex := footnotesArray indexOf: footnote, ': '.
noteLines := footnotesArray copyFrom: currentNoteIndex to: nextNoteIndex.
response := '' writeStream.
noteLines do: [:line |
line
ifNotEmpty: [ response nextPutAll: line, Character lf ]
ifEmpty: [ response nextPut: '<br>' ]
].
^ response contents
]
{ #category : #utilities }
Markdeep >> fontAwesomeHeader [
"I enable the font awesome support in the document header"
@ -411,7 +426,7 @@ Markdeep >> removeCCByLicenseDiv [
{ #category : #accessing }
Markdeep >> renamePubPubFootnotes [
| footnotesLines footnotesIDs toReplace |
| footnotesLines footnotesIDs toReplace response |
footnotesLines := self contents lines
copyFrom: self pubPubFootnotesLinesRange first
to: self pubPubFootnotesLinesRange second.
@ -423,8 +438,16 @@ Markdeep >> renamePubPubFootnotes [
index := footnotesLines indexOf: replacement.
footnotesLines at: index put: '[^', (footnotesIDs at: i),']: '
].
^ footnotesLines
response := '' writeStream.
footnotesIDs allButLast doWithIndex: [:footnote :i |
response
nextPutAll:
(self
converPubPubFootnoteBetween: footnote
and: (footnotesIDs at: i + 1)
in: footnotesLines)
].
^ response
]
{ #category : #accessing }