Skip to content

Detatch Prism from CodeFlask #120

Description

@kazzkiq

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
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions