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

Consider frontend plugins as a method for adding features to default templates #240

Open
isaacwhite opened this issue Dec 17, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@isaacwhite
Copy link
Member

isaacwhite commented Dec 17, 2020

@afischer points out that mkdocs has some nice features to allow for custom formats within documentation that include custom styles on the pages. It would be really powerful to add a new customization type that supported this pattern.

Could include something like the following properties, with our code highlighting logic is a proof-of-concept.

module.exports = {
  matcher: /regex or callback here/, // either some regex or a callback that returns an array of matches
  replacement: (match, captureGroupEtc) => {
    // this returns some HTML to put in the output in place of the matched text
  },
  scripts: // string or callback, these get injected into the page when matcher returns a nonempty array
  styles: // string or callback, these get injected into the page when matcher returns a nonempty
  domains: // optional, new domains to allow in csp for script/style additions
}
@isaacwhite isaacwhite added the enhancement New feature or request label Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant