Abstracting PubPub republication process.
This commit is contained in:
parent
dc218111e6
commit
745e9d8e6e
@ -463,11 +463,19 @@ Markdeep >> removeCCByLicenseDiv [
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
Markdeep >> renamePubPubFootnotes [
|
Markdeep >> renamePubPubFootnotes [
|
||||||
| reformated bodyLines beforeFootnotes afterFootnotes newBodyLines response |
|
| reformated bodyLines beforeFootnotes afterFootnotesRaw afterFootnotes newBodyLines response |
|
||||||
reformated := self reformatPubPubFootnotes.
|
reformated := self reformatPubPubFootnotes.
|
||||||
bodyLines := self body lines.
|
bodyLines := self body lines.
|
||||||
beforeFootnotes := bodyLines copyFrom: 1 to: self pubPubFootnotesLinesRangeForBody first .
|
beforeFootnotes := bodyLines copyFrom: 1 to: self pubPubFootnotesLinesRangeForBody first .
|
||||||
afterFootnotes := bodyLines copyFrom: self pubPubFootnotesLinesRangeForBody second to: bodyLines size.
|
afterFootnotesRaw := bodyLines copyFrom: self pubPubFootnotesLinesRangeForBody second to: bodyLines size.
|
||||||
|
afterFootnotes := OrderedCollection new.
|
||||||
|
afterFootnotesRaw do:[:line |
|
||||||
|
(line beginsWith: ':::')
|
||||||
|
ifTrue: [
|
||||||
|
afterFootnotes
|
||||||
|
add: (line copyReplaceAll: ':::' with: '<!--@div-closer ::: -->').
|
||||||
|
]
|
||||||
|
].
|
||||||
newBodyLines :=
|
newBodyLines :=
|
||||||
(beforeFootnotes copyWithAll:
|
(beforeFootnotes copyWithAll:
|
||||||
(#('# Footnotes' '')
|
(#('# Footnotes' '')
|
||||||
@ -487,6 +495,16 @@ Markdeep >> replaceBackslashBreaklines [
|
|||||||
'
|
'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
Markdeep >> replaceEscapedCharacters [
|
||||||
|
self
|
||||||
|
title: (self title copyReplaceAll: '\#' with: '#');
|
||||||
|
body: (self body copyReplaceAll: '\#' with: '#');
|
||||||
|
body: (self body copyReplaceAll: '\[' with: '[');
|
||||||
|
body: (self body copyReplaceAll: '\]' with: ']');
|
||||||
|
body: (self body copyReplaceAll: '\*' with: '*')
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
Markdeep >> replacePubPubFootnotesIdentifiers [
|
Markdeep >> replacePubPubFootnotesIdentifiers [
|
||||||
| footnotes sanitized parsedLinks linkIdentifiers |
|
| footnotes sanitized parsedLinks linkIdentifiers |
|
||||||
|
48
src/MiniDocs/PubPub.class.st
Normal file
48
src/MiniDocs/PubPub.class.st
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
Class {
|
||||||
|
#name : #PubPub,
|
||||||
|
#superclass : #Object,
|
||||||
|
#instVars : [
|
||||||
|
'address',
|
||||||
|
'tableOfContents',
|
||||||
|
'titles',
|
||||||
|
'folder'
|
||||||
|
],
|
||||||
|
#category : #'MiniDocs-Model'
|
||||||
|
}
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PubPub >> address [
|
||||||
|
^ address
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PubPub >> address: anUrl [
|
||||||
|
address := anUrl
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PubPub >> defaultTitle [
|
||||||
|
^ self titles associations first value
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PubPub >> folder: localDirectory [
|
||||||
|
folder := localDirectory
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PubPub >> printOn: aStream [
|
||||||
|
super printOn: aStream.
|
||||||
|
aStream
|
||||||
|
nextPutAll: '(',self defaultTitle, ' | ', self address, ' )'
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #'as yet unclassified' }
|
||||||
|
PubPub >> tableOfContents [
|
||||||
|
^ tableOfContents ifNil: [tableOfContents := Dictionary new]
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PubPub >> titles [
|
||||||
|
^ titles ifNil: [titles := OrderedDictionary new]
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user