GrafoscopioUtils/repository/Grafoscopio-Utils/OrgMode.class.st

47 lines
746 B
Smalltalk
Raw Normal View History

2020-05-02 13:28:13 +00:00
"
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 ]
]