Puppet 4 syntax highlighting in Wordpress

70 views
Skip to first unread message

Alex Harvey

unread,
Mar 27, 2016, 4:53:01 AM3/27/16
to Puppet Users
Hi all,

Does anyone out there have any tips for getting nice-looking Puppet 4 syntax highlighting to work in a Wordpress blog?  I am currently using Alex Mills's SyntaxHighlighter Evolved and I found one apparently unmaintained plugin for Puppet 3 era plugin en-jbrinkley/syntaxhighlighter-puppet.  Googling isn't bringing up anything written after Puppet 4 was released.

All the best,
Alex

--
Partner
RAZOR Consulting
t: +61 409 665 227
w: http://razorconsulting.com.au

Trevor Vaughan

unread,
Mar 27, 2016, 10:54:24 AM3/27/16
to puppet...@googlegroups.com
Hi Alex,

I don't think that any specific highlighting has been released for Puppet 4 but I find that the Ruby syntax highlighting does a reasonable job in most cases.

Trevor

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3d915b0d-402a-4944-9ef2-fc1f64908519%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699

-- This account not approved for unencrypted proprietary information --

Alex Harvey

unread,
Mar 28, 2016, 12:57:55 AM3/28/16
to Puppet Users
Ruby highlighting's not doing so well in my case:


There must be a solution to this because there are lots of Puppet blogs out there that are all looking great.

Alex Harvey

unread,
Apr 9, 2016, 4:35:34 AM4/9/16
to Puppet Users
I still haven't found any Puppet syntax highlighting plugins for Puppet (3 or 4).  I'll be most grateful to anyone willing to share their secrets with me. :)

Nigel Kersten

unread,
Apr 11, 2016, 3:48:14 PM4/11/16
to public puppet users
I do Puppet syntax highlighting like this:

Open up puppet code in Vim with syntax highlighting on.

Use ":TOhtml" to save it as a formatted HTML file.

Either use the HTML snippet directly on a web page, or for some GUI HTML editors, they'll understand styled text in your clipboard buffer (that's how I preserve editable text, but syntax highlighted for PowerPoint/Keynote slide decks)

This way I can toggle stuff like Vim line numbering that sometimes I want on, and sometimes I want off, and I'm using the same syntax highlighter that I use for normal editing of Puppet code.



On Sat, Apr 9, 2016 at 1:35 AM, Alex Harvey <alexh...@gmail.com> wrote:
I still haven't found any Puppet syntax highlighting plugins for Puppet (3 or 4).  I'll be most grateful to anyone willing to share their secrets with me. :)

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.

Trevor Vaughan

unread,
Apr 11, 2016, 7:55:20 PM4/11/16
to puppet...@googlegroups.com
Nigel, that is pure sorcery and how did I not know this existed?!


For more options, visit https://groups.google.com/d/optout.

Hunter Haugen

unread,
Apr 11, 2016, 8:06:36 PM4/11/16
to puppet-users
On Mon, Apr 11, 2016 at 4:55 PM, Trevor Vaughan <tvau...@onyxpoint.com> wrote:
Nigel, that is pure sorcery and how did I not know this existed?!

On Mon, Apr 11, 2016 at 3:48 PM, Nigel Kersten <ni...@puppet.com> wrote:
I do Puppet syntax highlighting like this:

Open up puppet code in Vim with syntax highlighting on.

Use ":TOhtml" to save it as a formatted HTML file.

I've been using spacemacs for a while. It's pretty spiffy. It has the equivalent via `htmlize-file` or just `htmlize-region` if you don't need the whole file: http://spacemacs.brianthicks.com/2015/10/06/render-a-file-to-html/

(oh, and that also works in emacs)
 

Either use the HTML snippet directly on a web page, or for some GUI HTML editors, they'll understand styled text in your clipboard buffer (that's how I preserve editable text, but syntax highlighted for PowerPoint/Keynote slide decks)

This way I can toggle stuff like Vim line numbering that sometimes I want on, and sometimes I want off, and I'm using the same syntax highlighter that I use for normal editing of Puppet code.



On Sat, Apr 9, 2016 at 1:35 AM, Alex Harvey <alexh...@gmail.com> wrote:
I still haven't found any Puppet syntax highlighting plugins for Puppet (3 or 4).  I'll be most grateful to anyone willing to share their secrets with me. :)

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/247df98c-0a7c-4883-ae27-7580d5c2a808%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAGUqgV8abAnVfSzk5mH_nzMETxjo2APa-%2B7-V_HUTUL9o499bg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699

-- This account not approved for unencrypted proprietary information --

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.

Alex Harvey

unread,
Apr 12, 2016, 10:57:08 AM4/12/16
to Puppet Users


On Tuesday, April 12, 2016 at 5:48:14 AM UTC+10, Nigel Kersten wrote:
I do Puppet syntax highlighting like this:

Open up puppet code in Vim with syntax highlighting on.

Use ":TOhtml" to save it as a formatted HTML file.

Either use the HTML snippet directly on a web page, or for some GUI HTML editors, they'll understand styled text in your clipboard buffer (that's how I preserve editable text, but syntax highlighted for PowerPoint/Keynote slide decks)

This way I can toggle stuff like Vim line numbering that sometimes I want on, and sometimes I want off, and I'm using the same syntax highlighter that I use for normal editing of Puppet code.


I just tried it.  That is, indeed, really cool.  Thank you so much!

Reply all
Reply to author
Forward
0 new messages