@rr0/cms
Version:
RR0 Content Management System (CMS)
101 lines (100 loc) • 3.89 kB
TypeScript
import { HttpSource, RR0CaseMapping, TimeElementFactory, TimeRenderer, TimeReplacer, TimeService, TimeTextBuilder, TimeUrlBuilder } from "./time/index.js";
import { CaseFactory } from "./science/crypto/ufo/enquete/dossier/index.js";
import { CityService, DepartmentService, OrganizationService } from "./org/index.js";
import { HtmlRR0Context, RR0ContextImpl } from "./RR0Context.js";
import { FileWriteConfig, ReplaceCommand } from "ssg-api";
import { PeopleDirectoryStepOptions } from "./people/index.js";
import { PersistentSourceRegistry, SourceRenderer, SourceReplacerFactory } from "./source/index.js";
import { AllDataService, PeopleFactory, PeopleService } from "@rr0/data";
import { GooglePlaceService } from "@rr0/place";
import { PeopleHtmlRenderer } from "./people/PeopleHtmlRenderer.js";
import { CountryService } from "./org/country/CountryService.js";
import { CMSContext } from "./CMSContext.js";
import { TimeOptions } from "./time/TimeOptions.js";
import { DataOptions } from "./DataOptions.js";
export interface CMSGeneratorOptions {
contentRoots: string[];
copies: string[];
outDir: string;
locale: string;
googleMapsApiKey: string;
mail: string;
dataOptions: {
time: TimeOptions;
org: DataOptions;
};
siteBaseUrl: string;
timeFormat: Intl.DateTimeFormatOptions;
directoryPages: string[];
ufoCaseDirectoryFile: string;
ufoCasesExclusions: string[];
sourceRegistryFileName: string;
directoryExcluded: string[];
directoryOptions: PeopleDirectoryStepOptions;
mappings: RR0CaseMapping<any>[];
contentReplacers?: ReplaceCommand<HtmlRR0Context>[];
}
export interface CMSGenerationOptions {
/**
* Configuration file name.
*/
config?: string;
/**
* If the search index must be regenerated or not.
* For ex: "pages,sources"
*/
reindex?: string[];
/**
* Comma-separated list of file patterns to parse as contents.
*/
contents?: string[];
/**
* Comma-separated list of file patterns to copy to out dir.
*/
copies?: string[];
/**
* Comma-separated list of file patterns to books to generate TOCs for.
*/
books?: string;
/**
* Force re-generation even if file has not changed.
*/
force?: string;
}
export declare class CMSGenerator implements CMSContext {
protected options: CMSGeneratorOptions;
readonly config: FileWriteConfig;
readonly context: RR0ContextImpl;
readonly placeService: GooglePlaceService;
readonly orgService: OrganizationService;
readonly caseFactory: CaseFactory;
readonly dataService: AllDataService;
readonly peopleFactory: PeopleFactory;
readonly cityService: CityService;
readonly departmentService: DepartmentService;
readonly countryService: CountryService;
readonly timeTextBuilder: TimeTextBuilder;
readonly timeService: TimeService;
readonly timeRenderer: TimeRenderer;
readonly timeUrlBuilder: TimeUrlBuilder;
readonly http: HttpSource;
constructor(options: CMSGeneratorOptions);
generate(args: CMSGenerationOptions): Promise<void>;
protected setupSources(timeTextBuilder: TimeTextBuilder, timeFormat: Intl.DateTimeFormatOptions): {
sourceRenderer: SourceRenderer;
sourceFactory: PersistentSourceRegistry;
sourceReplacerFactory: SourceReplacerFactory;
};
protected setupTime(context: RR0ContextImpl): {
timeFiles: string[];
timeElementFactory: TimeElementFactory;
timeReplacer: TimeReplacer;
};
protected setupPeople(context: RR0ContextImpl, peopleRenderer: PeopleHtmlRenderer, copies: string[]): Promise<{
peopleService: PeopleService;
peopleSteps: import("./people/PeopleDirectoryStep.js").PeopleDirectoryStep[];
copies: string[];
}>;
private setupNotes;
private setupCases;
}