Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rethink markdown-it plugin options configuration #186

Open
tuurep opened this issue Sep 19, 2024 · 1 comment
Open

Rethink markdown-it plugin options configuration #186

tuurep opened this issue Sep 19, 2024 · 1 comment
Labels
topic:infrastructure e.g. API, config type:enhancement Adding to/changing existing feature

Comments

@tuurep
Copy link
Collaborator

tuurep commented Sep 19, 2024

Background:

In tests/rendering/markdown-additional.md looking at the toc revealed an issue with how we allow using vivify's config.json to set the markdown-it options for markdown-it-table-of-contents plugin:

The toc links are supposed to have the same additional formatting as the headers, for example if I have a header:

## Introducing **foo** `bar`

the toc link should also have bold and code.

But it's not working because along with applying the settings from config.json, we set any other defaults as empty. (Relevant option: format in this table)

So we need to tweak the config handling such that:

  • Defaults are preserved and vivify user options applied on top of those
  • Still being able to override plugin defaults

This will also be relevant for #141 custom alert configuration.

@tuurep tuurep added type:feature New feature or request type:enhancement Adding to/changing existing feature topic:infrastructure e.g. API, config and removed type:feature New feature or request labels Sep 19, 2024
@tuurep
Copy link
Collaborator Author

tuurep commented Sep 23, 2024

Turns out it's a little complicated for us - ideally the it would be handled in the plugins' side that when you set e.g. a single option, it doesn't throw away all the defaults. But this is not standard, plus plugins can have very individual ways to handle the default options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:infrastructure e.g. API, config type:enhancement Adding to/changing existing feature
Projects
None yet
Development

No branches or pull requests

1 participant