@matti I'm touching up the plugins to get them all in line with the best practices and parameter paradigm I developed along the way. Afterwards, I'll register them with @manton's new process.
You can install the prism plugin right now the same way that I do. Go to Design -> Edit Custom Themes -> New Plugin
Name it whatever you like and stick the repository address in https://github.com/moonbuck/plugin-prism
. The plugin will be cloned in the exact same manner as through the registered list of plugins.
I believe the README is up to date for the current version. Regardless, it's what I use for all the syntax highlighting so holler if you end up with questions: the blog post README version
@matti I created a shortcode for syntax highlighting shortcodes. I use it for the opening braces and less than … same thing oughta work for just the braces. I have gotten around a lot of quirks bit new ones are always popping up. So far I've figured out how to highlight anything I've thrown at it … but I don't always remember how I did it. The shortcode post
@matti The Hugo parser is constantly getting in the way. To go around it I've had to do thinks like the shortcode (cause then whatever is inside doesn't get parsed again) and in other cases I literally have to parse and correct the content with regular expressions. Nothing has made appreciate what I had with Swift than d$cking around with Hugo and Javascript
@matti It's funny. Trying to get the Hugo in all the READMEs to render was a b$tch. I just remembered that some double curlies would be cool and others would totally break. Not sure if I figured that one out or decided I didn't need to show the partial. This was before I figured out the shortcode hack. Thst probably would have solved it.
@matti @moondeer We could monkey patch the built-in highlight shortcode to play better with Micro.blog. As an interim solution until @manton updates Hugo to a newer version. I have a plug-in working with decent results on the default theme.
Feel free to install and play around with Highlight Monkey. 🙈
@sod @manton @matti I've head great success with mine as well (just gotta jump through some hoops when the code is Hugo code): plugin-prism. It also loads various prism plugins (so you can have a code copy button, for example).
You can see it in action via the walkthrough I've been working on.
You can find a bunch more by entering README into my site's search box.
@Moondeer Yeah, I stumbled upon your plug-in; it's awesome and way more polished than my approach. Mine is mostly a proof of concept. Nevertheless, I thought it worthwhile to experiment with monkey patching the built-in highlight
shortcode for two reasons.
First, it works without JavaScript, and second, Hugo template code "just works." So no jumping through hoops is necessary.
But, with @manton rolling out changes today, my plug-in will probably soon be obsolete.
@sod @manton @matti I tend to tinker just to see what can be done (why I never really finished any of the iOS apps). My approach rebuilding the cards plugin is way beyond what I was doing when I started. So now I'm going back through and getting all the plugins inline with plugin-cards … which is mostly about consistency and parameterizing the sh$t out of everything since any Javascript or stylesheets will be templated and built at compile time. I've gotten to a few of them but no READMEs have been updated. Side note: plugin-programmable-search-engine and plugin-toc are pretty sick as well. I created the site search plugin just before rebuilding plugin-cards and I actually created the table of contents plugin when I realized just how ginirmous that walkthrough I linked was getting.
@sod It occurs to me I probably oughta look at how you did it … I'm on an island figuring this stuff out through mostly trial and error (I did at least consume some fresh books on Javascript and CSS to refresh my memory (and solidify my love for the Swift programming language … what I would give to be coding this stuff in Swift)).