From 88bf7cda730d66f2c975e182e332ad2ba6e77f5e Mon Sep 17 00:00:00 2001 From: Gavin McFarland <5551+gavinmcfarland@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:01:42 +0100 Subject: [PATCH] wip --- README.md | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d01b825..99f14e9 100644 --- a/README.md +++ b/README.md @@ -102,29 +102,52 @@ mole.config('src/mole.config.js') ## API -- **`mole.config( string | object ): void`** +- ### Set configuration - Set the configuration. + `mole.config( config ): void` -- **`mole.theme( string | object ): void`** + #### Parameters - Set or update the theme data. + `config` { string | object } path to file, or object for config -- **`mole.register( model: string | template: string, name: string, callback?: function ): void`** +- ### Set or update theme data + + `mole.theme( string | object ): void` + + #### Arguments + +`data` { string | object } path to file, or object for data + +- ### Register a model or template + + `mole.register( type, name, callback ): void` + + #### Arguments + + `type` { string } must be `'model'` or `'template'` + `name` { string } the name of the model or template + `callback` { function | string } the body of the model or template Register a model or template for use. -- **`mole.use( model: string | template: string, name, callback? ): void`** +- ### Use a model or template + + `mole.use( part ): void` + + #### Arguments - Use a model or template directory, or use one that has been registered. + `part` { array } an array + `type` { string } must be `'template'` or `'model'` + `name` { string } name of the template or model + `callback` { function | string } the body of the model or template -- **`mole.render(): string[]`** +- ### Render an array of templates - Returns an array of rendered templates. + `mole.render(): string[]` -- **`mole.build()`** +- ### Build the output files - Builds the output files. + `mole.build()` ## Development