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

Allow processing global metadata with the keys option #68

Comments

@webketje
Copy link
Member

webketje commented Apr 20, 2023

Currently the keys option is an array that will check all file keys.
There are use cases where it is desirable to be able to format global metadata (for example when fetching rich text translations from a third party provider). A flexible implementation could change the keys option to accept both an array and an object. When an array is specified it is remapped to keys.files for backwards-compatibility, and when an object is defined both are allowed. In a future version the current keys: Array signature can be removed

EG.

ms.use(markdown({
  wildcard: true,
  keys: {
    global: ['labels.*'],
    files: ['faq.*',- 'description']
  },
  globalRefs: './global-refs.md'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment