GrafoscopioUtils/repository/Grafoscopio-Utils/OrgMode.class.st
2020-05-02 22:53:56 +00:00

47 lines
746 B
Smalltalk

"
I provide some utilites to work with OrgMode files.
https://orgmode.org/
"
Class {
#name : #OrgMode,
#superclass : #Object,
#instVars : [
'contents',
'file'
],
#category : #'Grafoscopio-Utils'
}
{ #category : #'instance creation' }
OrgMode class >> fromFile: aFileReference [
^ self new contents: aFileReference contents.
]
{ #category : #accessing }
OrgMode >> contents [
^ contents
]
{ #category : #accessing }
OrgMode >> contents: anObject [
contents := anObject
]
{ #category : #accessing }
OrgMode >> file [
^ file
]
{ #category : #accessing }
OrgMode >> file: anObject [
file := anObject
]
{ #category : #utilities }
OrgMode >> selectHeadlines [
^ self contents lines select: [ :line |
line isOrgModeHeader ]
]