Syntax Highlighting In Wyam
How to make your code look pretty.
I'm going to try and blog about Wyam a bit more. As more folks start using it, I'm getting some really interesting questions about how to do things. Given how flexible Wyam is there's almost always multiple answers too, which makes exploring these questions a great exercise in discovering various features. In today's post I'll look at how to add syntax highlighting to code blocks in generated content.
Supercharge Your Enums
It's easy with this one little trick!
I was recently talking with someone on Twitter about looking back at my old Java code. I don't miss writing Java (there's a good reason I decided to specialize in the .NET stack a decade ago), but there are a couple aspects of the language that I do remember fondly. The way enum types in Java can be more than just atomic values has always struck me as kind of cool. I've found use cases over the years where I wish C# has something similar. I've solved this need in a variety of ways, and I'll show you one of my favorites here for it's simplicity.
Integrating Wyam Into An ASP.NET MVC Site
I heard you like static sites, so I put some static site in your dynamic site
I've seen an interesting static site use case come up a few times recently where someone wants to use a static generator along with an existing dynamic site. The idea is that they would generate certain resources statically at build-time of the dynamic site and then only rely on the dynamic runtime for pages that really need it. I've long suspected that Wyam would be great in this role, particularly for ASP.NET MVC sites given that it can read the same Razor layout files. I finally got motivated enough to give this a try and will detail how to do it in this blog post. It turns out it's not hard at all and works really well once you've gotten everything set up.