diff --git a/README.md b/README.md index ec72310..f24057a 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ The file `generator.py` provides a list of static file generator classes. Each c The configuration file `config.json` is read which contains the configuration for the API. By specifying the name of the generator in the `generators` array of the configuration, the corresponding generator will be used. The current object of the configuration is passed to the generator. -The following API configuration generates the `contributor` and `release` API for selected repositories: +The following configuration generates static files using the `contributors` and `releases` generator for selected repositories: ```json { "api": [ { - "generators": ["release", "contributor"], + "generators": ["releases", "contributors"], "repositories": ["user/repo"] } ] diff --git a/config.example.json b/config.example.json index 41caae2..0e1876f 100644 --- a/config.example.json +++ b/config.example.json @@ -1,5 +1,5 @@ { - "api": [ + "configs": [ { "generators": [ "release+contributor" diff --git a/main.py b/main.py index e5c5906..6c2e757 100644 --- a/main.py +++ b/main.py @@ -4,13 +4,13 @@ from app.generator import DefaultGeneratorProvider config = load_config() output = config["output"] -apis = config["api"] +configs = config["configs"] -api_provider = DefaultGeneratorProvider() +generator_provider = DefaultGeneratorProvider() -for api in apis: - for generator_name in api["generators"]: - generator = api_provider.get(generator_name) +for config in configs: + for generator_name in config["generators"]: + generator = generator_provider.get(generator_name) if generator is None: continue - generator.generate(api, output) + generator.generate(config, output)