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 {
|
||||
#name : #AcroReport,
|
||||
#superclass : #Object,
|
||||
|
@ -23,6 +23,30 @@ FileLocator class >> atAlias: aString put: aFolderOrFile [
|
||||
^ 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' }
|
||||
FileLocator class >> fileAliases [
|
||||
^ MiniDocs appFolder / 'fileAliases.ston'
|
||||
|
@ -124,8 +124,15 @@ LePage >> exportMetadataToHead: markdeep [
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> exportedFileName [
|
||||
| sanitized |
|
||||
sanitized := self title asDashedLowercase romanizeAccents copyWithoutAll: #($/ $: $🢒).
|
||||
| sanitized titleWords shortTitle |
|
||||
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)
|
||||
]
|
||||
|
||||
|
@ -4,7 +4,7 @@ Class {
|
||||
#instVars : [
|
||||
'folder'
|
||||
],
|
||||
#category : #MiniDocs
|
||||
#category : #'MiniDocs-Model'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
|
@ -11,7 +11,7 @@ Class {
|
||||
'footnoteLabel',
|
||||
'footnoteContent'
|
||||
],
|
||||
#category : #MiniDocs
|
||||
#category : #'MiniDocs-Model'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
|
Loading…
Reference in New Issue
Block a user