"
I'm a file strategy that identifies the pillar file on the root of the repository: i.e., index.pillar or book.pillar.

I (will be) used when the user types 
	pillar build pdf
"
Class {
	#name : #PRBuildRootMainStrategy,
	#superclass : #PRBuildStrategy,
	#category : #'Pillar-ExporterCore-Base'
}

{ #category : #accessing }
PRBuildRootMainStrategy >> filesToBuildOn: aProject [ 
	"select the only file with pillar extension in current directory ; if there is no OR several pillar files, relative error is raised"
	
	| pillarFiles|
	pillarFiles := aProject baseDirectory children select: [ :each | each isFile and: [ self isSupportedExtension: each  extension ] ].
	pillarFiles ifEmpty: [ self error: 'There is no pillar (md or pillar) file in the repository root.' ].
	pillarFiles size = 1 ifTrue: [ ^ { (PRInputDocument forFile: pillarFiles first) 
			project: aProject;
			yourself } ].
	self error: 'There is more than one pillar file in the repository root.'
]

"
I'm a file strategy that identifies the pillar file on the root of the repository: i.e., index.pillar or book.pillar.

I (will be) used when the user types 
	pillar build pdf
"
Class {
	#name : #PRBuildRootMainStrategy,
	#superclass : #PRBuildStrategy,
	#category : #'Pillar-ExporterCore-Base'
}

{ #category : #accessing }
PRBuildRootMainStrategy >> filesToBuildOn: aProject [ 
	"select the only file with pillar extension in current directory ; if there is no OR several pillar files, relative error is raised"
	"Now it select a file named index which can be a pillar or a microdown file and if there is no one, relative error is raised"
	
	| pillarFiles|
	pillarFiles := aProject baseDirectory children select: [ :each | each isFile and: [ each base = 'index'  and: [ self isSupportedExtension: each  extension ]] ].
	pillarFiles ifEmpty: [ self error: 'There is no pillar (md or pillar) file in the repository root.' ].
	pillarFiles size = 1 ifTrue: [ ^ { (PRInputDocument forFile: pillarFiles first) 
			project: aProject;
			yourself } ].
	self error: 'There is more than one pillar file in the repository root.'
]

Change the method fileToBuildOn: of PRBuildRootMainStrategy for be able to build if we have a README or something else in microdown because now we build pillar and microdown file but it has to be named index
Change the method fileToBuildOn: of PRBuildRootMainStrategy for be able to build if we have a README or something else in microdown because now we build pillar and microdown file but it has to be named index 
pillar-markup/pillar,pillar-markup/pillar,pillar-markup/pillar