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

[Question] Load & use prism plugins for code blocks #56

Closed
Fictitious-Rotor opened this issue Jul 24, 2020 · 2 comments
Closed

[Question] Load & use prism plugins for code blocks #56

Fictitious-Rotor opened this issue Jul 24, 2020 · 2 comments
Labels
question Further information is requested

Comments

@Fictitious-Rotor
Copy link

Pardon my ignorance, but could you please explain how to load & use prism plugins - such as command-line while using codedoc?

Looking through the npm modules I can see that these plugins are present, but loading them through the script tag using a relative path is disallowed by my web browser (FF).

Is there a native way to load & use these plugins other than copy pasting the prism plugin into a codedoc plugin and loading them that way?

Many thanks

@loreanvictor loreanvictor added the question Further information is requested label Jul 24, 2020
@loreanvictor
Copy link
Contributor

quite honestly I'm not 100% sure. but I can offer some hints (until I can have a deeper look into it later):

  • you don't need to load the plugin code via <script/> tags. that might have been helpful (depending on the situation) if
    highlighting was conducted on the client-side (since you are basically loading highlighter code on the client side). CODEDOC, on the other hand, conducts highlighting during the build stage and NOT on the client, for performance.

  • CODEDOC uses highlight() function from Prism to do build-time highlighting, and I cannot find in the documentation how to add plugin functionality to that (not at least with a quick look at this). So I would try to find the answer to that question.

based on the answer of that question, you might find a solution, however my guess is that most probably it would require some changes to CODEDOC's Code component to make this easy and convenient.

@loreanvictor
Copy link
Contributor

ok according to this issue, using plugins at build time doesn't seem really possible, or at least supported by Prism.

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

No branches or pull requests

2 participants