With daucus, configuration is optional.
Use a JavaScript or JSON file (daucus-config.js
, daucus-config.mjs
, or daucus-config.json
) to specify configuration information for an entire directory and all of its subdirectories (i.e. your Daucus Workspace).
All options are defined and documented in the @daucus/cli
package using TypeScript interfaces:
You can use the JSON Schema @daucus/cli/daucus-config.schema.json
to validate your JSON configuration file and enable autocompletion in most code editors:
{
"$schema": "./node_modules/@daucus/cli/daucus-config.schema.json",
...
}
Some configuration features (e.g. compiler functions) are only avaible in JavaScript.
When using JavaScript, be sure to use the right file extension depending on the nearest npm package configuration.
For most cases, we recommend using the ES Module format with a daucus-config.mjs
file:
/** @type {import('@daucus/cli').DaucusJSConfig}*/
const config = {
// your configuration...
};
export default config;
You can also use the CJS format with a daucus-config.js
file :
/** @type {import('@daucus/cli').DaucusJSConfig}*/
const config = {
// your configuration...
};
module.exports = config;
::: danger
Avoid setting your npm package "type"
to "module"
in your package.json as it may lead to some conflits with other tools, like Snowpack.
:::
::: warning For now, Daucus can only convert Markdown to HTML. :::
By default, Daucus will use @daucus/pandoc
if available, or snarkdown.
Specifying a CompilerId in the configuration (via the <project>.compiler
or defaultCompiler
options) will lead to an error if the associated compiler isn't available.
Daucus can use any function matching the FunctionCompiler signature.
Such custom compilers can be defined in a JS configuration file via the <project>.compiler
or defaultCompiler
options.