Merge bb7bab403e
This commit is contained in:
commit
e26334425f
@ -1,3 +1,6 @@
|
|||||||
|
"
|
||||||
|
I model a possible bridge between TaskWarrior and MiniDocs. (starting DRAFT).
|
||||||
|
"
|
||||||
Class {
|
Class {
|
||||||
#name : #AcroReport,
|
#name : #AcroReport,
|
||||||
#superclass : #Object,
|
#superclass : #Object,
|
||||||
|
@ -23,6 +23,30 @@ FileLocator class >> atAlias: aString put: aFolderOrFile [
|
|||||||
^ updatedAliases
|
^ updatedAliases
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
FileLocator >> extractMetadata [
|
||||||
|
"I package the functionality from [[How to extract meta information using ExifTool]],
|
||||||
|
from the GToolkit Book.
|
||||||
|
I depend on the external tool ExifTool."
|
||||||
|
|
||||||
|
| process variablesList |
|
||||||
|
process := GtSubprocessWithInMemoryOutput new
|
||||||
|
command: 'exiftool';
|
||||||
|
arguments: { self fullName}.
|
||||||
|
process errorBlock: [ :proc | ^ self error: 'Failed to run exiftool' ].
|
||||||
|
process runAndWait.
|
||||||
|
variablesList := process stdout lines collect: [ :currentLine |
|
||||||
|
| separatorIndex name value |
|
||||||
|
separatorIndex := currentLine indexOf: $:.
|
||||||
|
name := (currentLine copyFrom: 1 to: separatorIndex - 1) trimBoth.
|
||||||
|
value := (currentLine
|
||||||
|
copyFrom: separatorIndex + 1
|
||||||
|
to: currentLine size) trimBoth.
|
||||||
|
name -> value
|
||||||
|
].
|
||||||
|
^ variablesList asOrderedDictionary
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
FileLocator class >> fileAliases [
|
FileLocator class >> fileAliases [
|
||||||
^ MiniDocs appFolder / 'fileAliases.ston'
|
^ MiniDocs appFolder / 'fileAliases.ston'
|
||||||
|
@ -124,8 +124,15 @@ LePage >> exportMetadataToHead: markdeep [
|
|||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
LePage >> exportedFileName [
|
LePage >> exportedFileName [
|
||||||
| sanitized |
|
| sanitized titleWords shortTitle |
|
||||||
sanitized := self title asDashedLowercase romanizeAccents copyWithoutAll: #($/ $: $🢒).
|
titleWords := self title splitOn: Character space.
|
||||||
|
(titleWords size > 11)
|
||||||
|
ifTrue: [
|
||||||
|
titleWords := titleWords copyFrom: 1 to: 3.
|
||||||
|
shortTitle := titleWords joinUsing: Character space.
|
||||||
|
]
|
||||||
|
ifFalse: [shortTitle := self title].
|
||||||
|
sanitized := shortTitle asDashedLowercase romanizeAccents copyWithoutAll: #($/ $: $🢒 $,).
|
||||||
^ sanitized , '--' , (self uidString copyFrom: 1 to: 5)
|
^ sanitized , '--' , (self uidString copyFrom: 1 to: 5)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ Class {
|
|||||||
#instVars : [
|
#instVars : [
|
||||||
'folder'
|
'folder'
|
||||||
],
|
],
|
||||||
#category : #MiniDocs
|
#category : #'MiniDocs-Model'
|
||||||
}
|
}
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
@ -11,7 +11,7 @@ Class {
|
|||||||
'footnoteLabel',
|
'footnoteLabel',
|
||||||
'footnoteContent'
|
'footnoteContent'
|
||||||
],
|
],
|
||||||
#category : #MiniDocs
|
#category : #'MiniDocs-Model'
|
||||||
}
|
}
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
Loading…
Reference in New Issue
Block a user