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

Prism plugins #2

Closed
montogeek opened this issue Aug 20, 2018 · 4 comments
Closed

Prism plugins #2

montogeek opened this issue Aug 20, 2018 · 4 comments

Comments

@montogeek
Copy link

Are Prism plugin supported? I guess not since they operate in DOM Nodes.

@kitten
Copy link
Contributor

kitten commented Aug 20, 2018

No, they’re unfortunately not :)

The point is more or less that it’ll be a quick affair to implement most visual features from scratch, (although libraries on top of this one aren’t out of the question of course.)

The CodeSandbox example has a small line number indicator for instance.

@kitten kitten closed this as completed Aug 20, 2018
@detj
Copy link

detj commented Feb 5, 2019

@kitten I'm wondering what are the challenges in supporting existing Prism plugins. And could you share the CodeSandbox example link ?

@kitten
Copy link
Contributor

kitten commented Mar 1, 2019

@detj The challenge is that this is purely intended to render to React with no output that is target by Prism's existing plugins. So you'd choose this library specifically to build a specific style of code highlighting in React :) So it's about granularity

@JiangWeixian
Copy link

maybe provide a hooks version just like https://github.com/tannerlinsley/react-table, will be easy to implement a plugin, just like useExpand in useTable in https://github.com/tannerlinsley/react-table

const {
    getTableProps,
    getTableBodyProps,
    headerGroups,
    rows,
    prepareRow,
    state: { expanded },
  } = useTable(
    {
      columns: userColumns,
      data,
    },
    useExpanded // Use the useExpanded plugin hook
  )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants