snt / antora-mermaid-extension

An Antora extension that adds Mermaid rendering to an Antora site.
2 stars 1 forks source link

README: fix `mermaid_initialize_options` usage #6

Closed veehaitch closed 1 year ago

veehaitch commented 1 year ago

It's rather unexpected but Antora assumes that the configuration uses snake case only and converts the options to camel case internally. Quote from the docs [1]:

In YAML, key names use the snake_case naming convention. In JavaScript, property names use the camelCase naming convention. To help bridge the naming convention mismatch between YAML and JavaScript, Antora automatically transforms snake_case key names in the playbook file into camelCase properties on the configuration object. For example, Antora transforms cache_dir to cacheDir. Most of the time, this isn’t a problem. However, if your extension passes configuration or data on to another application, this transformation can be problematic.

Well, it's a problem here and this commit makes sure this peculiarity is mentioned in the README.

[1] https://docs.antora.org/antora/latest/extend/configure-extension

snt commented 1 year ago

@veehaitch Thank you. It looks better than original JSON in string.