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

Automatic syntax highlighter #206

Open
una opened this issue Feb 8, 2015 · 8 comments
Open

Automatic syntax highlighter #206

una opened this issue Feb 8, 2015 · 8 comments

Comments

@una
Copy link

una commented Feb 8, 2015

Implementing an automatic syntax highlighter for code might be nice :)

Such as Google's Prettify http://google-code-prettify.googlecode.com/svn/trunk/styles/index.html

@mathiasbynens
Copy link

You can easily add this yourself to your slide deck. For example, using highlight.js:

Add this in the <head>:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

Add this before </body>:

<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

And there you go.

I’m not sure if syntax highlighting should be part of Shower by default.

@vkostyukov
Copy link

@mathiasbynens thanks for this how-to guide. Helped me a lot!

@RubenVerborgh
Copy link
Contributor

@pepelsbey I don't think a new plugin is really necessary. After all, an existing syntax highlighter (as linked to by @mathiasbynens) does the job perfectly. I don't see any necessity to integrate this any closer with Shower. Nor could I imagine how that would look like, i.e., how would such a plugin be any different than highlight.js? In fact, highlight.js is already the plugin we're looking for—no need to make a new one.

@pepelsbey
Copy link
Member

@RubenVerborgh, plugin could just integrate such highligher in a better way:

  • Load via the same module system
  • To be initialized using built-in Shower events
  • To be supported on theme’s level (custom palettes)

@lekzd
Copy link

lekzd commented Feb 5, 2018

@pepelsbey I realized sources highlighting via highlight.js on nodejs for our corporate theme.
I can implement this in gulp "prepare" task. But it needs to change serve task. We should serve index.html from "prepared" folder instread of root folder

@pepelsbey
Copy link
Member

@lekzd, I’d go for a separate highlight task that would work inside prepared folder if it’s exists.

@nikolay-govorov
Copy link

@pepelsbey, maybe to close?

@pepelsbey
Copy link
Member

@nikolay-govorov I think this is a good issue to discuss possible plugin that would use Highlight.js or Prism.js.

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

No branches or pull requests

7 participants