From fa6303b762413f679cfa37eadf34b0aae3733a60 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Wed, 25 Sep 2024 17:17:34 -0500 Subject: [PATCH 1/3] Creating short titles, when titles are too long. --- src/MiniDocs/LePage.extension.st | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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) ] From 65fb92964fad62e5d9a59261ea7328c0e7c4a839 Mon Sep 17 00:00:00 2001 From: Offray Date: Mon, 14 Oct 2024 10:34:35 -0500 Subject: [PATCH 2/3] Reclasifying. --- src/MiniDocs/AcroReport.class.st | 3 +++ src/MiniDocs/Logseq.class.st | 2 +- src/MiniDocs/PubPubGrammar2.class.st | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) 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/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 } From bb7bab403e2ef2ada0ffd25c3f982da6294a4a08 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 14 Oct 2024 13:01:27 -0500 Subject: [PATCH 3/3] File metadata extraction. --- src/MiniDocs/FileLocator.extension.st | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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'