Moving functionality to improve modularity.
This commit is contained in:
parent
af064db451
commit
d822926612
@ -43,7 +43,7 @@ LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocati
|
|||||||
remoteMetadata := Markdeep new metadataFromXML: markdeepDocTree.
|
remoteMetadata := Markdeep new metadataFromXML: markdeepDocTree.
|
||||||
"Ensuring remote metadata has consistent data"
|
"Ensuring remote metadata has consistent data"
|
||||||
remoteMetadata at: 'origin' put: externalDocLocation.
|
remoteMetadata at: 'origin' put: externalDocLocation.
|
||||||
remoteMetadata at: 'title' ifAbsentPut: [ page detectMarkdeepTitleFrom: markdeepDocTree ].
|
remoteMetadata at: 'title' ifAbsentPut: [ markdeepDocTree detectMarkdeepTitle ].
|
||||||
remoteMetadata at: 'id' ifAbsentPut: [UUID new asString36].
|
remoteMetadata at: 'id' ifAbsentPut: [UUID new asString36].
|
||||||
remoteMetadata at: 'created' ifAbsentPut: [ DateAndTime now] .
|
remoteMetadata at: 'created' ifAbsentPut: [ DateAndTime now] .
|
||||||
remoteMetadata at: 'creator' ifAbsentPut: [ 'unknown' ].
|
remoteMetadata at: 'creator' ifAbsentPut: [ 'unknown' ].
|
||||||
|
@ -99,14 +99,6 @@ LePage >> defaultPandocTemplate [
|
|||||||
^ FileLocator home / '.pandoc' / 'templates' / 'clean-menu-mod.html'
|
^ FileLocator home / '.pandoc' / 'templates' / 'clean-menu-mod.html'
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
|
||||||
LePage >> detectMarkdeepTitleFrom: xmlSubtree [
|
|
||||||
| titleLine |
|
|
||||||
titleLine := (xmlSubtree nodesCollect: [:node | node contentString ]) first lines
|
|
||||||
detect: [:line | line includesSubstring: ' **'] ifNone: ['Untitled'].
|
|
||||||
^ titleLine trimmed trimBoth: [:char | char = $* ]
|
|
||||||
]
|
|
||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
LePage >> detectParentSnippetWithUid: uidString [
|
LePage >> detectParentSnippetWithUid: uidString [
|
||||||
uidString = self uid asString36 ifTrue: [ ^ self ].
|
uidString = self uid asString36 ifTrue: [ ^ self ].
|
||||||
|
9
src/MiniDocs/XMLDocument.extension.st
Normal file
9
src/MiniDocs/XMLDocument.extension.st
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Extension { #name : #XMLDocument }
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
XMLDocument >> detectMarkdeepTitle [
|
||||||
|
| titleLine |
|
||||||
|
titleLine := (self nodesCollect: [:node | node contentString ]) first lines
|
||||||
|
detect: [:line | line includesSubstring: ' **'] ifNone: ['Untitled'].
|
||||||
|
^ titleLine trimmed trimBoth: [:char | char = $* ]
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user