diff --git a/src/MiniDocs/AcroReport.class.st b/src/MiniDocs/AcroReport.class.st index 683e6d1..f104052 100644 --- a/src/MiniDocs/AcroReport.class.st +++ b/src/MiniDocs/AcroReport.class.st @@ -1,3 +1,6 @@ +" +I model a possible bridge between TaskWarrior and MiniDocs. (starting DRAFT). +" Class { #name : #AcroReport, #superclass : #Object, diff --git a/src/MiniDocs/FileLocator.extension.st b/src/MiniDocs/FileLocator.extension.st index 2ea48bb..939380e 100644 --- a/src/MiniDocs/FileLocator.extension.st +++ b/src/MiniDocs/FileLocator.extension.st @@ -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' diff --git a/src/MiniDocs/LePage.extension.st b/src/MiniDocs/LePage.extension.st index 0703592..ac0d9c6 100644 --- a/src/MiniDocs/LePage.extension.st +++ b/src/MiniDocs/LePage.extension.st @@ -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) ] diff --git a/src/MiniDocs/Logseq.class.st b/src/MiniDocs/Logseq.class.st index 6465dd7..5bde3a2 100644 --- a/src/MiniDocs/Logseq.class.st +++ b/src/MiniDocs/Logseq.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'folder' ], - #category : #MiniDocs + #category : #'MiniDocs-Model' } { #category : #accessing } diff --git a/src/MiniDocs/PubPubGrammar2.class.st b/src/MiniDocs/PubPubGrammar2.class.st index a2a065c..7c08f3b 100644 --- a/src/MiniDocs/PubPubGrammar2.class.st +++ b/src/MiniDocs/PubPubGrammar2.class.st @@ -11,7 +11,7 @@ Class { 'footnoteLabel', 'footnoteContent' ], - #category : #MiniDocs + #category : #'MiniDocs-Model' } { #category : #accessing }