Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Support prism syntax highlighting #5

Open
bmuenzenmeyer opened this issue Sep 20, 2016 · 7 comments
Open

Support prism syntax highlighting #5

bmuenzenmeyer opened this issue Sep 20, 2016 · 7 comments

Comments

@bmuenzenmeyer
Copy link
Member

bmuenzenmeyer commented Sep 20, 2016

I'd expect this to work from within the plugin:

PrismLanguages.add({'<<type>>': '<<type>>'});

especially in the case of css which comes standard with prism.

Despite this - i get the following (unhighlighted) output:

image

@bmuenzenmeyer
Copy link
Member Author

@AxelHo
Copy link

AxelHo commented Jan 31, 2017

is there any solution for this problem. Need syntax highlightning for css and sass.
prismedContent = Prism.highlight(this.responseText, Prism.languages['html']);
seems to me that everything is highlighted as html

@bmuenzenmeyer
Copy link
Member Author

I documented my efforts so far above. I would like to get back to figuring this out but it is not a current priority. Hoping someone else can take the reigns on it.

simonpioli added a commit to simonpioli/plugin-node-tab that referenced this issue Oct 10, 2017
simonpioli added a commit to simonpioli/plugin-node-tab that referenced this issue Oct 10, 2017
simonpioli added a commit to simonpioli/plugin-node-tab that referenced this issue Oct 10, 2017
simonpioli added a commit to simonpioli/plugin-node-tab that referenced this issue Oct 10, 2017
simonpioli added a commit to simonpioli/plugin-node-tab that referenced this issue Oct 10, 2017
simonpioli added a commit to simonpioli/plugin-node-tab that referenced this issue Oct 10, 2017
simonpioli added a commit to simonpioli/plugin-node-tab that referenced this issue Oct 10, 2017
@jefarrell
Copy link

@simonpioli I'm trying to implement this - was there any reason you stopped where you did? Did you have it working? It would be such a nice feature to have

@simonpioli
Copy link

I only managed to get it working by manually concatenating the languages I wanted from Prism into our styleguidekit before using them so the solution ended up being external to this project.

I haven't got round to porting it back to this repo and refactoring it to use the config.

@thomasbruketta
Copy link

@simonpioli can you send a link to that repo for reference? Or perhaps post of gist of the changes?

@simonpioli
Copy link

@thomasbruketta Unfortunately the repos are in work's private BitBucket account.
I'll have to take a look through and make sure there's no API keys etc before I stick them on here.

laurenhamel added a commit to laurenhamel/plugin-node-tab that referenced this issue Jan 25, 2019
This somewhat addresses pattern-lab#5, but requires that additional fixes be applied to the `patternlab-viewer.js`. More specifically, it requires changing the way the `Prism.highlight` identifies the appropriate language to use. Currently, `patternlab-viewer.js` defaults to using `Prism.languages.html`. In sum, I will also be forking and updating the `styleguidekit-assets-default` package with these changes in order to allow for the snippets language to be passed in via `Panels.add`.
laurenhamel added a commit to laurenhamel/styleguidekit-assets-default that referenced this issue Jan 27, 2019
Updates the `panels-viewer.js`, and thus `patternlab-viewer.js`, to improve the way code snippets are highlighted by Prism. This is part of the fix I alluded to for pattern-lab/plugin-node-tab#5.
laurenhamel added a commit to laurenhamel/plugin-node-tab that referenced this issue Jan 27, 2019
This also addresses pattern-lab#5 by adding a means of dynamically loading Prism languages, which the `styleguidekit-assets-default` lacks by default.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants