This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-10-22 13:43:02 -05:00
commit e26334425f
5 changed files with 38 additions and 4 deletions

View File

@ -1,3 +1,6 @@
"
I model a possible bridge between TaskWarrior and MiniDocs. (starting DRAFT).
"
Class {
#name : #AcroReport,
#superclass : #Object,

View File

@ -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'

View File

@ -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)
]

View File

@ -4,7 +4,7 @@ Class {
#instVars : [
'folder'
],
#category : #MiniDocs
#category : #'MiniDocs-Model'
}
{ #category : #accessing }

View File

@ -11,7 +11,7 @@ Class {
'footnoteLabel',
'footnoteContent'
],
#category : #MiniDocs
#category : #'MiniDocs-Model'
}
{ #category : #accessing }