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

Detatch Prism from CodeFlask #120

Open
kazzkiq opened this issue Jun 4, 2020 · 0 comments
Open

Detatch Prism from CodeFlask #120

kazzkiq opened this issue Jun 4, 2020 · 0 comments
Milestone

Comments

@kazzkiq
Copy link
Owner

kazzkiq commented Jun 4, 2020

Related: #110, #66, #65

CodeFlask should be a thin layer built on top of any available web syntax-highlighter out there.

While I still think Prism is the best suited syntax highlighter available, some users raised the possibility of being able to choose between other libs and also configure the highlighter outside of CodeFlask.

For me it makes sense. This lib would then expose an API to connect any highlighter with the editor instance and let users configure the chosen lib as they see fit (with themes, supported languages, etc).

This approach may lead to a leaner core.

Usage example (now):

import CodeFlask from 'codeflask';

const flask = new CodeFlask('#editor', {
  language: 'js'
});

Usage example in v2:

import CodeFlask from 'codeflask';
import Prism from 'prismjs';

const flask = new CodeFlask('#editor', {
  language: 'js',
  highlighter: Prism.highlightElement
});
@kazzkiq kazzkiq added this to the v2 milestone Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant