-
Notifications
You must be signed in to change notification settings - Fork 9
Support prism syntax highlighting #5
Comments
is there any solution for this problem. Need syntax highlightning for css and sass. |
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. |
This reverts commit 0bb842b.
…ism"" This reverts commit ea68877.
@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 |
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. |
@simonpioli can you send a link to that repo for reference? Or perhaps post of gist of the changes? |
@thomasbruketta Unfortunately the repos are in work's private BitBucket account. |
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`.
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.
This also addresses pattern-lab#5 by adding a means of dynamically loading Prism languages, which the `styleguidekit-assets-default` lacks by default.
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:
The text was updated successfully, but these errors were encountered: